Skip to main content

Clipper

A lightweight component to easily create, delete and handle clipping planes. 📕 Tutorial. 📘 API.

Param

the instance of Components used. E.g. SimplePlane.

Extends

Implements

Properties

Type()

Type: (...args) => SimplePlane = SimplePlane

The type of clipping plane to be created. Default is SimplePlane.

Parameters

ParameterType
...argsany

Returns

SimplePlane


config

config: ClipperConfigManager

Configurable.config

Implementation of

Configurable . config


isSetup

isSetup: boolean = false

Configurable.isSetup

Implementation of

Configurable . isSetup


list

list: SimplePlane[] = []

A list of all the clipping planes created by this component.


onAfterCancel

readonly onAfterCancel: Event<unknown>

Event that fires after the user cancels the creation of a clipping plane.


onAfterCreate

readonly onAfterCreate: Event <SimplePlane>

Event that fires after a clipping plane has been created.

Param

The newly created clipping plane.


onAfterDelete

readonly onAfterDelete: Event <SimplePlane>

Event that fires after a clipping plane has been deleted.

Param

The deleted clipping plane.


onAfterDrag

readonly onAfterDrag: Event<void>

Event that fires when the user stops dragging a clipping plane.


onBeforeCancel

readonly onBeforeCancel: Event<unknown>

Event that fires when the user cancels the creation of a clipping plane.


onBeforeCreate

readonly onBeforeCreate: Event<unknown>

Event that fires when the user starts creating a clipping plane.


onBeforeDelete

readonly onBeforeDelete: Event<unknown>

Event that fires when the user starts deleting a clipping plane.


onBeforeDrag

readonly onBeforeDrag: Event<void>

Event that fires when the user starts dragging a clipping plane.


onDisposed

readonly onDisposed: Event<string>

Disposable.onDisposed

Implementation of

Disposable . onDisposed


onSetup

readonly onSetup: Event<unknown>

Configurable.onSetup

Implementation of

Configurable . onSetup


orthogonalY

orthogonalY: boolean = false

Whether to force the clipping plane to be orthogonal in the Y direction (up). This is desirable when clipping a building horizontally and a clipping plane is created in its roof, which might have a slight slope for draining purposes.


toleranceOrthogonalY

toleranceOrthogonalY: number = 0.7

The tolerance that determines whether an almost-horizontal clipping plane will be forced to be orthogonal to the Y direction. orthogonalY has to be true for this to apply.


uuid

static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611"

A unique identifier for the component. This UUID is used to register the component within the Components system.

Accessors

enabled

get enabled(): boolean

Component.enabled

set enabled(state): void

Component.enabled

Parameters

ParameterType
stateboolean

Returns

boolean


material

get material(): MeshBasicMaterial

The material of the clipping plane representation.

set material(material): void

The material of the clipping plane representation.

Parameters

ParameterType
materialMeshBasicMaterial

Returns

MeshBasicMaterial


size

get size(): number

The size of the geometric representation of the clippings planes.

set size(size): void

The size of the geometric representation of the clippings planes.

Parameters

ParameterType
sizenumber

Returns

number


visible

get visible(): boolean

Hideable.visible

set visible(state): void

Hideable.visible

Parameters

ParameterType
stateboolean

Returns

boolean

Methods

create()

create(world): null | SimplePlane

Createable.create

Parameters

ParameterType
worldWorld

Returns

null | SimplePlane

Implementation of

Createable . create


createFromNormalAndCoplanarPoint()

createFromNormalAndCoplanarPoint(world, normal, point): SimplePlane

Creates a plane in a certain place and with a certain orientation, without the need of the mouse.

Parameters

ParameterTypeDescription
worldWorldthe world where this plane should be created.
normalVector3the orientation of the clipping plane.
pointVector3the position of the clipping plane.
navigation.

Returns

SimplePlane


delete()

delete(world, plane?): void

Createable.delete

Parameters

ParameterTypeDescription
worldWorldthe world where the plane to delete is.
plane?SimplePlanethe plane to delete. If undefined, the first plane
found under the cursor will be deleted.

Returns

void

Implementation of

Createable . delete


deleteAll()

deleteAll(types?): void

Deletes all the existing clipping planes.

Parameters

ParameterTypeDescription
types?Set<string>the types of planes to be deleted. If not provided, all planes will be deleted.

Returns

void


dispose()

dispose(): void

Disposable.dispose

Returns

void

Implementation of

Disposable . dispose


isConfigurable()

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns

this is Configurable<any, any>

Inherited from

Component . isConfigurable


isDisposeable()

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

Component . isDisposeable


isHideable()

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

Component . isHideable


isResizeable()

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

Component . isResizeable


isUpdateable()

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

Component . isUpdateable


setup()

setup(config?): void

Configurable.setup

Parameters

ParameterType
config?Partial<ClipperConfig>

Returns

void

Implementation of

Configurable . setup