From 1838104e4b4286dec305d2349925c5e541727451 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 14 Apr 2022 18:01:23 +0800 Subject: [PATCH] refactor: vector can be compared --- src/__comm__/_convex_hull2.scad | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/__comm__/_convex_hull2.scad b/src/__comm__/_convex_hull2.scad index 711c7d45..0e06d5d4 100644 --- a/src/__comm__/_convex_hull2.scad +++ b/src/__comm__/_convex_hull2.scad @@ -23,9 +23,7 @@ function _convex_hull_upper_m(chain, p, m, t) = function _convex_hull_upper_chain(points, chain, m, t, i) = i < 0 ? chain : - let( - current_m = _convex_hull_upper_m(chain, points[i], m, t) - ) + let(current_m = _convex_hull_upper_m(chain, points[i], m, t)) _convex_hull_upper_chain( points, [each slice(chain, 0, current_m), points[i]], @@ -36,7 +34,7 @@ function _convex_hull_upper_chain(points, chain, m, t, i) = function _convex_hull2(points) = let( - sorted = sort(points, by = function(p1, p2) p1.x < p2.x || (p1.x == p2.x && p1.y < p2.y) ? -1 : 1), + sorted = sort(points, by = function(p1, p2) p1 < p2 ? -1 : 1), leng = len(sorted), lwr_ch = _convex_hull_lower_chain(sorted, leng, [], 0, 0), leng_lwr_ch = len(lwr_ch),