mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-17 20:11:50 +02:00
add convex_ct_clk_order
This commit is contained in:
10
src/experimental/convex_ct_clk_order.scad
Normal file
10
src/experimental/convex_ct_clk_order.scad
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
use <util/sort.scad>;
|
||||||
|
use <experimental/convex_center_p.scad>;
|
||||||
|
|
||||||
|
function convex_ct_clk_order(points) =
|
||||||
|
let(
|
||||||
|
cpt = convex_center_p(points),
|
||||||
|
pts_as = [for(p = points) [p, atan2(p[1] - cpt[1], p[0] - cpt[0])]],
|
||||||
|
sorted = sort(pts_as, by = "idx", idx = 1)
|
||||||
|
)
|
||||||
|
[for(v = sorted) v[0]];
|
Reference in New Issue
Block a user