meshing.dual_contouring.qef_vertices
meshing.dual_contouring.qef_vertices(
hermite,
incidence,
grid,
*,
regularization=0.001,
)Place one vertex per active cell from its Hermite tangent planes.
Minimizes Σ (nᵢ · (v - pᵢ))² plus a Tikhonov pull toward the cell’s Hermite mass point, scaled so regularization is relative to the normal count. Planar cells (rank-1 systems) land on the face near the mass point, crease cells slide onto the crease line, and corner cells reproduce the corner; the bias a corner inherits from the regularization is of order regularization × cell size.
Fully JAX-traceable: call under jax.grad/jax.jit with a hermite built from traced parameters to differentiate vertex positions. Vertices are clamped to their cell as a final safety net; the clamp binds only on degenerate cells.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| hermite | HermiteData | Stage-1 Hermite data for the frozen edge set. | required |
| incidence | CellIncidence | Cell-to-edge mapping for the same edge set. | required |
| grid | GridSpec | The sampling grid (cell bounds for clamping). | required |
| regularization | float | Relative Tikhonov weight; must be positive. | 0.001 |
Returns
| Name | Type | Description |
|---|---|---|
| tuple[Array, Array] | (vertices, normals), both shaped (cell_count, 3). Normals are the safely averaged incident unit normals; a cell whose normals cancel (opposed thin-sheet subgradients) falls back to its first sample’s normal so downstream orientation and shading stay finite. |