diff --git a/src/experimental/arc_great_circle.scad b/src/experimental/arc_great_circle.scad new file mode 100644 index 00000000..1f3433dc --- /dev/null +++ b/src/experimental/arc_great_circle.scad @@ -0,0 +1,12 @@ +use <__comm__/__frags.scad> +use + +function arc_great_circle(p1, p2, center = [0, 0, 0]) = + let( + radius = norm(p1 - center), + normal_vt = cross(p2, p1), + a = acos(p2 * p1 / pow(radius, 2)), + steps = round(a / (360 / __frags(radius))), + a_step = a / steps + ) + [for(i = [0:steps]) ptf_rotate(p1, a_step * i, normal_vt)]; \ No newline at end of file