@@ -27,8 +27,9 @@ def create_interior_straight_skeleton(points) -> PolylinesNumpy:
27
27
If the normal of the polygon is not [0, 0, 1].
28
28
"""
29
29
points = list (points )
30
- if not TOL .is_allclose (normal_polygon (points , True ), [0 , 0 , 1 ]):
31
- raise ValueError ("Please pass a polygon with a normal vector of [0, 0, 1]." )
30
+ normal = normal_polygon (points , True )
31
+ if not TOL .is_allclose (normal , [0 , 0 , 1 ]):
32
+ raise ValueError ("The normal of the polygon should be [0, 0, 1]. The normal of the provided polygon is {}" .format (normal ))
32
33
V = np .asarray (points , dtype = np .float64 )
33
34
return straight_skeleton_2 .create_interior_straight_skeleton (V )
34
35
@@ -55,15 +56,17 @@ def create_interior_straight_skeleton_with_holes(points, holes) -> PolylinesNump
55
56
If the normal of a hole is not [0, 0, -1].
56
57
"""
57
58
points = list (points )
58
- if not TOL .is_allclose (normal_polygon (points , True ), [0 , 0 , 1 ]):
59
- raise ValueError ("Please pass a polygon with a normal vector of [0, 0, 1]." )
59
+ normal = normal_polygon (points , True )
60
+ if not TOL .is_allclose (normal , [0 , 0 , 1 ]):
61
+ raise ValueError ("The normal of the polygon should be [0, 0, 1]. The normal of the provided polygon is {}" .format (normal ))
60
62
V = np .asarray (points , dtype = np .float64 )
61
63
62
64
H = []
63
- for hole in holes :
65
+ for i , hole in enumerate ( holes ) :
64
66
points = list (hole )
65
- if not TOL .is_allclose (normal_polygon (points , True ), [0 , 0 , - 1 ]):
66
- raise ValueError ("Please pass a hole with a normal vector of [0, 0, -1]." )
67
+ normal_hole = normal_polygon (points , True )
68
+ if not TOL .is_allclose (normal_hole , [0 , 0 , - 1 ]):
69
+ raise ValueError ("The normal of the hole should be [0, 0, -1]. The normal of the provided {}-th hole is {}" .format (i , normal_hole ))
67
70
hole = np .asarray (points , dtype = np .float64 )
68
71
H .append (hole )
69
72
return straight_skeleton_2 .create_interior_straight_skeleton_with_holes (V , H )
@@ -90,8 +93,9 @@ def create_offset_polygons_2(points, offset):
90
93
If the normal of the polygon is not [0, 0, 1].
91
94
"""
92
95
points = list (points )
93
- if not TOL .is_allclose (normal_polygon (points , True ), [0 , 0 , 1 ]):
94
- raise ValueError ("Please pass a polygon with a normal vector of [0, 0, 1]." )
96
+ normal = normal_polygon (points , True )
97
+ if not TOL .is_allclose (normal , [0 , 0 , 1 ]):
98
+ raise ValueError ("The normal of the polygon should be [0, 0, 1]. The normal of the provided polygon is {}" .format (normal ))
95
99
V = np .asarray (points , dtype = np .float64 )
96
100
offset = float (offset )
97
101
if offset < 0 : # outside
@@ -126,8 +130,10 @@ def create_weighted_offset_polygons_2(points, offset, weights):
126
130
If the number of weights does not match the number of points.
127
131
"""
128
132
points = list (points )
129
- if not TOL .is_allclose (normal_polygon (points , True ), [0 , 0 , 1 ]):
130
- raise ValueError ("Please pass a polygon with a normal vector of [0, 0, 1]." )
133
+ normal = normal_polygon (points , True )
134
+ if not TOL .is_allclose (normal , [0 , 0 , 1 ]):
135
+ raise ValueError ("The normal of the polygon should be [0, 0, 1]. The normal of the provided polygon is {}" .format (normal ))
136
+
131
137
V = np .asarray (points , dtype = np .float64 )
132
138
offset = float (offset )
133
139
W = np .asarray (weights , dtype = np .float64 )
0 commit comments