MCPcopy Create free account
hub / github.com/JeremyBYU/polylidar / verify_valid_polygon

Function verify_valid_polygon

tests/python/helpers/utils.py:39–49  ·  view source on GitHub ↗
(poly, points)

Source from the content-addressed store, hash-verified

37 verify_valid_polygon(poly, points)
38
39def verify_valid_polygon(poly, points):
40 shell_coords = get_poly_coords(poly.shell, points)
41 hole_coords = [get_poly_coords(hole, points) for hole in poly.holes]
42 # Verify polygon outer shell
43 shapelyPoly = Polygon(shell=shell_coords)
44 assert shapelyPoly.is_valid
45 # Verify polygon outer shell and holes
46 shapelyPoly = Polygon(shell=shell_coords, holes=hole_coords)
47# if not shapelyPoly.is_valid:
48# np.save("scratch/error_{}.npy".format(points.shape[0]), points)
49 assert shapelyPoly.is_valid
50
51def verify_all(points, polylidar_kwargs):
52 pl = Polylidar3D(**polylidar_kwargs)

Callers 1

Calls 2

get_poly_coordsFunction · 0.70
PolygonClass · 0.50

Tested by

no test coverage detected