1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-25 22:09:12 +02:00

fix order

This commit is contained in:
Justin Lin
2022-04-09 19:14:22 +08:00
parent 12a7c918f1
commit a99456225f

View File

@@ -6,7 +6,7 @@ function _cmp(a, b) =
function _convex_hull_sort_by_xyz(pts) = function _convex_hull_sort_by_xyz(pts) =
let(leng = len(pts)) let(leng = len(pts))
leng <= 1 ? pts : leng <= 1 ? pts :
leng == 2 ? (_cmp(pts[1], pts[0]) ? pts : [pts[1], pts[0]]) : leng == 2 ? (_cmp(pts[1], pts[0]) ? [pts[1], pts[0]] : pts) :
let( let(
pivot = pts[0], pivot = pts[0],
before = [for(j = 1; j < leng; j = j + 1) if(_cmp(pts[j], pivot)) pts[j]], before = [for(j = 1; j < leng; j = j + 1) if(_cmp(pts[j], pivot)) pts[j]],