Skip to content
LIBRARY
ArrowShape.md

ArrowShape

Arrow shape primitive for 3D rendering.

Renders a vector arrow (shaft cylinder + arrowhead cone). Used for visualizing forces, torques, and other vector quantities. The arrow direction and length come from the length_direction and length variables of the parent Shape.

This component extends from Shape

Usage

MultibodyComponents.ArrowShape(render=true, color=[0.5, 0.5, 0.5, 1.0], specular_coefficient=0.7, head_at_origin=true, diameter=0.05, head_length=0.1, head_diameter=0.1)

Parameters:

NameDescriptionUnitsDefault value
renderWhether this shape should be renderedtrue
colorRGBA color of the shape[0.5, 0.5, 0.5, 1.0]
specular_coefficientSpecular reflection coefficient (0 = fully diffuse)0.7
head_at_originWhether the arrowhead points at the origin (true for forces) or awaytrue
diameterDiameter of the arrow shaft0.05
head_lengthLength of the arrowhead cone0.1
head_diameterDiameter of the arrowhead cone base0.1

Variables

NameDescriptionUnits
r3D position of the shape origin in world frame
R3D rotation matrix (orientation) of the shape in world frame
r_shapeOffset from r to shape origin, resolved in shape frame
length_directionPrimary axis direction (unit vector, resolved in shape frame)
width_directionSecondary axis direction (unit vector, resolved in shape frame)
lengthDimension along length_direction
widthDimension along width_direction
heightDimension perpendicular to both length and width

Behavior

Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"

Source

dyad
"""
Arrow shape primitive for 3D rendering.

Renders a vector arrow (shaft cylinder + arrowhead cone). Used for visualizing
forces, torques, and other vector quantities. The arrow direction and length
come from the `length_direction` and `length` variables of the parent Shape.
"""
component ArrowShape
  extends Shape
  "Whether the arrowhead points at the origin (true for forces) or away"
  parameter head_at_origin::Boolean = true
  "Diameter of the arrow shaft"
  parameter diameter::Real = 0.05
  "Length of the arrowhead cone"
  parameter head_length::Real = 0.1
  "Diameter of the arrowhead cone base"
  parameter head_diameter::Real = 0.1
relations
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/ArrowShape.svg"}}}
end
Flattened Source
dyad
"""
Arrow shape primitive for 3D rendering.

Renders a vector arrow (shaft cylinder + arrowhead cone). Used for visualizing
forces, torques, and other vector quantities. The arrow direction and length
come from the `length_direction` and `length` variables of the parent Shape.
"""
component ArrowShape
  "Whether this shape should be rendered"
  parameter render::Boolean = true
  "3D position of the shape origin in world frame"
  variable r::Real[3] = [0, 0, 0]
  "3D rotation matrix (orientation) of the shape in world frame"
  variable R::Real[3, 3] = RR(nullrotation())
  "Offset from r to shape origin, resolved in shape frame"
  variable r_shape::Real[3] = [0, 0, 0]
  "Primary axis direction (unit vector, resolved in shape frame)"
  variable length_direction::Real[3] = [1.0, 0, 0]
  "Secondary axis direction (unit vector, resolved in shape frame)"
  variable width_direction::Real[3] = [0, 1.0, 0]
  "Dimension along length_direction"
  variable length::Real = 0
  "Dimension along width_direction"
  variable width::Real = 0
  "Dimension perpendicular to both length and width"
  variable height::Real = 0
  "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
  "Whether the arrowhead points at the origin (true for forces) or away"
  parameter head_at_origin::Boolean = true
  "Diameter of the arrow shaft"
  parameter diameter::Real = 0.05
  "Length of the arrowhead cone"
  parameter head_length::Real = 0.1
  "Diameter of the arrowhead cone base"
  parameter head_diameter::Real = 0.1
relations
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/ArrowShape.svg"}}}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses