Option for mesh stitching tool
The BASEmesh system manual v1.4 mentions the following feature:
Combine meshes Multiple meshes can be combined to one big mesh, by carefully applying manual meshing.
If this feature is considered important enough, it would be reasonably easy to implement in v2, ideally in a more user-friendly form, especially using the new mesh domain dogma.
Potential mode of operation:
- The user has two meshes loaded, or a single, disjoint mesh.
- Two lines are drawn, connecting the two meshes. These will become part of the new mesh boundary.
- The mesh boundary edges within this new boundary are evaluated for each mesh. The longest segment length found will be used to pre-segmentize the two auxilary lines.
- Triangle is started with the enclosed area as its domain, and the mesh boundary edges and pre-segmentized auxilary lines as its boundary edges. The insertion of steiner nodes on the boundary is disallowed to ensure the boundary nodes do not change. The other triangle constraints can be selected by the user as normal (this entire step might be performed in the quality meshing utility).
- The new sub-mesh is joined node-per-node to mesh A, then mesh B is joined to this combined mesh.
Another feature that would come "for free" if this were implemented would be selective mesh regeneration, for which an area would be chosen either by polygon or MATID, its boundary locked in and Triangle re-run with different settings before merging the smaller mesh into the hole cut into the original mesh.
Requirements:
-
Finalise the triangle wrapper I/O -
Re-introduce custom mesh boundary polygons -
Determine if this tool is necessary (i.e. is the current system too much of a hassle or just not needed) -
(Optional) Add a 2DM wrapper module -
Add a Mesh.join(other: Mesh)
method to allow node-by-node merging of congruent edges -
Add a Mesh.split(poly: Polygon2D)
method to allow meshes to be carved (either keeping existing boundary triangles or replacing them as well -
Add a Mesh.boundary()
property to retrieve the edge nodes and segments of the mesh