scad/bezier_circle_approximation.scad
2025-07-09 21:25:52 +02:00

32 lines
677 B
OpenSCAD

include <primitives.scad>;
a=90;
module circle_(r) {
c = 0.55191;
cp=[
[ 0, 1, 0], // 0
[ c, 1, 0], // 1
[ 1, c, 0], // 2
[ 1, 0, 0], // 3
[ 1, 0, 0], // 4
[ 1, -c, 0], // 5
[ c, -1, 0], // 6
[ 0, -1, 0], // 7
[ 0, -1, 0], // 8
[-c, -1, 0], // 9
[-1, -c, 0], // a
[-1, 0, 0], // b
[-1, 0, 0], // c
[-1, c, 0], // d
[-c, 1, 0], // e
[ 0, 1, 0] // f
];
for (i=[0:3]) {
control_points=[cp[i*4], cp[i*4+1], cp[i*4+2], cp[i*4+3]];
curve_vertices=bezier_curve_vertices(control_points*r, $fn);
render_curve(curve_vertices, width=2, height=2, chamfer=1, debug=false);
}
}
circle_(50);