use asarray() in place of array(copy=False)

This commit is contained in:
Jan Petykiewicz 2024-07-30 23:46:10 -07:00
commit 3abf1e137f
2 changed files with 5 additions and 5 deletions

View file

@ -23,8 +23,8 @@ def planes_from_boundary(
Returns:
List of planes, represented by (normal vector, signed distance to origin) tuples.
'''
vertices = numpy.array(vertices, copy=False)
afaces = [numpy.array(ff, copy=False) for ff in faces]
vertices = numpy.asarray(vertices)
afaces = [numpy.asarray(ff) for ff in faces]
planes = []
for face in afaces:
face_verts = vertices[face]

View file

@ -48,7 +48,7 @@ def build_box(box_corners: ArrayLike) -> poly_t:
[6, 3, 4],
]
box_corners = numpy.array(box_corners, copy=False)
box_corners = numpy.asarray(box_corners)
vertices = [
[box_corners[0, 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:
List of planes, facing inwards.
'''
box_corners = numpy.array(box_corners, copy=False)
box_corners = numpy.asarray(box_corners)
faces = [
(( 0, 0, 1), -box_corners[0, 2]),
(( 0, 0, -1), box_corners[1, 2]),
@ -100,7 +100,7 @@ def planes_from_tetrahedron(vertices: ArrayLike) -> list[plane_t]:
Returns:
List of planes, facing inwards.
'''
verts = numpy.array(vertices, dtype=float, copy=False)
verts = numpy.asarray(vertices, dtype=float)
vset_inds = numpy.array((
[3, 1, 2, 1],
[2, 0, 3, 2],