Skip to content
LIBRARY
ShapefileVisualizer.md

ShapefileVisualizer

Frame-connected mesh visualizer with no mass or inertia.

Renders an external mesh file (STL/OBJ/GLTF/...) attached to frame_a, optionally repositioned by shape_transform and uniformly scaled by shape_scale. Use this to give a frame a non-primitive visual without introducing dynamics — for static decor (attach to Fixed.frame_b) or to dress up moving frames (attach to a joint's frame_b).

The mesh is loaded by FileIO.load, so shapefile must be a path resolvable at render time. A path of "" disables rendering.

Usage

MultibodyComponents.ShapefileVisualizer(render=true, color=[0.5, 0.5, 0.5, 1.0], shapefile="", shape_transform=[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]], shape_scale=1, specular_coefficient=0.7)

Parameters:

NameDescriptionUnitsDefault value
renderWhether to rendertrue
colorRGBA color[0.5, 0.5, 0.5, 1.0]
shapefilePath to mesh file (empty = no render)""
shape_transform4x4 homogeneous transform from mesh-local to frame_a[1 0 0 0; 0...0; 0 0 0 1]
shape_scaleUniform scale applied to the mesh1
specular_coefficientSpecular reflection coefficient (0 = fully diffuse)0.7

Connectors

  • frame_a - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

Behavior

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

Source

dyad
"""
Frame-connected mesh visualizer with no mass or inertia.

Renders an external mesh file (STL/OBJ/GLTF/...) attached to `frame_a`,
optionally repositioned by `shape_transform` and uniformly scaled by
`shape_scale`. Use this to give a frame a non-primitive visual without
introducing dynamics — for static decor (attach to `Fixed.frame_b`) or to
dress up moving frames (attach to a joint's `frame_b`).

The mesh is loaded by `FileIO.load`, so `shapefile` must be a path resolvable
at render time. A path of `""` disables rendering.
"""
component ShapefileVisualizer
  frame_a = Frame3D() {}
  "Whether to render"
  parameter render::Boolean = true
  "RGBA color"
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  "Path to mesh file (empty = no render)"
  parameter shapefile::String = ""
  "4x4 homogeneous transform from mesh-local to frame_a"
  parameter shape_transform::Real[4, 4] = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
  "Uniform scale applied to the mesh"
  parameter shape_scale::Real = 1
  "Specular reflection coefficient (0 = fully diffuse)"
  parameter specular_coefficient::Real = 0.7
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/ShapefileVisualizer.svg"},
    "labels": [
      {
        "label": "a",
        "x": 110,
        "y": 410,
        "rot": 0,
        "layer": "icon",
        "attrs": {
          "fill": "#333",
          "font-size": "80",
          "font-weight": "bold",
          "text-anchor": "middle",
          "dominant-baseline": "central"
        }
      }
    ]
  }
}
end
Flattened Source
dyad
"""
Frame-connected mesh visualizer with no mass or inertia.

Renders an external mesh file (STL/OBJ/GLTF/...) attached to `frame_a`,
optionally repositioned by `shape_transform` and uniformly scaled by
`shape_scale`. Use this to give a frame a non-primitive visual without
introducing dynamics — for static decor (attach to `Fixed.frame_b`) or to
dress up moving frames (attach to a joint's `frame_b`).

The mesh is loaded by `FileIO.load`, so `shapefile` must be a path resolvable
at render time. A path of `""` disables rendering.
"""
component ShapefileVisualizer
  frame_a = Frame3D() {}
  "Whether to render"
  parameter render::Boolean = true
  "RGBA color"
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  "Path to mesh file (empty = no render)"
  parameter shapefile::String = ""
  "4x4 homogeneous transform from mesh-local to frame_a"
  parameter shape_transform::Real[4, 4] = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
  "Uniform scale applied to the mesh"
  parameter shape_scale::Real = 1
  "Specular reflection coefficient (0 = fully diffuse)"
  parameter specular_coefficient::Real = 0.7
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/ShapefileVisualizer.svg"},
    "labels": [
      {
        "label": "a",
        "x": 110,
        "y": 410,
        "rot": 0,
        "layer": "icon",
        "attrs": {
          "fill": "#333",
          "font-size": "80",
          "font-weight": "bold",
          "text-anchor": "middle",
          "dominant-baseline": "central"
        }
      }
    ]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses