---
title: SectionPlanes
summary: Class in @bimworks/viewer3d.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/viewer3d
---

# SectionPlanes

[[page:reference/javascript/api|API catalogue]] · `@bimworks/viewer3d` · Class

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
class SectionPlanes
````



## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-constructor-5ba5551fc280|constructor]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-annotationdefaults-e7017756421e|annotationDefaults]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-annotationdefaults-20e3dc89e209|annotationDefaults]] | Method | The annotation mode and reach every newly started plane or box begins with: the starters, startPlaneAt(), Ctrl + drag and the face widget, startSectionBox().… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-capstyles-be20470d4985|capStyles]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-capstyles-e11bb54d629e|capStyles]] | Method | Whether the end caps draw each object's cap style (Viewer3d.setCapStyles: a pattern per kind of material at a spacing fixed on screen) with cut outlines arou… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-endcaps-be7a70a9f37a|endcaps]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-endcaps-85356eef44b6|endcaps]] | Method | Whether the cut surfaces are closed with end caps |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-hatching-3df00f8732a3|hatching]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-hatching-e89a06fe672b|hatching]] | Method | Enabled/disable hatching of section plane end-caps |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-iconorientation-13bfbb9db8fe|iconOrientation]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-iconorientation-c342e8a7dcb2|iconOrientation]] | Method | How the drag icons of the section planes are drawn (SectionPlaneIconOrientation): facing the screen ("billboard", the default) or lying in their planes ("pla… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-objectendcaps-99479676e507|objectEndcaps]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-objectendcaps-fe5b4bb5b033|objectEndcaps]] | Method | Whether the end caps take the colours of the objects they cut (with their hover and selection tints), and a pick on a cap finds that object at the point on t… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-showarrows-fb3bb4ac55a8|showArrows]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-showarrows-49a12c482570|showArrows]] | Method | Show or hide the 3D arrows of the section planes: an arrow on each plane, pointing to the side it cuts away, that keeps its size on screen. Dragging an arrow… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-showicons-e5caa4c253b8|showIcons]] | Method |  |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-showicons-b52376aa4abd|showIcons]] | Method | Show or hide the drag icons of the section planes. A plane that is hidden (SectionPlane.setVisible) shows no icon either way |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-canstartplane-4b3b36795e8c|canStartPlane]] | Method | Whether another plane fits: false while all six slots cut, as they do with a section box. The face widget and Ctrl + left drag then start nothing; startPlane… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-disableall-6f4528243178|disableAll]] | Method | Disable all the active section planes, this removed the actual section plane cutting, and the visualisations of the planes |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-get-34fcfb52a3d9|get]] | Method | The plane in a slot (0..5) of the six section-plane slots, whether it cuts or not. Which slot a plane takes depends on what cut before; getPlanes lists the p… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-geticon-06a624e92ac7|getIcon]] | Method | The icon markup as last passed to setIcon, or DEFAULT_SECTION_PLANE_ICON |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-getplanes-45cbd623ea92|getPlanes]] | Method | The planes that cut the model now, oldest first: single planes and the faces of a box alike. A new array; the planes in it are live, and stop cutting when di… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-getsectionplanewidget-ef9e58cf7d9e|getSectionPlaneWidget]] | Method | The widget that previews a section plane on the face under the cursor, armed by startFaceTouchOff or while Ctrl is held. With Ctrl held over an object it sho… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-getstate-6adfe6c353bf|getState]] | Method | How the planes and the box cut the model now, as a value to give back to setState later: a tool that cuts the model for a while (the clash view's section box… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-isdefaulticon-072eb617d545|isDefaultIcon]] | Method | Whether the default icon is showing |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-onenabledchange-4a27d17c2360|onEnabledChange]] | Method | fn(enabled) is called whenever the model goes from no section to at least one section plane or box, or back |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-onplaneschange-941472ea13d4|onPlanesChange]] | Method | fn is called whenever the list of getPlanes changes: a plane started or put back, removed, renamed, hidden or shown (SectionPlane.setVisible), a box started.… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-seticon-cae8bce809b1|setIcon]] | Method | Replace the drag icon every section plane shows, including planes already on screen. Pass SVG markup of a single-colour filled glyph; any viewBox works (it i… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-setstate-2ea70e309769|setState]] | Method | Cuts the model exactly as `state` says: every plane and box is disabled first, then the box or the planes of the state are started again, each plane in its s… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startaabbplane-1e6d9a6cbc09|startAabbPlane]] | Method | The standard plane the slot of an index (0..5) used to hold: top, bottom, left, right, front, back |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startbackplane-873b7ff5acd5|startBackPlane]] | Method | startStandardPlane("back") |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startbottomplane-50b61c98fe6c|startBottomPlane]] | Method | startStandardPlane("bottom") |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startfacetouchoff-1759954bf793|startFaceTouchOff]] | Method | Arm the face widget: the next click on a surface places a new section plane there and drags it (Sections › Face in BIM.works). getSectionPlaneWidget().deacti… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startfrontplane-f293b4861cf2|startFrontPlane]] | Method | startStandardPlane("front") |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startleftplane-d294d4d2d745|startLeftPlane]] | Method | startStandardPlane("left") |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startplaneat-9660bdc7f957|startPlaneAt]] | Method | Start a new SectionPlane through a point, cutting away everything on the side the normal points to. Given a PickResult it starts a plane on the picked face, … |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startplanewithcoordinateandnormal-4ad94a55f79a|startPlaneWithCoordinateAndNormal]] | Method | Starts a plane in the slot of an index (0..5) through a point with a normal, in place of what cuts in that slot; `obb` (from Viewer3d.getObjectsObb) limits i… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startrightplane-2033c0554125|startRightPlane]] | Method | startStandardPlane("right") |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startsectionbox-d7556ea7dd5b|startSectionBox]] | Method | Start a SectionBox based on the axis aligned bounding box of all loaded models combined. Starting a SectionBox will clear all other section planes: its six f… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startsectionboxfromobb-056f3d85ffa3|startSectionBoxFromObb]] | Method | Starts a section box around a box from Viewer3d.getObjectsObb, or around the models' box without one; its faces as those of startSectionBox |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-startstandardplane-abf21ac76703|startStandardPlane]] | Method | Start a standard plane on a face of the oriented box around the loaded models, named after it ("Top", ...). When that standard plane cuts already, it goes ba… |
| [[page:reference/javascript/bimworks-viewer3d/sectionplanes-d98171ea#member-starttopplane-ede9e3167ef7|startTopPlane]] | Method | startStandardPlane("top"): a plane on the top of the oriented box around all loaded models combined |

## `constructor` {#member-constructor-5ba5551fc280}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
constructor()
````



## `annotationDefaults` {#member-annotationdefaults-e7017756421e}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
annotationDefaults(): Readonly<SectionPlaneAnnotationDefaults>
````



## `annotationDefaults` {#member-annotationdefaults-20e3dc89e209}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
annotationDefaults(defaults: Partial<SectionPlaneAnnotationDefaults>): void
````

The annotation mode and reach every newly started plane or box begins with: the starters, startPlaneAt(),
Ctrl + drag and the face widget, startSectionBox(). For the planes a user draws, which no code gets to
set afterwards. Setting it leaves the planes already started alone; a field left out keeps its current
value. Starts from the realtime settings sectionPlaneAnnotationMode and sectionPlaneAnnotationReach,
{mode: "hide", reach: Infinity} without them.

### Parameters

| Name | Type | Description |
|---|---|---|
| `defaults` | `Partial<SectionPlaneAnnotationDefaults>` |  |

### Exceptions

- Error for an unknown mode or an invalid reach (`SectionPlane.setAnnotationReach`)

## `capStyles` {#member-capstyles-be20470d4985}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
capStyles(): boolean
````



## `capStyles` {#member-capstyles-e11bb54d629e}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
capStyles(capStyles: boolean): void
````

Whether the end caps draw each object's cap style (`Viewer3d.setCapStyles`: a pattern per kind of
material at a spacing fixed on screen) with cut outlines around the caps and between their objects: the
realtime setting `experimentalCapStyles`, switched while the viewer runs. Starts from that setting, false
without it. With `objectEndcaps` the patterns lie over the objects' colours. Viewer3D draws only its uniform hatch

### Parameters

| Name | Type | Description |
|---|---|---|
| `capStyles` | `boolean` |  |

## `endcaps` {#member-endcaps-be7a70a9f37a}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
endcaps(): boolean
````



## `endcaps` {#member-endcaps-85356eef44b6}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
endcaps(endcaps: boolean): void
````

Whether the cut surfaces are closed with end caps

### Parameters

| Name | Type | Description |
|---|---|---|
| `endcaps` | `boolean` |  |

## `hatching` {#member-hatching-3df00f8732a3}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
hatching(): boolean
````



## `hatching` {#member-hatching-e89a06fe672b}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
hatching(hatching: boolean): void
````

Enabled/disable hatching of section plane end-caps

### Parameters

| Name | Type | Description |
|---|---|---|
| `hatching` | `boolean` |  |

## `iconOrientation` {#member-iconorientation-13bfbb9db8fe}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
iconOrientation(): SectionPlaneIconOrientation
````



## `iconOrientation` {#member-iconorientation-c342e8a7dcb2}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
iconOrientation(orientation: SectionPlaneIconOrientation): void
````

How the drag icons of the section planes are drawn ([[page:reference/javascript/bimworks-viewer3d/sectionplaneiconorientation-34d186fa|SectionPlaneIconOrientation]]): facing the screen
("billboard", the default) or lying in their planes ("plane"), so each icon shows which way its plane faces.
Applies to the planes already on screen too. Throws on another value. Viewer3D keeps the value but draws
billboards either way

### Parameters

| Name | Type | Description |
|---|---|---|
| `orientation` | [[page:reference/javascript/bimworks-viewer3d/sectionplaneiconorientation-34d186fa|SectionPlaneIconOrientation]] |  |

## `objectEndcaps` {#member-objectendcaps-99479676e507}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
objectEndcaps(): boolean
````



## `objectEndcaps` {#member-objectendcaps-fe5b4bb5b033}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
objectEndcaps(objectEndcaps: boolean): void
````

Whether the end caps take the colours of the objects they cut (with their hover and selection tints), and a
pick on a cap finds that object at the point on the cut: the realtime setting `experimentalObjectEndcaps`,
switched while the viewer runs. Starts from that setting, false without it

### Parameters

| Name | Type | Description |
|---|---|---|
| `objectEndcaps` | `boolean` |  |

## `showArrows` {#member-showarrows-fb3bb4ac55a8}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
showArrows(): boolean
````



## `showArrows` {#member-showarrows-49a12c482570}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
showArrows(showArrows: boolean): void
````

Show or hide the 3D arrows of the section planes: an arrow on each plane, pointing to the side it cuts away,
that keeps its size on screen. Dragging an arrow moves its plane along its normal, as dragging its icon does.
A plane that is hidden (`SectionPlane.setVisible`) shows no arrow either way. Starts false

### Parameters

| Name | Type | Description |
|---|---|---|
| `showArrows` | `boolean` |  |

## `showIcons` {#member-showicons-e5caa4c253b8}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
showIcons(): boolean
````



## `showIcons` {#member-showicons-b52376aa4abd}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
showIcons(showIcons: boolean): void
````

Show or hide the drag icons of the section planes. A plane that is hidden (`SectionPlane.setVisible`)
shows no icon either way

### Parameters

| Name | Type | Description |
|---|---|---|
| `showIcons` | `boolean` |  |

## `canStartPlane` {#member-canstartplane-4b3b36795e8c}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
canStartPlane(normal?: vec3): boolean
````

Whether another plane fits: false while all six slots cut, as they do with a section box. The face widget and
Ctrl + left drag then start nothing; `startPlaneAt` and `startStandardPlane` still replace the plane
that cuts with their normal, and a standard plane that cuts already can still be put back.

### Parameters

| Name | Type | Description |
|---|---|---|
| `normal` | [[page:reference/javascript/bimworks-viewercommon/vec3-d8edaba2|vec3]] | Whether a plane with this normal fits: also while all six cut, when one of them cuts with this        normal (within 1°), as the new plane then takes its slot. Need not be unit length |

## `disableAll` {#member-disableall-6f4528243178}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
disableAll(): void
````

Disable all the active section planes, this removed the actual section plane cutting, and the visualisations of the planes

## `get` {#member-get-34fcfb52a3d9}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
get(index: number): SectionPlane
````

The plane in a slot (0..5) of the six section-plane slots, whether it cuts or not. Which slot a plane takes
depends on what cut before; `getPlanes` lists the planes that cut

### Parameters

| Name | Type | Description |
|---|---|---|
| `index` | `number` |  |

## `getIcon` {#member-geticon-06a624e92ac7}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
getIcon(): string
````

The icon markup as last passed to `setIcon`, or [[page:reference/javascript/bimworks-viewer3d/default-section-plane-icon-87b3f8bd|DEFAULT_SECTION_PLANE_ICON]]

## `getPlanes` {#member-getplanes-45cbd623ea92}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
getPlanes(): (SectionPlane)[]
````

The planes that cut the model now, oldest first: single planes and the faces of a box alike. A new array; the
planes in it are live, and stop cutting when disabled (`SectionPlane.disable`). For a list a user interface
shows, kept current with `onPlanesChange`.

## `getSectionPlaneWidget` {#member-getsectionplanewidget-ef9e58cf7d9e}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
getSectionPlaneWidget(): SectionPlaneWidget
````

The widget that previews a section plane on the face under the cursor, armed by startFaceTouchOff or while Ctrl is
held. With Ctrl held over an object it shows where a new plane goes, over a section plane where no object is that
plane is grabbed instead; a plane's icon grabs it anywhere.

## `getState` {#member-getstate-6adfe6c353bf}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
getState(): SectionPlanesState
````

How the planes and the box cut the model now, as a value to give back to `setState` later: a tool
that cuts the model for a while (the clash view's section box) saves the user's own planes this way and
restores them when it is done. Render frame, mm. A box from `startSectionBox` is `box`, with
`planes` empty; anything else (single planes, or the six planes of a box from `startSectionBoxFromObb`)
is the enabled planes.

### Returns

A new value: changing it changes nothing, and later changes to the planes do not show in it

## `isDefaultIcon` {#member-isdefaulticon-072eb617d545}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
isDefaultIcon(): boolean
````

Whether the default icon is showing

## `onEnabledChange` {#member-onenabledchange-4a27d17c2360}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
onEnabledChange(fn: (enabled: boolean) => void): () => void
````

fn(enabled) is called whenever the model goes from no section to at least one section plane or box, or back

### Parameters

| Name | Type | Description |
|---|---|---|
| `fn` | `(enabled: boolean) => void` |  |

### Returns

A function that unsubscribes

## `onPlanesChange` {#member-onplaneschange-941472ea13d4}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
onPlanesChange(fn: () => void): () => void
````

fn is called whenever the list of `getPlanes` changes: a plane started or put back, removed, renamed,
hidden or shown (`SectionPlane.setVisible`), a box started. Not while a plane is dragged.

### Parameters

| Name | Type | Description |
|---|---|---|
| `fn` | `() => void` |  |

### Returns

A function that unsubscribes

## `setIcon` {#member-seticon-cae8bce809b1}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
setIcon(svg: string | null): void
````

Replace the drag icon every section plane shows, including planes already on screen.
Pass SVG markup of a single-colour filled glyph; any viewBox works (it is scaled to fit
and centred), and its own colours are replaced by the icon colour (white on the section
plane blue), so a stroke-only drawing with fill="none" will be filled in. Scripts and
event-handler attributes are removed. Pass null to restore the default icon
([[page:reference/javascript/bimworks-viewer3d/default-section-plane-icon-87b3f8bd|DEFAULT_SECTION_PLANE_ICON]]).

### Parameters

| Name | Type | Description |
|---|---|---|
| `svg` | `string \| null` |  |

### Exceptions

- Error when the markup is not well-formed SVG or draws nothing; the current icon stays

## `setState` {#member-setstate-2ea70e309769}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
setState(state: SectionPlanesState): void
````

Cuts the model exactly as `state` says: every plane and box is disabled first, then the box or the planes of
the state are started again, each plane in its slot with its widget sized to the loaded models, with the
annotation mode new planes start with, its name and standard plane, drawn or hidden, in the order of the state.
A plane without a name gets a new plane's name, one without `visible` is drawn. A state without planes and box
only disables. Of planes with the same normal (within 1°) only the one that cuts furthest is started, in its
slot: it cuts away all the others did. setState(getState()) changes nothing visible.

### Parameters

| Name | Type | Description |
|---|---|---|
| `state` | [[page:reference/javascript/bimworks-viewer3d/sectionplanesstate-ced8c42f|SectionPlanesState]] |  |

### Exceptions

- Error when a plane's index is not 0..5, or a coordinate, normal or box corner is not three finite
numbers, or a normal is zero, or a name is not a string with more than white space, or a standard plane is not
a [[page:reference/javascript/bimworks-viewer3d/standardsectionplane-cb911520|StandardSectionPlane]], or `visible` is not a boolean, or a box's `hidden` is not an array of
[[page:reference/javascript/bimworks-viewer3d/standardsectionplane-cb911520|StandardSectionPlane]]; nothing is changed then

## `startAabbPlane` {#member-startaabbplane-1e6d9a6cbc09}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startAabbPlane(index: number): void
````

```warning
Deprecated: `startStandardPlane`, which also returns the plane; the plane no longer goes into that slot
```

The standard plane the slot of an index (0..5) used to hold: top, bottom, left, right, front, back

### Parameters

| Name | Type | Description |
|---|---|---|
| `index` | `number` |  |

## `startBackPlane` {#member-startbackplane-873b7ff5acd5}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startBackPlane(): SectionPlane | null
````

startStandardPlane("back")

### Returns

The SectionPlane, or null when no model is loaded or no plane fits

## `startBottomPlane` {#member-startbottomplane-50b61c98fe6c}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startBottomPlane(): SectionPlane | null
````

startStandardPlane("bottom")

### Returns

The SectionPlane, or null when no model is loaded or no plane fits

## `startFaceTouchOff` {#member-startfacetouchoff-1759954bf793}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startFaceTouchOff(): void
````

Arm the face widget: the next click on a surface places a new section plane there and drags it (Sections › Face in
BIM.works). getSectionPlaneWidget().deactivate() disarms it without placing one. Does nothing while no plane fits
(`canStartPlane`).

## `startFrontPlane` {#member-startfrontplane-f293b4861cf2}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startFrontPlane(): SectionPlane | null
````

startStandardPlane("front")

### Returns

The SectionPlane, or null when no model is loaded or no plane fits

## `startLeftPlane` {#member-startleftplane-d294d4d2d745}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startLeftPlane(): SectionPlane | null
````

startStandardPlane("left")

### Returns

The SectionPlane, or null when no model is loaded or no plane fits

## `startPlaneAt` {#member-startplaneat-9660bdc7f957}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startPlaneAt(coordinate: vec3, normal: vec3): SectionPlane | null
````

Start a new SectionPlane through a point, cutting away everything on the side the normal points to.
Given a [[page:reference/javascript/bimworks-viewer3d/pickresult-d5fb81c7|PickResult]] it starts a plane on the picked face, which is what the "Section plane"
entry of the BIM.works context menu does: a picked normal faces the camera, so the plane cuts
away what lies on the camera's side of the face. The user then drags the plane by its icon.

Every call starts a new plane, as Ctrl + left drag and the face widget do, named "Plane 1", "Plane 2" and so on
(the lowest number no other plane has; `SectionPlane.setName` renames it). It replaces the plane that cuts
with the same normal (within 1°), a standard plane too, taking its slot; else it takes the next free slot. The
other planes stay. The drawn plane is sized to the main bounds of the loaded models.

### Parameters

| Name | Type | Description |
|---|---|---|
| `coordinate` | [[page:reference/javascript/bimworks-viewercommon/vec3-d8edaba2|vec3]] | A point on the plane in render space (millimetres, globalBaseTranslation included), as [[page:reference/javascript/bimworks-viewer3d/pickresult-d5fb81c7#member-coordinate-63c43a845972|PickResult.coordinate]] |
| `normal` | [[page:reference/javascript/bimworks-viewercommon/vec3-d8edaba2|vec3]] | Points to the side that is cut away; need not be unit length. As [[page:reference/javascript/bimworks-viewer3d/pickresult-d5fb81c7#member-normal-aa1069073a0e|PickResult.normal]] |

### Returns

The SectionPlane, or null when no model is loaded or no plane fits (`canStartPlane` with this normal)

### Exceptions

- Error when the normal is zero or not finite

### Example

A context menu with a "Section plane" entry for the face that was right-clicked, the same
behaviour as the BIM.works app. `showMenu(x, y, items)` stands for your own menu component.
```js
const viewer = new Viewer3d(objectStateManager, undefined, {
    // Called on the canvas' contextmenu event, after the viewer picked what is under the pointer
    rightMouseClick: (event, qid, pick) => {
        if (qid == null) {
            return; // the BIM.works app only opens its menu over an object
        }
        showMenu(event.clientX, event.clientY, [{
            label: "Section plane",
            // A pick without a surface (no normal) cannot place a plane, and none fits while all six cut with other normals
            enabled: pick.normal != null && viewer.getSectionPlanes().canStartPlane(pick.normal),
            action: () => {
                viewer.getSectionPlanes().startPlaneAt(pick.coordinate, pick.normal);
                // Optional: the BIM.works app also clears the selection
                objectStateManager.setToSelectionSet([]);
            }
        }]);
    }
});
await viewer.initializeViewer();
```

## `startPlaneWithCoordinateAndNormal` {#member-startplanewithcoordinateandnormal-4ad94a55f79a}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startPlaneWithCoordinateAndNormal(index: number, coordinate: vec3, normal: vec3, obb?: Obb | null): SectionPlane
````

Starts a plane in the slot of an index (0..5) through a point with a normal, in place of what cuts in that slot;
`obb` (from `Viewer3d.getObjectsObb`) limits its widget to that box, the models' box without one. The plane
is named as `startPlaneAt` names one. Another plane that cuts with the same normal (within 1°) is removed.
Prefer `startPlaneAt`, which takes a free slot or that of the plane with the same normal, and leaves the
user's other planes alone; an active box loses the coupling of its faces

### Parameters

| Name | Type | Description |
|---|---|---|
| `index` | `number` |  |
| `coordinate` | [[page:reference/javascript/bimworks-viewercommon/vec3-d8edaba2|vec3]] |  |
| `normal` | [[page:reference/javascript/bimworks-viewercommon/vec3-d8edaba2|vec3]] |  |
| `obb` | `Obb \| null` |  |

## `startRightPlane` {#member-startrightplane-2033c0554125}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startRightPlane(): SectionPlane | null
````

startStandardPlane("right")

### Returns

The SectionPlane, or null when no model is loaded or no plane fits

## `startSectionBox` {#member-startsectionbox-d7556ea7dd5b}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startSectionBox(boundingBox?: AxisAlignedBoundingBox3D | { max: vec3; min: vec3 }, options?: { padding?: number }): SectionBox
````

Start a SectionBox based on the axis aligned bounding box of all loaded models combined. Starting a SectionBox will clear all other section planes:
its six faces take the six slots, and `getPlanes` lists them by the names of the standard planes they are ("Top", "Bottom", "Left",
"Right", "Front", "Back"). Dragging a face resizes the box. Once a face is removed (`SectionPlane.disable`) or put back
(`startStandardPlane`), the other faces stay where they are as planes of their own, and the box is no longer active.

### Parameters

| Name | Type | Description |
|---|---|---|
| `boundingBox` | `AxisAlignedBoundingBox3D \| { max: vec3; min: vec3 }` | An optional box (render space) around which the section box should initially be drawn, a box or a value        such as `Viewer3d.getObjectsAabb` returns. When this is not provided, the main bounds of the loaded models will be used. |
| `options` | `{ padding?: number }` | padding: grow the box by this many mm on every side (0 when absent), so a box around an        object or a clash keeps some context around it |

### Returns

The SectionBox

### Exceptions

- Error for a negative or non-finite padding

## `startSectionBoxFromObb` {#member-startsectionboxfromobb-056f3d85ffa3}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startSectionBoxFromObb(obb?: Obb | null): SectionBox
````

Starts a section box around a box from `Viewer3d.getObjectsObb`, or around the models' box without one; its faces as those of `startSectionBox`

### Parameters

| Name | Type | Description |
|---|---|---|
| `obb` | `Obb \| null` |  |

## `startStandardPlane` {#member-startstandardplane-abf21ac76703}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startStandardPlane(side: StandardSectionPlane, options?: { coordinate?: vec3; obb?: Obb | null }): SectionPlane | null
````

Start a standard plane on a face of the oriented box around the loaded models, named after it ("Top", ...).
When that standard plane cuts already, it goes back to its place on the face instead, keeping its name, its
place in `getPlanes` and whether it is drawn (`SectionPlane.setVisible`); otherwise it is a new
plane, which replaces the plane that cuts with the face's normal (within 1°), taking its slot, or else takes
the next free slot. When a [[page:reference/javascript/bimworks-viewer3d/sectionbox-fa498f20|SectionBox]] is active
this puts that face of the box back (the box's faces are the six standard planes), and its other faces stay, as
planes of their own.

### Parameters

| Name | Type | Description |
|---|---|---|
| `side` | [[page:reference/javascript/bimworks-viewer3d/standardsectionplane-cb911520|StandardSectionPlane]] |  |
| `options` | `{ coordinate?: vec3; obb?: Obb \| null }` | coordinate: a point the plane goes through instead of the face's centre, the normal staying that of        the face (a top plane at a storey's elevation); obb: the box the drawn plane is sized to, from        `Viewer3d.getObjectsObb`, the models' box without one |

### Returns

The SectionPlane, or null when no model is loaded or no plane fits (`canStartPlane`)

### Exceptions

- Error for a side that is not a [[page:reference/javascript/bimworks-viewer3d/standardsectionplane-cb911520|StandardSectionPlane]]

## `startTopPlane` {#member-starttopplane-ede9e3167ef7}

````typescript sdk=js sdk-namespace="@bimworks/viewer3d"
startTopPlane(): SectionPlane | null
````

startStandardPlane("top"): a plane on the top of the oriented box around all loaded models combined

### Returns

The SectionPlane, or null when no model is loaded or no plane fits
