constraints.FixedConstraint
constraints.FixedConstraint(param, target, *, weight=1.0)
Constraint that anchors a free parameter to a fixed target value.
This constraint enforces: param = target
Unlike marking a parameter free=False, an anchored parameter stays in the optimization vector, so it can participate in DOF counting and be released later without restructuring the scene.
Reduces DOF by param.value.size (one equation per component).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| param | Parameter | Parameter to anchor (Scalar, Vector, or Vector2) | required |
| target | float | Array | Target value (array-like matching the parameter’s shape) | required |
Example
v0 = Vector2([0, 0], free=True, name='v0')
anchor = FixedConstraint(v0, [0.0, 0.0])
Methods
| Name | Description |
|---|---|
| compute_residual | Compute anchor residual: param - target (one equation per component). |
| dof_reduction | One equation per parameter component. |
| get_parameters | The single anchored parameter. |
compute_residual
constraints.FixedConstraint.compute_residual(param_values)
Compute anchor residual: param - target (one equation per component).
dof_reduction
constraints.FixedConstraint.dof_reduction()
One equation per parameter component.
get_parameters
constraints.FixedConstraint.get_parameters()
The single anchored parameter.