---
url: /dyad/stable/stdlib/MultibodyComponents/components/ConeShape.md
description: Dyad ConeShape docs.  Cone shape primitive for 3D rendering.
---

# `ConeShape` {#ConeShape}

Cone shape primitive for 3D rendering.

This component extends from [`Shape`](../types/Shape.md)

## Usage {#Usage}

`MultibodyComponents.ConeShape(render=true, color=[0.5, 0.5, 0.5, 1.0], specular_coefficient=0.7)`

## Parameters: {#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.0] |
| `specular_coefficient` | Specular reflection coefficient (0 = fully diffuse) |     – |                  0.7 |

## Variables {#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 |     – |

## Behavior {#Behavior}

$$ \begin{align}
r\_{1}\left( t \right) &= 0 \\
r\_{2}\left( t \right) &= 0 \\
r\_{3}\left( t \right) &= 0 \\
R\_{1,1}\left( t \right) &= 1 \\
R\_{2,1}\left( t \right) &= 0 \\
R\_{3,1}\left( t \right) &= 0 \\
R\_{1,2}\left( t \right) &= 0 \\
R\_{2,2}\left( t \right) &= 1 \\
R\_{3,2}\left( t \right) &= 0 \\
R\_{1,3}\left( t \right) &= 0 \\
R\_{2,3}\left( t \right) &= 0 \\
R\_{3,3}\left( t \right) &= 1 \\
\mathtt{r_shape}\_{1}\left( t \right) &= 0 \\
\mathtt{r_shape}\_{2}\left( t \right) &= 0 \\
\mathtt{r_shape}\_{3}\left( t \right) &= 0 \\
\mathtt{length_direction}\_{1}\left( t \right) &= 1 \\
\mathtt{length_direction}\_{2}\left( t \right) &= 0 \\
\mathtt{length_direction}\_{3}\left( t \right) &= 0 \\
\mathtt{width_direction}\_{1}\left( t \right) &= 0 \\
\mathtt{width_direction}\_{2}\left( t \right) &= 1 \\
\mathtt{width_direction}\_{3}\left( t \right) &= 0 \\
\mathtt{length}\left( t \right) &= 0 \\
\mathtt{width}\left( t \right) &= 0 \\
\mathtt{height}\left( t \right) &= 0
\end{align}
$$

## Source {#Source}

```dyad
"Cone shape primitive for 3D rendering."
component ConeShape
  extends Shape
relations
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/ConeShape.svg"}}}
end
```

```dyad
"Cone shape primitive for 3D rendering."
component ConeShape
  "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
relations
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/ConeShape.svg"}}}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
