halfedges
- property Mesh.halfedges
Halfedge dictionary.
Dictionary that maps pairs of
Vertex
objects toHalfedge
instances. Hence, to visitHalfedge
instances one can usefor h in mesh.halfedges.values(): v = h.origin w = h.target ...
to directly visit halfedges as
Vertex
instance pairs usefor v, w in mesh.halfedges.keys(): ...
To check whether two vertices of a mesh are adjacent (connected by an edge) we can do one of the following. The resulting value depends on the chosen query method:
(v, w) in mesh.halfedges # True or False h = mesh.halfedges[v, w] # may raise KeyError h = mesh.halfedges.get((v, w)) # can result in h = None