meshing.dual_contouring.extract_mesh

meshing.dual_contouring.extract_mesh(
    sdf,
    grid,
    *,
    level=0.0,
    bisection_iterations=16,
    newton_steps=1,
    regularization=0.001,
    sharp=True,
    lipschitz=None,
)

Extract a feature-preserving dual-contour mesh from an implicit field.

Convenience composition of the pipeline stages with concrete inputs: sample, detect crossing edges, refine Hermite data, place QEF vertices, and build oriented dual faces. With sharp=True (the default) the forward vertices come from :func:sharp_qef_vertices, which lands exactly on creases and corners; sharp=False keeps the Tikhonov placement everywhere. Passing lipschitz switches detection to octree pruning (:mod:cadjoint.meshing.adaptive): identical output, surface-proportional cost, safe only when the value genuinely bounds the field’s gradient. For parameter gradients, freeze the detected edges/incidence and differentiate through :func:edge_hermite_data + :func:qef_vertices as shown in the module docstring.

Warns when the surface crosses the grid boundary; the returned mesh is open there.