use asarray() in place of array(copy=False)
This commit is contained in:
parent
6f5335dcc1
commit
3abf1e137f
2 changed files with 5 additions and 5 deletions
|
|
@ -23,8 +23,8 @@ def planes_from_boundary(
|
||||||
Returns:
|
Returns:
|
||||||
List of planes, represented by (normal vector, signed distance to origin) tuples.
|
List of planes, represented by (normal vector, signed distance to origin) tuples.
|
||||||
'''
|
'''
|
||||||
vertices = numpy.array(vertices, copy=False)
|
vertices = numpy.asarray(vertices)
|
||||||
afaces = [numpy.array(ff, copy=False) for ff in faces]
|
afaces = [numpy.asarray(ff) for ff in faces]
|
||||||
planes = []
|
planes = []
|
||||||
for face in afaces:
|
for face in afaces:
|
||||||
face_verts = vertices[face]
|
face_verts = vertices[face]
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ def build_box(box_corners: ArrayLike) -> poly_t:
|
||||||
[6, 3, 4],
|
[6, 3, 4],
|
||||||
]
|
]
|
||||||
|
|
||||||
box_corners = numpy.array(box_corners, copy=False)
|
box_corners = numpy.asarray(box_corners)
|
||||||
vertices = [
|
vertices = [
|
||||||
[box_corners[0, 0], box_corners[0, 1], box_corners[0, 2]],
|
[box_corners[0, 0], box_corners[0, 1], box_corners[0, 2]],
|
||||||
[box_corners[1, 0], box_corners[0, 1], box_corners[0, 2]],
|
[box_corners[1, 0], box_corners[0, 1], box_corners[0, 2]],
|
||||||
|
|
@ -77,7 +77,7 @@ def planes_from_box(box_corners: ArrayLike) -> list[plane_t]:
|
||||||
Returns:
|
Returns:
|
||||||
List of planes, facing inwards.
|
List of planes, facing inwards.
|
||||||
'''
|
'''
|
||||||
box_corners = numpy.array(box_corners, copy=False)
|
box_corners = numpy.asarray(box_corners)
|
||||||
faces = [
|
faces = [
|
||||||
(( 0, 0, 1), -box_corners[0, 2]),
|
(( 0, 0, 1), -box_corners[0, 2]),
|
||||||
(( 0, 0, -1), box_corners[1, 2]),
|
(( 0, 0, -1), box_corners[1, 2]),
|
||||||
|
|
@ -100,7 +100,7 @@ def planes_from_tetrahedron(vertices: ArrayLike) -> list[plane_t]:
|
||||||
Returns:
|
Returns:
|
||||||
List of planes, facing inwards.
|
List of planes, facing inwards.
|
||||||
'''
|
'''
|
||||||
verts = numpy.array(vertices, dtype=float, copy=False)
|
verts = numpy.asarray(vertices, dtype=float)
|
||||||
vset_inds = numpy.array((
|
vset_inds = numpy.array((
|
||||||
[3, 1, 2, 1],
|
[3, 1, 2, 1],
|
||||||
[2, 0, 3, 2],
|
[2, 0, 3, 2],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue