meshing.dual_contouring.dual_faces

meshing.dual_contouring.dual_faces(edges, incidence, grid, vertices)

Connect cell vertices with one oriented quad per crossing edge.

Orientation is decided purely by the frozen start_inside flag: the outward normal of the surface crossing an edge points from its inside endpoint to its outside endpoint. Quads are triangulated along their shorter diagonal. Edges on the grid boundary lack one of their four cells and are skipped.

Each quad corner is the incidence row of the adjacent cell whose edge list contains the crossing edge: the lookup is keyed by (cell, edge), not by cell alone, so multi-row cells from :func:cadjoint.meshing.features.manifold_cell_incidence route each surface sheet to its own vertex, and single-row incidence behaves as before.

Parameters

Name Type Description Default
edges CrossingEdges Crossing edges from :func:find_crossing_edges. required
incidence CellIncidence Cell-to-edge mapping for the same edge set. required
grid GridSpec The sampling grid. required
vertices np.ndarray Concrete vertex positions (cell_count, 3) used only to pick the shorter quad diagonal (a frozen, discrete choice). required

Returns

Name Type Description
tuple[np.ndarray, np.ndarray, int] (quads, triangles, skipped_boundary_edges).