---
url: /dyad/dev/stdlib/MultibodyComponents/components/BoxVisualizer.md
description: >-
  Dyad BoxVisualizer docs.  Frame-connected box visualizer with zero mass. Used
  for URDF import of zero-mass links with box geometry.
---

# `BoxVisualizer` {#BoxVisualizer}

Frame-connected box visualizer with zero mass. Used for URDF import of zero-mass links with box geometry.

## Usage {#Usage}

`MultibodyComponents.BoxVisualizer(render=true, color=[1.0, 0.0, 0.0, 1.0])`

## Parameters: {#Parameters:}

|     Name |       Description | Units |        Default value |
| --------:| -----------------:| -----:| --------------------:|
| `render` | Whether to render |     – |                 true |
|  `color` |        RGBA color |     – | \[1.0, 0.0, 0.0, 1.0] |

## Connectors {#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`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

## Variables {#Variables}

|               Name |                                                         Description | Units |
| ------------------:| -------------------------------------------------------------------:| -----:|
|           `length` |                                                   Length of the box |     – |
|            `width` |                                                    Width of the box |     – |
|           `height` |                                                   Height of the box |     – |
| `length_direction` |                    Direction of the box length, resolved in frame_a |     – |
|  `width_direction` |                     Direction of the box width, resolved in frame_a |     – |
|          `r_shape` | Position of the box origin relative to frame_a, resolved in frame_a |     – |

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
Frame-connected box visualizer with zero mass.
Used for URDF import of zero-mass links with box geometry.
"""
component BoxVisualizer
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 50, "x2": 150, "y1": 450, "y2": 550}}}
  }
  shape = BoxShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), r_shape = r_shape, length_direction = length_direction, width_direction = width_direction, length = length, width = width, height = height) {"Dyad": {"placement": {"diagram": {"x1": 20, "x2": 120, "y1": 20, "y2": 120}}}}
  "Whether to render"
  parameter render::Boolean = true
  "RGBA color"
  parameter color::Real[4] = [1.0, 0.0, 0.0, 1.0]
  "Length of the box"
  variable length::Real = 1.0
  "Width of the box"
  variable width::Real = 1.0
  "Height of the box"
  variable height::Real = 1.0
  "Direction of the box length, resolved in frame_a"
  variable length_direction::Real[3] = [1.0, 0.0, 0.0]
  "Direction of the box width, resolved in frame_a"
  variable width_direction::Real[3] = [0.0, 1.0, 0.0]
  "Position of the box origin relative to frame_a, resolved in frame_a"
  variable r_shape::Real[3] = [0, 0, 0]
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/BoxVisualizer.svg"},
    "labels": [
      {
        "label": "a",
        "x": 110,
        "y": 455,
        "rot": 0,
        "layer": "icon",
        "attrs": {
          "fill": "#333",
          "font-size": "80",
          "font-weight": "bold",
          "text-anchor": "middle",
          "dominant-baseline": "central"
        }
      }
    ]
  }
}
end
```

```dyad
"""
Frame-connected box visualizer with zero mass.
Used for URDF import of zero-mass links with box geometry.
"""
component BoxVisualizer
  frame_a = Frame3D() {
    "Dyad": {"placement": {"diagram": {"x1": 50, "x2": 150, "y1": 450, "y2": 550}}}
  }
  shape = BoxShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), r_shape = r_shape, length_direction = length_direction, width_direction = width_direction, length = length, width = width, height = height) {"Dyad": {"placement": {"diagram": {"x1": 20, "x2": 120, "y1": 20, "y2": 120}}}}
  "Whether to render"
  parameter render::Boolean = true
  "RGBA color"
  parameter color::Real[4] = [1.0, 0.0, 0.0, 1.0]
  "Length of the box"
  variable length::Real = 1.0
  "Width of the box"
  variable width::Real = 1.0
  "Height of the box"
  variable height::Real = 1.0
  "Direction of the box length, resolved in frame_a"
  variable length_direction::Real[3] = [1.0, 0.0, 0.0]
  "Direction of the box width, resolved in frame_a"
  variable width_direction::Real[3] = [0.0, 1.0, 0.0]
  "Position of the box origin relative to frame_a, resolved in frame_a"
  variable r_shape::Real[3] = [0, 0, 0]
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/BoxVisualizer.svg"},
    "labels": [
      {
        "label": "a",
        "x": 110,
        "y": 455,
        "rot": 0,
        "layer": "icon",
        "attrs": {
          "fill": "#333",
          "font-size": "80",
          "font-weight": "bold",
          "text-anchor": "middle",
          "dominant-baseline": "central"
        }
      }
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
