-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The subtriangulation()
procedure returns a set of simplex meshes. However, for some applications it may be convenient to return a mesh of GeneralPolytope
.
The result of compute_polyhedra!
are arrays of general polytopes (Kin,Kout,Γk),. Then, inside save_cell_submesh!
, these polytopes are simplexified and appended to the submesh. Instead, we need to merge these arrays of polytopes into a single polytope per background cell. Then, the merged polytopes compose a mesh.
Therefore, the main task is to merge arrays of GeneralPolytope
with the following considerations.
- The polytope nodes contain metadata about the background mesh and STL
- It is convenient to keep polytope faces (vertex,edges,facets) linked to background faces
- We can remove all the interior edges and vertices
- We can generate a polytope from the interior array Kin, and another for Kout.
One possible approach is the following:
- Extract the polytope edges on the background cell edges
- Merge nodes not touching STL surface (Nk)
- Merge edges that share nodes (Ek)
- Glue cut surface Γk with merged edges Ek to generate a new
GeneralPolytope
Here, one of the main complication is that an edge can be cut more than once by the STL surface. Thus, the glue is not straight forward. E.g., we need a process of sorting nodes over the background edge.
It important to note that the GenaralPolytope
is represented by an oriented edge graph; see more information in the reference publication.