You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: newton/_src/sim/builder.py
+39-13Lines changed: 39 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -3817,7 +3817,7 @@ def add_usd(
3817
3817
* - ``"path_soft_map"``
3818
3818
- Mapping from prim path (str) of a soft body (a volume deformable, or a legacy bare TetMesh) to its ``[start, end)`` index ranges, keyed ``"particle"`` / ``"tet"``. Present only with ``return_deformable_results=True``.
3819
3819
* - ``"path_cable_attrs"``
3820
-
- Mapping from prim path (str) of a curve deformable (cable) to its as-authored, solver-neutral attributes (``material`` moduli, ``resolved_density``, ``closed``); includes moduli the imported rod cannot express (e.g. shear / twist). ``graph_component`` is present only for curves successfully welded into the same rod graph; curves in one graph share the component identifier. Present only with ``return_deformable_results=True``.
3820
+
- Mapping from prim path (str) of a curve deformable (cable) to its validated, solver-neutral cable import metadata (``material``, ``resolved_density``, ``closed``). ``material`` contains supported per-mode structural values before per-joint discretization: stretch/shear stiffness [N] and damping [N·s]; bend/twist stiffness [N·m²] and damping [N·m²·s]. ``graph_component`` is present only for curves successfully welded into the same rod graph; curves in one graph share the identifier. Present only with ``return_deformable_results=True``.
3821
3821
* - ``"path_cloth_attrs"``
3822
3822
- Mapping from prim path (str) of a surface deformable (cloth) to its as-authored, solver-neutral attributes (``material`` moduli, ``resolved_density``). Present only with ``return_deformable_results=True``.
3823
3823
* - ``"path_soft_attrs"``
@@ -5648,32 +5648,58 @@ def add_joint_cable(
5648
5648
**kwargs,
5649
5649
)
5650
5650
5651
-
def _set_joint_rod_stiffnesses(
5651
+
def _set_joint_rod_material_gains(
5652
5652
self,
5653
5653
joint: int,
5654
5654
*,
5655
-
stretch_stiffness: float | None,
5656
-
shear_stiffness: float | None,
5657
-
bend_stiffness: float | None,
5658
-
twist_stiffness: float | None,
5655
+
stretch_stiffness: float | None = None,
5656
+
stretch_damping: float | None = None,
5657
+
shear_stiffness: float | None = None,
5658
+
shear_damping: float | None = None,
5659
+
bend_stiffness: float | None = None,
5660
+
bend_damping: float | None = None,
5661
+
twist_stiffness: float | None = None,
5662
+
twist_damping: float | None = None,
5659
5663
) -> None:
5660
-
"""Overwrite each non-None stiffness and its inferred target mode, in :meth:`add_joint_rod` axis order."""
5664
+
"""Overwrite non-None material gains and target modes in :meth:`add_joint_rod` slot order.
5665
+
5666
+
Args:
5667
+
joint: Rod joint index.
5668
+
stretch_stiffness: Per-joint stretch stiffness [N/m], or ``None`` to preserve it.
5669
+
stretch_damping: Per-joint stretch damping [N·s/m], or ``None`` to preserve it.
5670
+
shear_stiffness: Per-joint shear stiffness [N/m], or ``None`` to preserve it.
5671
+
shear_damping: Per-joint shear damping [N·s/m], or ``None`` to preserve it.
5672
+
bend_stiffness: Per-joint bend stiffness [N·m/rad], or ``None`` to preserve it.
5673
+
bend_damping: Per-joint bend damping [N·m·s/rad], or ``None`` to preserve it.
5674
+
twist_stiffness: Per-joint twist stiffness [N·m/rad], or ``None`` to preserve it.
5675
+
twist_damping: Per-joint twist damping [N·m·s/rad], or ``None`` to preserve it.
5676
+
"""
5661
5677
joint_type = self.joint_type[joint]
5662
5678
joint_dof_dim = self.joint_dof_dim[joint]
5663
5679
if joint_type != JointType.ROD or joint_dof_dim != (2, 2):
5664
5680
raise ValueError(
5665
-
"_set_joint_rod_stiffnesses() expected the four-slot ROD layout "
5681
+
"_set_joint_rod_material_gains() expected the four-slot ROD layout "
5666
5682
f"(2 linear, 2 angular); got joint type {JointType(joint_type).name} with dimensions "
5667
5683
f"{joint_dof_dim}. Update the ROD material-slot mapping when changing its slot layout."
5668
5684
)
5669
5685
dof_start = self.joint_qd_start[joint]
5670
-
for offset, stiffness in enumerate((stretch_stiffness, shear_stiffness, bend_stiffness, twist_stiffness)):
0 commit comments