# BodyShape

Rigid body with mass, inertia tensor, different shapes for animation, and two frame connectors (12 potential states)

## Library

Modelica/Mechanics/MultiBody/Parts

## Description

**Rigid body** with mass and inertia tensor and **two frame connectors**.
All parameter vectors have to be resolved in frame_a.
The **inertia tensor** has to be defined with respect to a
coordinate system that is parallel to frame_a with the
origin at the center of mass of the body. The coordinate system **frame_b**
is always parallel to **frame_a**.

By default, this component is visualized by any **shape** that can be
defined with Modelica.Mechanics.MultiBody.Visualizers.FixedShape. This shape is placed
between frame_a and frame_b (default: length(shape) = Frames.length(r)).
Additionally a **sphere** may be visualized that has
its center at the center of mass.
Note, that
the animation may be switched off via parameter animation = **false**.

The following shapes can be defined via parameter **shapeType**,
e.g., shapeType="cone":

A BodyShape component has potential states. For details of these states and of the "Advanced" menu parameters, see model MultiBody.Parts.Body.

## Parameters

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| animation | = true, if animation shall be enabled (show shape between frame_a and frame_b and optionally a sphere at the center of mass) | Scalar | true |

| animateSphere | = true, if mass shall be animated as sphere provided animation=true | Scalar | true |

| r | Vector from frame_a to frame_b resolved in frame_a | Vector of size 3 | |

| r_CM | Vector from frame_a to center of mass, resolved in frame_a | Vector of size 3 | |

| m | Mass of rigid body | Scalar | |

| I_11 | (1,1) element of inertia tensor | Scalar | |

| I_22 | (2,2) element of inertia tensor | Scalar | |

| I_33 | (3,3) element of inertia tensor | Scalar | |

| I_21 | (2,1) element of inertia tensor | Scalar | |

| I_31 | (3,1) element of inertia tensor | Scalar | |

| I_32 | (3,2) element of inertia tensor | Scalar |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| angles_fixed | = true, if angles_start are used as initial values, else as guess values | Scalar | true |

| angles_start | Initial values of angles to rotate frame_a around 'sequence_start' axes into frame_b | Vector of size 3 | |

| sequence_start | Sequence of rotations to rotate frame_a into frame_b at initial time | Vector of size 3 | |

| w_0_fixed | = true, if w_0_start are used as initial values, else as guess values | Scalar | true |

| w_0_start | Initial or guess values of angular velocity of frame_a resolved in world frame | Vector of size 3 | |

| z_0_fixed | = true, if z_0_start are used as initial values, else as guess values | Scalar | true |

| z_0_start | Initial values of angular acceleration z_0 = der(w_0) | Vector of size 3 |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| shapeType | Type of shape | String | |

| r_shape | Vector from frame_a to shape origin, resolved in frame_a | Vector of size 3 | |

| lengthDirection | Vector in length direction of shape, resolved in frame_a | Vector of size 3 | |

| widthDirection | Vector in width direction of shape, resolved in frame_a | Vector of size 3 | |

| length | Length of shape | Scalar | |

| width | Width of shape | Scalar | |

| height | Height of shape | Scalar | |

| extra | Additional parameter depending on shapeType (see docu of Visualizers.Advanced.Shape) | Scalar | |

| color | Color of shape | Vector of size 3 | |

| sphereDiameter | Diameter of sphere | Scalar | |

| sphereColor | Color of sphere of mass | Vector of size 3 | |

| specularCoefficient | Reflection of ambient light (= 0: light is completely absorbed) | Scalar |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| enforceStates | = true, if absolute variables of body object shall be used as states (StateSelect.always) | Scalar | true |

| useQuaternions | = true, if quaternions shall be used as potential states otherwise use 3 angles as potential states | Scalar | true |

| sequence_angleStates | Sequence of rotations to rotate world frame into frame_a around the 3 angles used as potential states | Vector of size 3 |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| r_0 | r_0 | Structure | |

| fixed | Cell of vectors of size 3 | true | |

| start | Cell of vectors of size 3 | ||

| v_0 | v_0 | Structure | |

| fixed | Cell of vectors of size 3 | true | |

| start | Cell of vectors of size 3 | ||

| a_0 | a_0 | Structure | |

| fixed | Cell of vectors of size 3 | true | |

| start | Cell of vectors of size 3 |

## Ports

Name | Type | Description | IO Type | Number |
---|---|---|---|---|

| implicit | Coordinate system fixed to the component with one cut-force and cut-torque | input | 1 |

| implicit | Coordinate system fixed to the component with one cut-force and cut-torque | output | 1 |