hide is_polygon_on_list

remove debug echo
This commit is contained in:
Adrian Mariano 2022-01-10 19:55:54 -05:00
parent ec900943df
commit 000ddf87c3
2 changed files with 15 additions and 17 deletions

View file

@ -2171,23 +2171,23 @@ function _are_polygons_equal(poly1, poly2, eps, st) =
max([for(d=poly1-select(poly2,st,st-1)) d*d])<eps*eps; max([for(d=poly1-select(poly2,st,st-1)) d*d])<eps*eps;
// Function: is_polygon_in_list() /// Function: _is_polygon_in_list()
// Topics: Polygons, Comparators /// Topics: Polygons, Comparators
// See Also: are_polygons_equal(), are_regions_equal() /// See Also: are_polygons_equal(), are_regions_equal()
// Usage: /// Usage:
// bool = is_polygon_in_list(poly, polys); /// bool = _is_polygon_in_list(poly, polys);
// Description: /// Description:
// Returns true if one of the polygons in `polys` is equivalent to the polygon `poly`. /// Returns true if one of the polygons in `polys` is equivalent to the polygon `poly`.
// Arguments: /// Arguments:
// poly = The polygon to search for. /// poly = The polygon to search for.
// polys = The list of polygons to look for the polygon in. /// polys = The list of polygons to look for the polygon in.
function is_polygon_in_list(poly, polys) = function _is_polygon_in_list(poly, polys) =
__is_polygon_in_list(poly, polys, 0); ___is_polygon_in_list(poly, polys, 0);
function __is_polygon_in_list(poly, polys, i) = function ___is_polygon_in_list(poly, polys, i) =
i >= len(polys)? false : i >= len(polys)? false :
are_polygons_equal(poly, polys[i])? true : are_polygons_equal(poly, polys[i])? true :
__is_polygon_in_list(poly, polys, i+1); ___is_polygon_in_list(poly, polys, i+1);
// Section: Convex Hull // Section: Convex Hull

View file

@ -398,7 +398,7 @@ function are_regions_equal(region1, region2, either_winding=false) =
function __are_regions_equal(region1, region2, i) = function __are_regions_equal(region1, region2, i) =
i >= len(region1)? true : i >= len(region1)? true :
!is_polygon_in_list(region1[i], region2)? false : !_is_polygon_in_list(region1[i], region2)? false :
__are_regions_equal(region1, region2, i+1); __are_regions_equal(region1, region2, i+1);
@ -971,8 +971,6 @@ function offset(
sharpcorners = [for(i=[0:len(goodsegs)-1]) _segment_extension(select(goodsegs,i-1), select(goodsegs,i))], sharpcorners = [for(i=[0:len(goodsegs)-1]) _segment_extension(select(goodsegs,i-1), select(goodsegs,i))],
// If some segments are parallel then the extended segments are undefined. This case is not handled // If some segments are parallel then the extended segments are undefined. This case is not handled
// Note if !closed the last corner doesn't matter, so exclude it // Note if !closed the last corner doesn't matter, so exclude it
fd= echo(sharpcorners=sharpcorners)echo(alldef=all_defined(sharpcorners))echo(goodsegs=goodsegs),
parallelcheck = parallelcheck =
(len(sharpcorners)==2 && !closed) || (len(sharpcorners)==2 && !closed) ||
all_defined(closed? sharpcorners : select(sharpcorners, 1,-2)) all_defined(closed? sharpcorners : select(sharpcorners, 1,-2))