Skip to content

Commit

Permalink
feat: automatic conversion to numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Nov 7, 2024
1 parent c0d2ac2 commit 815fe6c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions zmesh/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ class Mesh:
"""
def __init__(self, vertices, faces, normals, id=None):
self.vertices = vertices
self.faces = faces
self.normals = normals
self.vertices = np.asarray(vertices, dtype=np.float32)
self.faces = np.asarray(faces, dtype=np.uint32)

if normals is None:
self.normals = normals
else:
self.normals = np.asarray(normals, dtype=np.float32)

self.id = id

def __len__(self):
Expand Down

0 comments on commit 815fe6c

Please sign in to comment.