OpenSCAD Conic Bezier Curve by donb 3d model
3dmdb logo
Thingiverse
OpenSCAD Conic Bezier Curve by donb

OpenSCAD Conic Bezier Curve by donb

by Thingiverse
Last crawled date: 3 years ago
Conic Bézier Curve for OpenSCAD
also known as Quadratic Bezier Curve
also known as Bezier Curve with 3 control points
also known as 'Conic Arcs' or 'Parabolic Segments'
By Don B, 2011, released into the Public Domain
What's it for
Bezier curves allow you to pick a small number of 'control points', then let the computer fill in a pretty curve between them. In this thing, 3 control points are used.
Notes
This is for 3-point bezier curves; there is another popular type, the 4-point 'Cubic', that this code doesn't do.
This is inspired by William Adam's cubic bezier Thingiverse OpenSCAD code. His code now also handles Conics; I guess I will leave this thing here as a sort of 'super simple' 'for dummies' version.
The first sample image shows a simple 3 control-point curved polygon, and a rod around which it can be rotated. The result of this rotation is shown in the big smooth object.
The next sample image shows the code itself; the module is only about 10 lines long thanks to OpenSCAD's built-in vector math.
Please see also
http://www.thingiverse.com/thing:8443 by William A Adams (Cubic Beziers)http://en.wikipedia.org/wiki/File:Bezier_2_big.gif by Phil Tregoninghttp://en.wikipedia.org/wiki/B%C3%A9zier_curve by Wikipedia editorshttp://www.freetype.org/freetype2/docs/glyphs/glyphs-6.html David Turner + Freetype team
Using the code
download the .scad file, below
copy/paste the BezConic module to your own code
call it like this:
p0=[15,0];
p1=[1,14];
p2=[7,30];
linear_extrude() BezConic(p0,p1,p2,steps=20);
Fun Facts
Bézier are named after Pierre Bézier, who used the work of Paul de Casteljau to make curves on car bodies. Casteljau worked at Citroen and Bezier worked at Renault.
They are named 'conic' because 3-point Bezier's are basically parabolas. A parabola is basically the intersection of a cone with a plane (i.e. a conic section). Please see wikipedia for more info.
Conic Arc Bézier Curves (3 control points) are used by TrueType fonts.

Tags