Skip to content

Commit

Permalink
- mesh can be created from quad and tri faces
Browse files Browse the repository at this point in the history
  • Loading branch information
franck-ledoux committed Apr 1, 2024
1 parent f9fe22e commit 918075c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions model/Linear2CMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,18 @@ def __init__(self, nodes=[], faces=[]):
self.add_node(n[0], n[1])

for f in faces:
self.add_triangle(Node(self, f[0]),
if len(f) == 3:
self.add_triangle(Node(self, f[0]),
Node(self, f[1]),
Node(self, f[2]))

elif len(f) == 4:
self.add_quad(Node(self, f[0]),
Node(self, f[1]),
Node(self, f[2]))
Node(self, f[2]),
Node(self, f[3]))
else:
raise ValueError("Only triangles and quads are supported")

# now we 2-sew some darts to glue faces along edges
for d_info in self.dart_info:
Expand Down

0 comments on commit 918075c

Please sign in to comment.