newton.Model#
- class newton.Model(device=None)[source]#
Bases:
objectRepresents the static (non-time-varying) definition of a simulation model in Newton.
The Model class encapsulates all geometry, constraints, and parameters that describe a physical system for simulation. It is designed to be constructed via the ModelBuilder, which handles the correct initialization and population of all fields.
- Key Features:
Stores all static data for simulation: particles, rigid bodies, joints, shapes, soft/rigid elements, etc.
Supports grouping of entities by world using world indices (e.g., particle_world, body_world, etc.). - Index -1: global entities shared across all worlds. - Indices 0, 1, 2, …: world-specific entities.
Grouping enables: - Collision detection optimization (e.g., separating worlds) - Visualization (e.g., spatially separating worlds) - Parallel processing of independent worlds
Note
It is strongly recommended to use the
ModelBuilderto construct a Model. Direct instantiation and manual population of Model fields is possible but discouraged.- class AttributeAssignment(value)#
Bases:
IntEnumEnumeration of attribute assignment categories.
Defines which component of the simulation system owns and manages specific attributes. This categorization determines where custom attributes are attached during simulation object creation (Model, State, Control, or Contacts).
- class AttributeFrequency(value)#
Bases:
IntEnumEnumeration of attribute frequency categories.
Defines the dimensional structure and indexing pattern for custom attributes. This determines how many elements an attribute array should have and how it should be indexed in relation to the model’s entities such as joints, bodies, shapes, etc.
- ARTICULATION = 7#
Attribute frequency follows the number of articulations (see
articulation_count).
- BODY = 5#
Attribute frequency follows the number of bodies (see
body_count).
- CONSTRAINT_MIMIC = 14#
Attribute frequency follows the number of mimic constraints (see
constraint_mimic_count).
- EDGE = 10#
Attribute frequency follows the number of edges (see
edge_count).
- EQUALITY_CONSTRAINT = 8#
Attribute frequency follows the number of equality constraints (see
equality_constraint_count).
- JOINT = 1#
Attribute frequency follows the number of joints (see
joint_count).
- JOINT_CONSTRAINT = 4#
Attribute frequency follows the number of joint constraints (see
joint_constraint_count).
- JOINT_COORD = 3#
Attribute frequency follows the number of joint positional coordinates (see
joint_coord_count).
- JOINT_DOF = 2#
Attribute frequency follows the number of joint degrees of freedom (see
joint_dof_count).
- ONCE = 0#
Attribute frequency is a single value.
- PARTICLE = 9#
Attribute frequency follows the number of particles (see
particle_count).
- SHAPE = 6#
Attribute frequency follows the number of shapes (see
shape_count).
- SPRING = 13#
Attribute frequency follows the number of springs (see
spring_count).
- WORLD = 15#
Attribute frequency follows the number of worlds (see
num_worlds).
- class AttributeNamespace(name)#
Bases:
objectA container for namespaced custom attributes.
Custom attributes are stored as regular instance attributes on this object, allowing hierarchical organization of related properties.
- __init__(device=None)#
Initialize a Model object.
- Parameters:
device (wp.Device, optional) – Device on which the Model’s data will be allocated.
- add_attribute(name, attrib, frequency, assignment=None, namespace=None)#
Add a custom attribute to the model.
- Parameters:
name (str) – Name of the attribute.
attrib (wp.array | list) – The array to add as an attribute. Can be a wp.array for numeric types or a list for string attributes.
frequency (Model.AttributeFrequency | str) – The frequency of the attribute. Can be a Model.AttributeFrequency enum value or a string for custom frequencies.
assignment (Model.AttributeAssignment, optional) – The assignment category using Model.AttributeAssignment enum. Determines which object will hold the attribute.
namespace (str, optional) – Namespace for the attribute. If None, attribute is added directly to the assignment object (e.g., model.attr_name). If specified, attribute is added to a namespace object (e.g., model.namespace_name.attr_name).
- Raises:
AttributeError – If the attribute already exists or is on the wrong device.
- collide(state, contacts)#
Generate contact points for the particles and rigid bodies in the model using the default collision pipeline.
- contacts()#
Create and return a
Contactsobject for this model.This method initializes a collision pipeline with default arguments (when not already cached) and allocates a contacts buffer suitable for storing collision detection results. Call
collide()to run the collision detection and populate the contacts object.Note
Rigid contact margins are controlled per-shape via
Model.shape_contact_margin, which is populated fromShapeConfig.contact_marginduring model building. If a shape doesn’t specify a contact margin, it defaults tobuilder.rigid_contact_margin. To adjust contact margins, set them before callingModelBuilder.finalize().- Returns:
The contact object containing collision information.
- Return type:
- control(requires_grad=None, clone_variables=True)#
Create and return a new
Controlobject for this model.The returned control object is initialized with the control inputs from the model description.
- Parameters:
requires_grad (bool, optional) – Whether the control variables should have requires_grad enabled. If None, uses the model’s
requires_gradsetting.clone_variables (bool) – If True, clone the control input arrays; if False, use references.
- Returns:
The initialized control object.
- Return type:
- get_attribute_frequency(name)#
Get the frequency of an attribute.
- get_custom_frequency_count(frequency)#
Get the count for a custom frequency.
- get_requested_contact_attributes()#
Get the set of requested contact attribute names.
- get_requested_state_attributes()#
Get the list of requested state attribute names that have been requested on the model.
See Extended State Attributes for details.
- request_contact_attributes(*attributes)#
Request that specific contact attributes be allocated when creating a Contacts object.
- Parameters:
*attributes (str) – Variable number of attribute names (strings).
- request_state_attributes(*attributes)#
Request that specific state attributes be allocated when creating a State object.
See Extended State Attributes for details and usage.
- Parameters:
*attributes (str) – Variable number of attribute names (strings).
- set_gravity(gravity, world=None)#
Set gravity for runtime modification.
- Parameters:
Note
Call
solver.notify_model_changed(SolverNotifyFlags.MODEL_PROPERTIES)after.Global entities (particles/bodies not assigned to a specific world) use gravity from world 0.
- state(requires_grad=None)#
Create and return a new
Stateobject for this model.The returned state is initialized with the initial configuration from the model description.
- Parameters:
requires_grad (bool, optional) – Whether the state variables should have requires_grad enabled. If None, uses the model’s
requires_gradsetting.- Returns:
The state object
- Return type:
- articulation_count#
Total number of articulations in the system.
- articulation_key#
Articulation keys, shape [articulation_count], str.
- articulation_start#
Articulation start index, shape [articulation_count], int.
- articulation_world#
World index for each articulation, shape [articulation_count], int. -1 for global.
- articulation_world_start#
Start index of the first articulation per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the articulations belonging to that world. The second-last element (accessible via index -2) stores the start index of the global articulations (i.e. with world index -1) added to the end of the model, and the last element stores the total articulation count.
- The number of articulations in a given world w can be computed as:
num_articulations_in_world = articulation_world_start[w + 1] - articulation_world_start[w].
- The total number of global articulations can be computed as:
num_global_articulations = articulation_world_start[-1] - articulation_world_start[-2] + articulation_world_start[0].
- attribute_assignment: dict[str, Model.AttributeAssignment]#
Assignment for custom attributes using Model.AttributeAssignment enum values. If an attribute is not in this dictionary, it is assumed to be a Model attribute (assignment=Model.AttributeAssignment.MODEL).
- attribute_frequency: dict[str, Model.AttributeFrequency | str]#
Classifies each attribute using Model.AttributeFrequency enum values (per body, per joint, per DOF, etc.) or custom frequencies for custom entity types (e.g.,
"mujoco:pair").
- body_color_groups#
Coloring of all rigid bodies for Gauss-Seidel iteration (see
SolverVBD). Each array contains indices of bodies sharing the same color.
- body_colors#
Color assignment for every rigid body.
- body_com#
Rigid body center of mass (in local frame), shape [body_count, 3], float.
- body_count#
Total number of bodies in the system.
- body_inertia#
Rigid body inertia tensor (relative to COM), shape [body_count, 3, 3], float.
- body_inv_inertia#
Rigid body inverse inertia tensor (relative to COM), shape [body_count, 3, 3], float.
- body_inv_mass#
Rigid body inverse mass, shape [body_count], float.
- body_key#
Rigid body keys, shape [body_count], str.
- body_mass#
Rigid body mass, shape [body_count], float.
- body_q#
Rigid body poses for state initialization, shape [body_count, 7], float.
- body_qd#
Rigid body velocities for state initialization, shape [body_count, 6], float.
- body_shapes#
Mapping from body index to list of attached shape indices.
- body_world#
World index for each body, shape [body_count], int. Global entities have index -1.
- body_world_start#
Start index of the first body per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the bodies belonging to that world. The second-last element (accessible via index -2) stores the start index of the global bodies (i.e. with world index -1) added to the end of the model, and the last element stores the total body count.
- The number of bodies in a given world w can be computed as:
num_bodies_in_world = body_world_start[w + 1] - body_world_start[w].
- The total number of global bodies can be computed as:
num_global_bodies = body_world_start[-1] - body_world_start[-2] + body_world_start[0].
- constraint_mimic_coef0#
Offset coefficient (coef0) for the mimic constraint (
joint0 = coef0 + coef1 * joint1), shape [constraint_mimic_count], float.
- constraint_mimic_coef1#
Scale coefficient (coef1) for the mimic constraint (
joint0 = coef0 + coef1 * joint1), shape [constraint_mimic_count], float.
- constraint_mimic_count#
Total number of mimic constraints in the system.
- constraint_mimic_enabled#
Whether constraint is active, shape [constraint_mimic_count], bool.
- constraint_mimic_joint0#
Follower joint index (
joint0 = coef0 + coef1 * joint1), shape [constraint_mimic_count], int.
- constraint_mimic_joint1#
Leader joint index (
joint0 = coef0 + coef1 * joint1), shape [constraint_mimic_count], int.
- constraint_mimic_key#
Constraint name/key, shape [constraint_mimic_count], str.
- constraint_mimic_world#
World index for each constraint, shape [constraint_mimic_count], int.
- custom_frequency_counts: dict[str, int]#
Counts for custom frequencies (e.g.,
{"mujoco:pair": 5}). Set during finalize().
- device#
Device on which the Model was allocated.
- edge_bending_properties#
Bending edge stiffness and damping, shape [edge_count, 2], float.
- edge_constraint_lambdas#
Lagrange multipliers for edge constraints (internal use).
- edge_count#
Total number of edges in the system.
- edge_indices#
Bending edge indices, shape [edge_count*4], int, each row is [o0, o1, v1, v2], where v1, v2 are on the edge.
- edge_rest_angle#
Bending edge rest angle, shape [edge_count], float.
- edge_rest_length#
Bending edge rest length, shape [edge_count], float.
- equality_constraint_anchor#
Anchor point on first body, shape [equality_constraint_count, 3], float.
- equality_constraint_body1#
First body index, shape [equality_constraint_count], int.
- equality_constraint_body2#
Second body index, shape [equality_constraint_count], int.
- equality_constraint_count#
Total number of equality constraints in the system.
- equality_constraint_enabled#
Whether constraint is active, shape [equality_constraint_count], bool.
- equality_constraint_joint1#
First joint index, shape [equality_constraint_count], int.
- equality_constraint_joint2#
Second joint index, shape [equality_constraint_count], int.
- equality_constraint_key#
Constraint name/key, shape [equality_constraint_count], str.
- equality_constraint_polycoef#
Polynomial coefficients, shape [equality_constraint_count, 2], float.
- equality_constraint_relpose#
Relative pose, shape [equality_constraint_count, 7], float.
- equality_constraint_torquescale#
Torque scale, shape [equality_constraint_count], float.
- equality_constraint_type#
Type of equality constraint, shape [equality_constraint_count], int.
- equality_constraint_world#
World index for each constraint, shape [equality_constraint_count], int.
- equality_constraint_world_start#
Start index of the first equality constraint per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the equality constraints belonging to that world. The second-last element (accessible via index -2) stores the start index of the global equality constraints (i.e. with world index -1) added to the end of the model, and the last element stores the total equality constraint count.
- The number of equality constraints in a given world w can be computed as:
num_equality_constraints_in_world = equality_constraint_world_start[w + 1] - equality_constraint_world_start[w].
- The total number of global equality constraints can be computed as:
num_global_equality_constraints = equality_constraint_world_start[-1] - equality_constraint_world_start[-2] + equality_constraint_world_start[0].
- gravity#
Gravity vector, shape [1], dtype vec3.
- joint_X_c#
Joint mass frame in child frame, shape [joint_count, 7], float.
- joint_X_p#
Joint transform in parent frame, shape [joint_count, 7], float.
- joint_act_mode#
Actuator mode per DOF, see
newton.ActuatorMode. Shape [joint_dof_count], dtype int32.
- joint_ancestor#
Maps from joint index to the index of the joint that has the current joint parent body as child (-1 if no such joint ancestor exists), shape [joint_count], int.
- joint_armature#
Armature for each joint axis (used by
SolverMuJoCoandSolverFeatherstone), shape [joint_dof_count], float.
- joint_articulation#
Joint articulation index (-1 if not in any articulation), shape [joint_count], int.
- joint_axis#
Joint axis in child frame, shape [joint_dof_count, 3], float.
- joint_child#
Joint child body indices, shape [joint_count], int.
- joint_constraint_count#
Total number of joint constraints of all joints.
- joint_constraint_world_start#
Start index of the first joint constraint per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the joint constraints belonging to that world. The second-last element (accessible via index -2) stores the start index of the global joint constraints (i.e. with world index -1) added to the end of the model, and the last element stores the total joint constraint count.
- The number of joint constraints in a given world w can be computed as:
num_joint_constraints_in_world = joint_constraint_world_start[w + 1] - joint_constraint_world_start[w].
- The total number of global joint constraints can be computed as:
num_global_joint_constraints = joint_constraint_world_start[-1] - joint_constraint_world_start[-2] + joint_constraint_world_start[0].
- joint_coord_count#
Total number of position degrees of freedom of all joints.
- joint_coord_world_start#
Start index of the first joint coordinate per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the joint coordinates belonging to that world. The second-last element (accessible via index -2) stores the start index of the global joint coordinates (i.e. with world index -1) added to the end of the model, and the last element stores the total joint coordinate count.
- The number of joint coordinates in a given world w can be computed as:
num_joint_coords_in_world = joint_coord_world_start[w + 1] - joint_coord_world_start[w].
- The total number of global joint coordinates can be computed as:
num_global_joint_coords = joint_coord_world_start[-1] - joint_coord_world_start[-2] + joint_coord_world_start[0].
- joint_count#
Total number of joints in the system.
- joint_dof_count#
Total number of velocity degrees of freedom of all joints. Equals the number of joint axes.
- joint_dof_dim#
Number of linear and angular dofs per joint, shape [joint_count, 2], int.
- joint_dof_world_start#
Start index of the first joint degree of freedom per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the joint DOFs belonging to that world. The second-last element (accessible via index -2) stores the start index of the global joint DOFs (i.e. with world index -1) added to the end of the model, and the last element stores the total joint DOF count.
- The number of joint DOFs in a given world w can be computed as:
num_joint_dofs_in_world = joint_dof_world_start[w + 1] - joint_dof_world_start[w].
- The total number of global joint DOFs can be computed as:
num_global_joint_dofs = joint_dof_world_start[-1] - joint_dof_world_start[-2] + joint_dof_world_start[0].
- joint_effort_limit#
Joint effort (force/torque) limits, shape [joint_dof_count], float.
- joint_enabled#
Controls which joint is simulated (bodies become disconnected if False, only supported by
SolverXPBDandSolverSemiImplicit), shape [joint_count], bool.
- joint_f#
Generalized joint forces for state initialization, shape [joint_dof_count], float.
- joint_friction#
Joint friction coefficient, shape [joint_dof_count], float.
- joint_key#
Joint keys, shape [joint_count], str.
- joint_limit_kd#
Joint position limit damping (used by
SolverSemiImplicitandSolverFeatherstone), shape [joint_dof_count], float.
- joint_limit_ke#
Joint position limit stiffness (used by
SolverSemiImplicitandSolverFeatherstone), shape [joint_dof_count], float.
- joint_limit_lower#
Joint lower position limits, shape [joint_dof_count], float.
- joint_limit_upper#
Joint upper position limits, shape [joint_dof_count], float.
- joint_parent#
Joint parent body indices, shape [joint_count], int.
- joint_q#
Generalized joint positions for state initialization, shape [joint_coord_count], float.
- joint_q_start#
Start index of the first position coordinate per joint (last value is a sentinel for dimension queries), shape [joint_count + 1], int.
- joint_qd#
Generalized joint velocities for state initialization, shape [joint_dof_count], float.
- joint_qd_start#
Start index of the first velocity coordinate per joint (last value is a sentinel for dimension queries), shape [joint_count + 1], int.
- joint_target_kd#
Joint damping, shape [joint_dof_count], float.
- joint_target_ke#
Joint stiffness, shape [joint_dof_count], float.
- joint_target_pos#
Generalized joint position targets, shape [joint_dof_count], float.
- joint_target_vel#
Generalized joint velocity targets, shape [joint_dof_count], float.
- joint_twist_lower#
Joint lower twist limit, shape [joint_count], float.
- joint_twist_upper#
Joint upper twist limit, shape [joint_count], float.
- joint_type#
Joint type, shape [joint_count], int.
- joint_velocity_limit#
Joint velocity limits, shape [joint_dof_count], float.
- joint_world#
World index for each joint, shape [joint_count], int. -1 for global.
- joint_world_start#
Start index of the first joint per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the joints belonging to that world. The second-last element (accessible via index -2) stores the start index of the global joints (i.e. with world index -1) added to the end of the model, and the last element stores the total joint count.
- The number of joints in a given world w can be computed as:
num_joints_in_world = joint_world_start[w + 1] - joint_world_start[w].
- The total number of global joints can be computed as:
num_global_joints = joint_world_start[-1] - joint_world_start[-2] + joint_world_start[0].
- max_dofs_per_articulation#
Maximum number of degrees of freedom in any articulation (used for Jacobian/mass matrix computation).
- max_joints_per_articulation#
Maximum number of joints in any articulation (used for IK kernel dimensioning).
- muscle_activations#
Muscle activations, shape [muscle_count], float.
- muscle_bodies#
Body indices of the muscle waypoints, int.
- muscle_count#
Total number of muscles in the system.
- muscle_params#
Muscle parameters, shape [muscle_count, 5], float.
- muscle_points#
Local body offset of the muscle waypoints, float.
- muscle_start#
Start index of the first muscle point per muscle, shape [muscle_count], int.
- num_worlds#
Number of worlds added to the ModelBuilder.
- particle_adhesion#
Particle adhesion strength.
- particle_cohesion#
Particle cohesion strength.
- particle_color_groups#
Coloring of all particles for Gauss-Seidel iteration (see
SolverVBD). Each array contains indices of particles sharing the same color.
- particle_colors#
Color assignment for every particle.
- particle_count#
Total number of particles in the system.
- particle_grid: wp.HashGrid | None#
HashGrid instance for accelerated simulation of particle interactions.
- particle_inv_mass#
Particle inverse mass, shape [particle_count], float.
- particle_kd#
Particle normal contact damping (used by
SolverSemiImplicit).
- particle_ke#
Particle normal contact stiffness (used by
SolverSemiImplicit).
- particle_kf#
Particle friction force stiffness (used by
SolverSemiImplicit).
- particle_mass#
Particle mass, shape [particle_count], float.
- particle_max_radius#
Maximum particle radius (useful for HashGrid construction).
- particle_mu#
Particle friction coefficient.
- particle_q#
Particle positions, shape [particle_count, 3], float.
- particle_qd#
Particle velocities, shape [particle_count, 3], float.
- particle_radius#
Particle radius, shape [particle_count], float.
- particle_world: wp.array | None#
World index for each particle, shape [particle_count], int. -1 for global.
- particle_world_start#
Start index of the first particle per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the particles belonging to that world. The second-last element (accessible via index -2) stores the start index of the global particles (i.e. with world index -1) added to the end of the model, and the last element stores the total particle count.
- The number of particles in a given world w can be computed as:
num_particles_in_world = particle_world_start[w + 1] - particle_world_start[w].
- The total number of global particles can be computed as:
num_global_particles = particle_world_start[-1] - particle_world_start[-2] + particle_world_start[0].
- requires_grad#
Whether the model was finalized (see
ModelBuilder.finalize()) with gradient computation enabled.
- rigid_contact_max#
Number of potential contact points between rigid bodies.
- shape_body#
Rigid shape body index, shape [shape_count], int.
- shape_collision_filter_pairs: set[tuple[int, int]]#
s1 < s2.
- Type:
Pairs of shape indices (s1, s2) that should not collide. Pairs are in canonical order
- shape_collision_group#
Collision group of each shape, shape [shape_count], int. Array populated during finalization.
- shape_collision_radius#
Collision radius for bounding sphere broadphase, shape [shape_count], float. Not supported by
SolverMuJoCo.
- shape_contact_margin#
Shape contact margin for collision detection, shape [shape_count], float.
- shape_contact_pair_count#
Number of shape contact pairs.
- shape_contact_pairs#
Pairs of shape indices that may collide, shape [contact_pair_count, 2], int.
- shape_count#
Total number of shapes in the system.
- shape_filter#
Shape filter group, shape [shape_count], int.
- shape_flags#
Rigid shape flags, shape [shape_count], int.
- shape_is_solid#
Whether shape is solid or hollow, shape [shape_count], bool.
- shape_key#
List of keys for each shape.
- shape_local_aabb_lower#
Local-space AABB lower bound for each shape, shape [shape_count, 3], float. Computed from base geometry only (excludes thickness - thickness is added during contact margin calculations). Used for voxel-based contact reduction.
- shape_local_aabb_upper#
Local-space AABB upper bound for each shape, shape [shape_count, 3], float. Computed from base geometry only (excludes thickness - thickness is added during contact margin calculations). Used for voxel-based contact reduction.
- shape_material_k_hydro#
Shape hydroelastic stiffness coefficient, shape [shape_count], float.
- shape_material_ka#
Shape contact adhesion distance, shape [shape_count], float.
- shape_material_kd#
Shape contact damping stiffness, shape [shape_count], float.
- shape_material_ke#
Shape contact elastic stiffness, shape [shape_count], float.
- shape_material_kf#
Shape contact friction stiffness, shape [shape_count], float.
- shape_material_mu#
Shape coefficient of friction, shape [shape_count], float.
- shape_material_restitution#
Shape coefficient of restitution, shape [shape_count], float.
- shape_material_rolling_friction#
Shape rolling friction coefficient (resistance to rolling motion), shape [shape_count], float.
- shape_material_torsional_friction#
Shape torsional friction coefficient (resistance to spinning at contact point), shape [shape_count], float.
- shape_scale#
Shape 3D scale, shape [shape_count, 3], float.
- shape_sdf_coarse_volume#
List of coarse SDF volume references for mesh shapes, shape [shape_count]. None for non-mesh shapes. Empty if there are no colliding meshes. Kept for reference counting.
- shape_sdf_data#
Array of SDFData structs for mesh shapes, shape [shape_count]. Contains sparse and coarse SDF pointers, extents, and voxel sizes. Empty array if there are no colliding meshes.
- shape_sdf_volume#
List of sparse SDF volume references for mesh shapes, shape [shape_count]. None for non-mesh shapes. Empty if there are no colliding meshes. Kept for reference counting.
- shape_source#
List of source geometry objects (e.g.,
Mesh,SDF) used for rendering and broadphase, shape [shape_count].
- shape_source_ptr#
Geometry source pointer to be used inside the Warp kernels which can be generated by finalizing the geometry objects, see for example
newton.Mesh.finalize(), shape [shape_count], uint64.
- shape_thickness#
Shape thickness, shape [shape_count], float.
- shape_transform#
Rigid shape transforms, shape [shape_count, 7], float.
- shape_type#
Shape geometry type, shape [shape_count], int32.
- shape_voxel_resolution#
Voxel grid resolution (nx, ny, nz) for each shape, shape [shape_count, 3], int. Used for voxel-based contact reduction.
- shape_world#
World index for each shape, shape [shape_count], int. -1 for global.
- shape_world_start#
Start index of the first shape per world, shape [num_worlds + 2], int.
The entries at indices 0 to num_worlds - 1 store the start index of the shapes belonging to that world. The second-last element (accessible via index -2) stores the start index of the global shapes (i.e. with world index -1) added to the end of the model, and the last element stores the total shape count.
- The number of shapes in a given world w can be computed as:
num_shapes_in_world = shape_world_start[w + 1] - shape_world_start[w].
- The total number of global shapes can be computed as:
num_global_shapes = shape_world_start[-1] - shape_world_start[-2] + shape_world_start[0].
- soft_contact_kd#
Damping of soft contacts (used by
SolverSemiImplicitandSolverFeatherstone).
- soft_contact_ke#
Stiffness of soft contacts (used by
SolverSemiImplicitandSolverFeatherstone).
- soft_contact_kf#
Stiffness of friction force in soft contacts (used by
SolverSemiImplicitandSolverFeatherstone).
- soft_contact_mu#
Friction coefficient of soft contacts.
- soft_contact_restitution#
Restitution coefficient of soft contacts (used by
SolverXPBD).
- spring_constraint_lambdas#
Lagrange multipliers for spring constraints (internal use).
- spring_control#
Particle spring activation, shape [spring_count], float.
- spring_count#
Total number of springs in the system.
- spring_damping#
Particle spring damping, shape [spring_count], float.
- spring_indices#
Particle spring indices, shape [spring_count*2], int.
- spring_rest_length#
Particle spring rest length, shape [spring_count], float.
- spring_stiffness#
Particle spring stiffness, shape [spring_count], float.
- tet_activations#
Tetrahedral volumetric activations, shape [tet_count], float.
- tet_count#
Total number of tetrahedra in the system.
- tet_indices#
Tetrahedral element indices, shape [tet_count*4], int.
- tet_materials#
Tetrahedral elastic parameters in form \(k_{mu}, k_{lambda}, k_{damp}\), shape [tet_count, 3].
- tet_poses#
Tetrahedral rest poses, shape [tet_count, 3, 3], float.
- tri_activations#
Triangle element activations, shape [tri_count], float.
- tri_areas#
Triangle element rest areas, shape [tri_count], float.
- tri_count#
Total number of triangles in the system.
- tri_indices#
Triangle element indices, shape [tri_count*3], int.
- tri_materials#
Triangle element materials, shape [tri_count, 5], float.
- tri_poses#
Triangle element rest pose, shape [tri_count, 2, 2], float.
- up_axis#
0 for x, 1 for y, 2 for z.
- Type:
Up axis