1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-05 14:27:45 +02:00

refactor: use sorted

This commit is contained in:
Justin Lin
2022-05-01 15:54:27 +08:00
parent d2d3c1e707
commit e16a869a3f

View File

@@ -1,6 +1,6 @@
use <util/sort.scad>;
use <util/sorted.scad>;
use <experimental/convex_centroid.scad>;
function convex_ct_clk_order(points) =
let(cpt = convex_centroid(points))
sort(points, by = function(p1, p2) cross(p2 - cpt, p1 - cpt));
sorted(points, cmp = function(p1, p2) cross(p2 - cpt, p1 - cpt));