LIBRARY
Shape
Base visual shape primitive for 3D rendering.
Parent components instantiate concrete shape subcomponents (CylinderShape, SphereShape, etc.) and set the r (position) and R (rotation) variables via equations to place the shape in space.
Follows the Modelica MB.Visualizers.Advanced.Shape pattern.
Usage
MultibodyComponents.Shape(render=true, color=[0.5, 0.5, 0.5, 1.0], specular_coefficient=0.7)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
render | Whether this shape should be rendered | – | true |
color | RGBA color of the shape | – | [0.5, 0.5, 0.5, 1] |
specular_coefficient | Specular reflection coefficient (0 = fully diffuse) | – | 0.7 |
Variables
| Name | Description | Units |
|---|---|---|
r | 3D position of the shape origin in world frame | – |
R | 3D rotation matrix (orientation) of the shape in world frame | – |
r_shape | Offset from r to shape origin, resolved in shape frame | – |
length_direction | Primary axis direction (unit vector, resolved in shape frame) | – |
width_direction | Secondary axis direction (unit vector, resolved in shape frame) | – |
length | Dimension along length_direction | – |
width | Dimension along width_direction | – |
height | Dimension perpendicular to both length and width | – |
Source
dyad
"""
Base visual shape primitive for 3D rendering.
Parent components instantiate concrete shape subcomponents (CylinderShape,
SphereShape, etc.) and set the `r` (position) and `R` (rotation) variables
via equations to place the shape in space.
Follows the Modelica `MB.Visualizers.Advanced.Shape` pattern.
"""
partial component Shape
"Whether this shape should be rendered"
parameter render::Boolean = true
"3D position of the shape origin in world frame"
variable r::Real[3]
"3D rotation matrix (orientation) of the shape in world frame"
variable R::Real[3, 3]
"Offset from r to shape origin, resolved in shape frame"
variable r_shape::Real[3]
"Primary axis direction (unit vector, resolved in shape frame)"
variable length_direction::Real[3]
"Secondary axis direction (unit vector, resolved in shape frame)"
variable width_direction::Real[3]
"Dimension along length_direction"
variable length::Real
"Dimension along width_direction"
variable width::Real
"Dimension perpendicular to both length and width"
variable height::Real
"RGBA color of the shape"
parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
"Specular reflection coefficient (0 = fully diffuse)"
parameter specular_coefficient::Real = 0.7
relations
endFlattened Source
dyad
"""
Base visual shape primitive for 3D rendering.
Parent components instantiate concrete shape subcomponents (CylinderShape,
SphereShape, etc.) and set the `r` (position) and `R` (rotation) variables
via equations to place the shape in space.
Follows the Modelica `MB.Visualizers.Advanced.Shape` pattern.
"""
partial component Shape
"Whether this shape should be rendered"
parameter render::Boolean = true
"3D position of the shape origin in world frame"
variable r::Real[3]
"3D rotation matrix (orientation) of the shape in world frame"
variable R::Real[3, 3]
"Offset from r to shape origin, resolved in shape frame"
variable r_shape::Real[3]
"Primary axis direction (unit vector, resolved in shape frame)"
variable length_direction::Real[3]
"Secondary axis direction (unit vector, resolved in shape frame)"
variable width_direction::Real[3]
"Dimension along length_direction"
variable length::Real
"Dimension along width_direction"
variable width::Real
"Dimension perpendicular to both length and width"
variable height::Real
"RGBA color of the shape"
parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
"Specular reflection coefficient (0 = fully diffuse)"
parameter specular_coefficient::Real = 0.7
relations
metadata {}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses