trusty.rods¶
Discrete elastic rods.
RodDiscretization
¶
Bases: Enum
RodMaterial
¶
add_rod
¶
add_rod(
world: World,
X: ndarray[float64, (N, M)],
material: RodMaterial,
*,
friction_mu: float = 0.0,
initial_positions: ndarray[float64, (N, 3)]
| None = None,
) -> int
Add a polyline rod body (X is (num_verts, 3) in order). Multiple add_rod calls create multiple rods in one simulation. friction_mu is the body's surface Coulomb coefficient (>= 0); 0 is frictionless. initial_positions (num_verts, 3) is where the vertices start (default: X); the rest shape is X, so a different start strains and bends the rod.
set_project_positive_definite
¶
PSD-project this module's Hessians on every Newton iteration (default off). Call before the first step().