1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-19 04:51:26 +02:00

remove center param

This commit is contained in:
Justin Lin
2022-07-29 08:32:43 +08:00
parent b83d9440c0
commit 86d5da1e23

View File

@@ -1,16 +1,16 @@
use <__comm__/__frags.scad>
use <ptf/ptf_rotate.scad>
function great_circle_arc(p1, p2, center = [0, 0, 0]) =
function great_circle_arc(p1, p2) =
let(
radius = norm(p1 - center),
radius = norm(p1),
normal_vt = cross(p2, p1),
a = acos(p2 * p1 / pow(radius, 2)),
steps = round(a / (360 / __frags(radius)))
)
steps == 0 ? [p1, p2] :
let(a_step = a / steps)
[for(i = [0:steps]) ptf_rotate(p1, a_step * i, normal_vt) + center];
[for(i = [0:steps]) ptf_rotate(p1, a_step * i, normal_vt)];
/*
use <experimental/great_circle_arc.scad>