Reference·JavaScript · @bimworks/viewer3dJavaScript

SectionPlane

Class in @bimworks/viewer3d.

API catalogue · @bimworks/viewer3d · Class

TypeScript#
class SectionPlane

Members#

Member Kind Description
constructor Method
enabled Method Whether the plane currently cuts the model
disable Method Disable this section plane, it removed the visualization of the plane and makes it inactive. Its slot is free for the next plane. On a face of an active Sect…
getAnnotationMode Method
getAnnotationReach Method
getName Method The name a list of the planes shows (SectionPlanes.getPlanes): "Top", "Bottom", ... for a standard plane and a face of a box, "Plane 1", "Plane 2", ... for a…
getStandard Method The standard plane this is: of SectionPlanes.startStandardPlane, or the face of a box it is; null for a plane through a point. A standard plane stays one whe…
isVisible Method Whether the plane is drawn (setVisible); true for a plane just started
setAnnotationMode Method Set what this plane does with the annotations on the side it cuts away, see SectionPlaneAnnotationMode. Every start of a plane (startTopPlane(), startPlaneAt…
setAnnotationReach Method Set how far past this plane, in mm along its normal, its annotation mode reaches: an annotation further on the side the plane cuts away is hidden, whatever t…
setHighlighted Method Show the plane as hovered, as when the pointer is on its icon, or stop showing it so: for a list of the planes whose row the pointer is on. Has no effect on …
setName Method Rename the plane, for a user who tells their planes apart by name; fires SectionPlanes.onPlanesChange
setVisible Method Draw the plane or not, while it keeps cutting: a hidden plane cuts the model and closes the cut with end caps as before, but its face, wireframe, drag icon a…

constructor#

TypeScript#
constructor()

enabled#

TypeScript#
enabled(): boolean

Whether the plane currently cuts the model

disable#

TypeScript#
disable(): void

Disable this section plane, it removed the visualization of the plane and makes it inactive. Its slot is free for the next plane. On a face of an active SectionBox, the box's other faces stay, as planes of their own

getAnnotationMode#

TypeScript#
getAnnotationMode(): SectionPlaneAnnotationMode

Returns#

The current annotation mode of this plane

getAnnotationReach#

TypeScript#
getAnnotationReach(): number

Returns#

The annotation reach of this plane in mm, Infinity for no limit

getName#

TypeScript#
getName(): string

The name a list of the planes shows (SectionPlanes.getPlanes): "Top", "Bottom", ... for a standard plane and a face of a box, "Plane 1", "Plane 2", ... for a plane through a point, or the name setName gave. Every start of a plane in this slot names it anew; a standard plane put back keeps its name

getStandard#

TypeScript#
getStandard(): StandardSectionPlane | null

The standard plane this is: of SectionPlanes.startStandardPlane, or the face of a box it is; null for a plane through a point. A standard plane stays one when it is dragged or renamed

isVisible#

TypeScript#
isVisible(): boolean

Whether the plane is drawn (setVisible); true for a plane just started

setAnnotationMode#

TypeScript#
setAnnotationMode(mode: SectionPlaneAnnotationMode): void

Set what this plane does with the annotations on the side it cuts away, see SectionPlaneAnnotationMode. Every start of a plane (startTopPlane(), startPlaneAt(), Ctrl + drag, ...) begins with the mode of SectionPlanes.annotationDefaults: "hide" by default, the behaviour before this setting existed.

Parameters#

Name Type Description
mode SectionPlaneAnnotationMode

Exceptions#

  • Error for an unknown mode

setAnnotationReach#

TypeScript#
setAnnotationReach(reach: number): void

Set how far past this plane, in mm along its normal, its annotation mode reaches: an annotation further on the side the plane cuts away is hidden, whatever the mode. Measured from the annotation's own position, before a "project" plane moves it. With a top plane in "project" and a reach of one storey height, the storey above lands on the cut and the storeys above that are hidden. The reach follows the plane when it is dragged. Every start of a plane begins with the reach of SectionPlanes.annotationDefaults: no limit by default.

Parameters#

Name Type Description
reach number mm, 0 or more; Infinity for no limit

Exceptions#

  • Error for a negative distance, NaN or a value that is not a number

setHighlighted#

TypeScript#
setHighlighted(highlighted: boolean): void

Show the plane as hovered, as when the pointer is on its icon, or stop showing it so: for a list of the planes whose row the pointer is on. Has no effect on a plane that does not cut or is hidden (setVisible); a plane stops being highlighted when it is disabled or hidden

Parameters#

Name Type Description
highlighted boolean

setName#

TypeScript#
setName(name: string): void

Rename the plane, for a user who tells their planes apart by name; fires SectionPlanes.onPlanesChange

Parameters#

Name Type Description
name string Trimmed; a name another plane has is allowed

Exceptions#

  • Error when the name is not a string, or nothing but white space

setVisible#

TypeScript#
setVisible(visible: boolean): void

Draw the plane or not, while it keeps cutting: a hidden plane cuts the model and closes the cut with end caps as before, but its face, wireframe, drag icon and arrow are not drawn, and it is not hovered, highlighted or grabbed with Ctrl + left drag; it stays in SectionPlanes.getPlanes, and code can still move it. Fires SectionPlanes.onPlanesChange on a plane that cuts. Every start of a plane in this slot draws it again; a standard plane put back (SectionPlanes.startStandardPlane) keeps whether it is drawn, and SectionPlanes.getState keeps it too.

Parameters#

Name Type Description
visible boolean

Exceptions#

  • Error when visible is not a boolean