1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 14:56:47 +02:00
This commit is contained in:
Justin Lin
2022-03-01 13:06:27 +08:00
parent 1d7d45e3ed
commit 8475049fad
2 changed files with 3 additions and 4 deletions

View File

@@ -26,10 +26,9 @@ function _tri_circumcircle(shape_pts) =
x = (d1 * v0[1] - d0 * v1[1]) / det, x = (d1 * v0[1] - d0 * v1[1]) / det,
y = (d0 * v1[0] - d1 * v0[0]) / det, y = (d0 * v1[0] - d1 * v0[0]) / det,
center = [x, y], center = [x, y],
v = p0 - center, v = p0 - center
rr = v[0] ^ 2 + v[1] ^ 2
) )
[center, rr]; [center, v * v];
function cc_center(cc) = cc[0]; function cc_center(cc) = cc[0];
function cc_rr(cc) = cc[1]; function cc_rr(cc) = cc[1];

View File

@@ -4,7 +4,7 @@ use <_convex_centroid.scad>;
function _convex_ct_clk_order(points) = function _convex_ct_clk_order(points) =
let( let(
cpt = _convex_centroid(points), cpt = _convex_centroid(points),
pts_as = [for(p = points) [p, atan2(p[1] - cpt[1], p[0] - cpt[0])]], pts_as = [for(p = points) [p, atan2(p.y - cpt.y, p.x - cpt.x)]],
sorted = sort(pts_as, by = "idx", idx = 1) sorted = sort(pts_as, by = "idx", idx = 1)
) )
[for(v = sorted) v[0]]; [for(v = sorted) v[0]];