diff --git a/src/polygon_hull.scad b/src/polygon_hull.scad index ceed93dd..300ef892 100644 --- a/src/polygon_hull.scad +++ b/src/polygon_hull.scad @@ -11,5 +11,11 @@ use <__comm__/_convex_hull2.scad>; module polygon_hull(points) { - polygon(_convex_hull2(points)); + poly = _convex_hull2(points); + polygon(poly); + test_convex_hull2(poly); +} + +module test_convex_hull2(poly) { + } \ No newline at end of file diff --git a/test/test_all.scad b/test/test_all.scad index 2328c6a3..5f5f0971 100644 --- a/test/test_all.scad +++ b/test/test_all.scad @@ -2,6 +2,7 @@ include ; include ; include ; +include ; // 3D include ; diff --git a/test/test_polygon_hull.scad b/test/test_polygon_hull.scad new file mode 100644 index 00000000..b8a7b539 --- /dev/null +++ b/test/test_polygon_hull.scad @@ -0,0 +1,19 @@ +include ; + +module test_polygon_hull() { + echo("==== test_polygon_hull ===="); + polygon_hull([ + [1, 1], + [1, 0], + [0, 1], + [-2, 1], + [-1, -1] + ]); +} + + +module test_convex_hull2(poly) { + assert(poly == [[-2, 1], [-1, -1], [1, 0], [1, 1]]); +} + +test_polygon_hull(); \ No newline at end of file