solve_constraints
solve_constraints(sdf, *, tol=1e-06, max_steps=256)
Solve geometric constraints attached to a scene’s free parameters.
Extracts free parameters from the SDF tree, discovers all constraints registered on them, checks that the system is exactly constrained, then runs Levenberg-Marquardt (via optimistix) to find parameter values that satisfy all constraints.
Parameters
| sdf |
Fluent |
The SDF tree whose free parameters should be solved. |
required |
| tol |
float |
Convergence tolerance (used as both rtol and atol). |
1e-06 |
| max_steps |
int |
Maximum solver iterations. |
256 |
Returns
|
dict[str, Any] |
A free_params dict (same format as extract_parameters) with solved |
|
dict[str, Any] |
parameter values — ready to pass to functionalize. |
Raises
|
ValueError |
If the scene is under- or over-constrained. |
|
RuntimeError |
If the solver does not converge. |
Example
solved_params = solve_constraints(scene)
sdf_fn = functionalize(scene)(solved_params, fixed_params)