plexus
plexus copied to clipboard
Use paths for topological mutations over arcs and faces.
Arcs and faces provide some of the most important topological mutations for MeshGraph
s. The mutation API is mostly comprised of mutations over arcs and faces. However, arc mutations generalize to paths and paths should probably become the primary mechanism for these mutations. For example, extruding and bridging individual arcs is limiting; extruding a boundary path is a more powerful abstraction.
The mutation API and view APIs should shift to expose mutations for Path
s. For starters, here are some useful mutations that Path
should probably provide:
- Extrude Extruding a boundary path inserts three additional edges and inserts a face within the ring formed from the path and those edges, extruding an "edge" formed from the path's arcs into a single arc. This is related to bridging, which arcs already support, but the API for bridging is difficult to design for paths.
- Fill Filling a boundary arc inserts an edge between its endpoints and inserts a face into the ring formed by the edge and the path. Extrusion never joins existing arcs and this operation provides a mechanism to join together faces over existing topology.
- Split Splitting a path creates a boundary between the arcs along the path, copying any vertex and edge data as needed. This creates rings and, geometrically, "cuts" a surface. Splitting may or may not produce disjoint sub-graphs.
Arcs can still expose these operations by converting into a path and reusing that implementation. Some exclusive operations for arcs are still important, of course, such as collapsing.
Paths are a good cursor for groups of entities to transform and they can be used in the context of both arcs and faces! This means some operations become ambiguous. For example, extrusion of arcs vs. faces must be differentiated, which is why 63c1a2e specifies whether a contour (connected group of boundary arcs) or surface is being extruded.
Another quick note: the split operation described above is exposed as MeshGraph::split_at_path
while the Path::split
API converts a Path
into two Path
instances split at a given vertex.