Skip to main content

solve_assembly

Function solve_assembly 

Source
pub fn solve_assembly(
    bodies: &[AssemblyBody],
    mates: &[AssemblyMate],
    options: &AssemblySolveOptions,
) -> Result<AssemblySolution, String>
Expand description

Solve the assembly mates in least squares from the bodies’ initial poses.

Grounded bodies never move; free degrees of freedom of movable bodies stay where the initial guess put them (minimum-norm LM steps). By default (SolveStrategy::Auto) the solve is decomposed per §7.5–7.6 — sequential peeling from the grounded bodies plus rigid-cluster contraction, with a monolithic fallback for coupled cycles — and agrees with the monolithic strategy within the solve tolerance on well-posed inputs. Returns Err when the mates cannot all be satisfied (conflict) or the solve fails to converge, naming the worst-residual mates.