From d5fa8807e014107f5c2e757b32e1b4a7ca38471a Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 20 Apr 2022 23:00:58 +0800 Subject: [PATCH] add polygon_abuse --- src/polygon_hull.scad | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/polygon_hull.scad b/src/polygon_hull.scad index 300ef892..a15a57ed 100644 --- a/src/polygon_hull.scad +++ b/src/polygon_hull.scad @@ -10,10 +10,17 @@ use <__comm__/_convex_hull2.scad>; -module polygon_hull(points) { - poly = _convex_hull2(points); - polygon(poly); - test_convex_hull2(poly); +module polygon_hull(points, polygon_abuse = false) { + if(polygon_abuse) { + // It's workable only because `polyhedron` doesn't complain about mis-ordered faces. + // It's fast but might be invalid in later versions. + hull() polygon(points); + } + else { + poly = _convex_hull2(points); + polygon(poly); + test_convex_hull2(poly); + } } module test_convex_hull2(poly) {