siconos.mechanics.collision.tools module¶
tools.py - Geometry and contact tools for Siconos mechanics module
This module provides classes to describe shapes, volumes, and contactors used in mechanical simulations, with optional transformation, material, and collision metadata.
Classes¶
MovedShape : Base class for geometry with translation and orientation.
Shape : A named shape with optional instance identifier.
Volume : A Shape with mass and density parameters.
Contactor : A Shape belonging to a collision group, with contact metadata.
- class siconos.mechanics.collision.tools.Material(density=None)[source]¶
Bases:
objectSome material properties that may be associated to shapes.
- Parameters:
density (float, optional) – The material density (default is None).
- density = None¶
- class siconos.mechanics.collision.tools.MovedShape(shape_name, data=None, relative_translation=(0.0, 0.0, 0.0), relative_orientation=(1.0, 0.0, 0.0, 0.0))[source]¶
Bases:
objectA geometrical shape moved by a translation and an orientation relative to its parent frame.
The orientation can be provided either as a quaternion [w, x, y, z] or as an (axis, angle) pair.
- Parameters:
shape_name (str) – Reference name or identifier of the shape.
data (object, optional) – Actual shape geometry object, typically from an external CAD or OCC representation.
relative_translation (tuple of 3 floats, optional) – Translation vector in the local body frame. Defaults to (0.0, 0.0, 0.0).
relative_orientation (tuple, optional) – Either a quaternion [w, x, y, z], or (axis, angle) where axis is a list of 3 floats and angle is a float. Defaults to (1.0, 0.0, 0.0, 0.0), i.e., identity rotation.
- shape_name¶
- data = None¶
- relative_translation = (0.0, 0.0, 0.0)¶
- relative_orientation = (1.0, 0.0, 0.0, 0.0)¶
- translation¶
- orientation¶
- class siconos.mechanics.collision.tools.Shape(shape_name, data=None, relative_translation=(0.0, 0.0, 0.0), relative_orientation=(1.0, 0.0, 0.0, 0.0), instance_name=None)[source]¶
Bases:
MovedShapeA MovedShape with an optional instance name.
- Parameters:
shape_name (str) – Reference name or identifier of the shape.
data (object, optional) – Actual shape geometry object, typically from an external CAD or OCC representation.
instance_name (str, optional) – Optional identifier for this shape instance.
relative_translation (tuple of 3 floats, optional) – Translation vector in the local body frame. Defaults to (0.0, 0.0, 0.0).
relative_orientation (tuple, optional) – Either a quaternion [w, x, y, z], or (axis, angle) where axis is a list of 3 floats and angle is a float. Defaults to (1.0, 0.0, 0.0, 0.0), i.e., identity rotation.
- instance_name = None¶
- class siconos.mechanics.collision.tools.Volume(shape_name, data=None, relative_translation=(0.0, 0.0, 0.0), relative_orientation=(1.0, 0.0, 0.0, 0.0), instance_name=None, mass=None, parameters=<factory>)[source]¶
Bases:
ShapeA Shape with mass properties and material parameters.
Inherits from Shape and adds physical characteristics like mass and density
- Parameters:
shape_name (str) – Reference name of the shape.
shape_data (object, optional) – Actual shape geometry object.
instance_name (str, optional) – Optional unique name for this instance.
mass (float, optional) – Total mass. If None, can be computed from density and volume.
parameters (Material, optional) – Material properties (e.g., density).
relative_translation (tuple of 3 floats, optional) – Translation in local coordinates. Defaults to (0, 0, 0).
relative_orientation (tuple, optional) – Orientation as quaternion [w, x, y, z] or (axis, angle).
- mass = None¶
- parameters¶
- class siconos.mechanics.collision.tools.Contactor(shape_name, data=None, relative_translation=(0.0, 0.0, 0.0), relative_orientation=(1.0, 0.0, 0.0, 0.0), instance_name=None, collision_group=0, parameters=None, contact_type=None, contact_index=None)[source]¶
Bases:
ShapeA Shape that belongs to a collision group and may carry contact-specific data.
Depending on the geometrical engine used, some information may be added to the contactor, such as the kind of contact and the concerned part of the shape. Contact laws must then be defined between collision groups.
- Parameters:
shape_name (str) – Reference name of the shape.
shape_data (object, optional) – Actual shape geometry.
instance_name (str, optional) – Identifier for this instance of the shape.
collision_group (int, optional) – Group ID used in collision detection. Default is 0.
parameters (object, optional) – Extra parameters attached to the contactor (e.g., friction, tags).
contact_type (object, optional) – Type of contact (e.g., face, edge), engine-specific.
contact_index (int, optional) – Index of the concerned sub-entity.
relative_translation (tuple of 3 floats, optional) – Translation in local coordinates. Defaults to (0, 0, 0).
relative_orientation (tuple, optional) – Orientation as quaternion [w, x, y, z] or (axis, angle).
- collision_group = 0¶
- parameters = None¶
- contact_type = None¶
- contact_index = None¶