Skip to content

Commit 74468ba

Browse files
authored
Merge pull request #253 from robin-oval/fix/face_adjacency_halfedge
fix mesh.face_adjacency_halfedgeS
2 parents 0461823 + b572738 commit 74468ba

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/compas/datastructures/mesh/_mesh.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,7 @@ def face_vertex_descendant(self, fkey, key):
22662266
return self.face[fkey][i + 1]
22672267

22682268
def face_adjacency_halfedge(self, f1, f2):
2269-
"""Find the half-edge over which tow faces are adjacent.
2269+
"""Find one half-edge over which two faces are adjacent.
22702270
22712271
Parameters
22722272
----------
@@ -2292,6 +2292,27 @@ def face_adjacency_halfedge(self, f1, f2):
22922292
if self.halfedge[v][u] == f2:
22932293
return u, v
22942294

2295+
def face_adjacency_vertices(self, f1, f2):
2296+
"""Find all vertices over which two faces are adjacent.
2297+
2298+
Parameters
2299+
----------
2300+
f1 : hashable
2301+
The identifier of the first face.
2302+
f2 : hashable
2303+
The identifier of the second face.
2304+
2305+
Returns
2306+
-------
2307+
list
2308+
The vertices separating face 1 from face 2.
2309+
None
2310+
If the faces are not adjacent.
2311+
2312+
"""
2313+
2314+
return [vkey for vkey in self.face_vertices(f1) if vkey in self.face_vertices(f2)]
2315+
22952316
def is_face_on_boundary(self, key):
22962317
"""Verify that a face is on a boundary.
22972318

0 commit comments

Comments
 (0)