diff --git a/bezier_circle_approximation.scad b/bezier_circle_approximation.scad index fd404d2..3d1a1bc 100644 --- a/bezier_circle_approximation.scad +++ b/bezier_circle_approximation.scad @@ -1,15 +1,32 @@ +include ; + a=90; -module bezier_curve(p0, p1, p2, p3) { - // TODO +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); + } } -module /*TODO*/ { - c = /*TODO*/; - bezier_curve( - [0, 1], - [c, 1], - [1, c], - [1, 0] - ); -} +circle_(50);