|
14 | 14 | from compas.geometry import local_to_world_coordinates_numpy |
15 | 15 | from compas.geometry import pca_numpy |
16 | 16 | from compas.geometry import world_to_local_coordinates_numpy |
| 17 | +from compas.geometry import length_vector |
17 | 18 | from compas.tolerance import TOL |
18 | 19 |
|
19 | 20 | from .bbox import bounding_box |
@@ -73,7 +74,7 @@ def oriented_bounding_box_numpy(points, tol=None): |
73 | 74 | >>> a = length_vector(subtract_vectors(bbox[1], bbox[0])) |
74 | 75 | >>> b = length_vector(subtract_vectors(bbox[3], bbox[0])) |
75 | 76 | >>> c = length_vector(subtract_vectors(bbox[4], bbox[0])) |
76 | | - >>> close(a * b * c, 30.) |
| 77 | + >>> close(a * b * c, 30.0) |
77 | 78 | True |
78 | 79 |
|
79 | 80 | """ |
@@ -198,6 +199,8 @@ def minimum_volume_box(points, return_size=False): |
198 | 199 | for simplex in hull.simplices: |
199 | 200 | a, b, c = points[simplex] |
200 | 201 | uvw = local_axes(a, b, c) |
| 202 | + if not length_vector(uvw[0]) or not length_vector(uvw[1]): |
| 203 | + continue |
201 | 204 | frame = [a, uvw[0], uvw[1]] |
202 | 205 | rst = world_to_local_coordinates_numpy(frame, xyz) |
203 | 206 | rmin, smin, tmin = amin(rst, axis=0) |
|
0 commit comments