Fixed hull_points() for 2D

This commit is contained in:
Revar Desmera 2019-05-01 00:07:55 -07:00
parent 3a71633f7f
commit 66b82fc287
2 changed files with 2 additions and 3 deletions

View file

@ -291,8 +291,7 @@ function simplify_path_indexed(points, path, eps=EPSILON, _a=0, _b=2, _acc=[]) =
// point_in_polygon(point, path) // point_in_polygon(point, path)
// Description: // Description:
// This function tests whether the given point is inside, outside or on the boundary of // This function tests whether the given point is inside, outside or on the boundary of
// the specified polygon using the Winding Number method: // the specified polygon using the Winding Number method.
// - (http://geomalgorithms.com/a03-_inclusion.html)
// The polygon is given as a list of points, not including the repeated end point. // The polygon is given as a list of points, not including the repeated end point.
// Returns -1 if the point is outside the polyon. // Returns -1 if the point is outside the polyon.
// Returns 0 if the point is on the boundary. // Returns 0 if the point is on the boundary.

View file

@ -62,7 +62,7 @@ module hull_points(points, fast=false) {
} }
} else { } else {
perim = hull(points); perim = hull(points);
if (len(perim[0]) == 2) { if (is_num(perim[0])) {
polygon(points=points, paths=[perim]); polygon(points=points, paths=[perim]);
} else { } else {
polyhedron(points=points, faces=perim); polyhedron(points=points, faces=perim);