---
title: shapeToOverlayItems
summary: Function in @bimworks/viewercommon.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/viewercommon
---

# shapeToOverlayItems

[[page:reference/javascript/api|API catalogue]] · `@bimworks/viewercommon` · Function

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
function shapeToOverlayItems
````



## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-viewercommon/shapetooverlayitems-8b887cd1#member-bimworks-viewercommon-shapetooverlayitems-2bb2fbc4f4b3|shapeToOverlayItems]] | Method | Overlay items for a shape of a BVL or query result: an OrientedBox ({center, extent, axis1..3}), OrientedCylinder ({center, orientation, radius, height}), Or… |

## `shapeToOverlayItems` {#member-bimworks-viewercommon-shapetooverlayitems-2bb2fbc4f4b3}

````typescript sdk=js sdk-namespace="@bimworks/viewercommon"
shapeToOverlayItems(shape: object, id: string, common?: { [field: string]: unknown }): (ShapeOverlayItem)[]
````

Overlay items for a shape of a BVL or query result: an OrientedBox ({center, extent, axis1..3}),
OrientedCylinder ({center, orientation, radius, height}), OrientedCone (the same fields) or Sphere
({center, radius}), points and vectors as {x, y, z} in raw world mm of the shape's model (bind the
overlay to it). A box or cylinder may leave out `__type`. A cylinder also gets its diameter as a
dimension across the top. Empty for a shape this function does not know

### Parameters

| Name | Type | Description |
|---|---|---|
| `shape` | `object` |  |
| `id` | `string` |  |
| `common` | `{ [field: string]: unknown }` | fields every item gets (color, qids, depth, ...); color defaults to red |
