fem.project_points

fem.project_points(sdf, points, max_step, *, steps=8)

Newton-project points onto the SDF zero set along the field gradient.

The single-field case of :func:cadjoint.zeroset.project.project — one kernel for the meshes, the seams and the cut-cell surface — with the total displacement from the starting point clamped to max_step so callers can bound how far vertices wander. Where the field’s gradient underflows the point stays put and contributes no derivative.

Pure JAX, fixed iteration count — safe to trace and differentiate with respect to SDF parameters.

Parameters

Name Type Description Default
sdf Callable[[Any], Any] Scalar field callable on (3,) points (batched via vmap). required
points Any Starting positions, shaped (M, 3). required
max_step float Maximum total displacement per point. required
steps int Newton iterations. 8

Returns

Name Type Description
Projected positions as a JAX array, shaped (M, 3).