Skip to content

Class: ClipPlaneSet

Defined in: src/utils/ClipPlane.ts:251

Manages multiple clip planes for a surface.

Provides convenience methods for common clipping operations and synchronizes with both CPU and GPU rendering modes.

Constructors

Constructor

ts
new ClipPlaneSet(): ClipPlaneSet;

Defined in: src/utils/ClipPlane.ts:260

Returns

ClipPlaneSet

Properties

x

ts
readonly x: ClipPlane;

Defined in: src/utils/ClipPlane.ts:253

Clip planes indexed by axis


y

ts
readonly y: ClipPlane;

Defined in: src/utils/ClipPlane.ts:254


z

ts
readonly z: ClipPlane;

Defined in: src/utils/ClipPlane.ts:255

Methods

setClipPlane()

ts
setClipPlane(
   axis, 
   distance, 
   enabled?, 
   flip?): this;

Defined in: src/utils/ClipPlane.ts:275

Set a clip plane by axis.

Parameters

axis

ClipAxis

Which axis to clip

distance

number

Distance from origin

enabled?

boolean = true

Whether to enable (default: true)

flip?

boolean = false

Flip clipping direction (default: false)

Returns

this


getClipPlane()

ts
getClipPlane(axis): ClipPlane;

Defined in: src/utils/ClipPlane.ts:290

Get clip plane by axis.

Parameters

axis

ClipAxis

Returns

ClipPlane


enableClipPlane()

ts
enableClipPlane(axis): this;

Defined in: src/utils/ClipPlane.ts:297

Enable a clip plane.

Parameters

axis

ClipAxis

Returns

this


disableClipPlane()

ts
disableClipPlane(axis): this;

Defined in: src/utils/ClipPlane.ts:305

Disable a clip plane.

Parameters

axis

ClipAxis

Returns

this


clearClipPlanes()

ts
clearClipPlanes(): this;

Defined in: src/utils/ClipPlane.ts:313

Disable all clip planes.

Returns

this


getThreePlanes()

ts
getThreePlanes(): Plane[];

Defined in: src/utils/ClipPlane.ts:322

Get all enabled clip planes as Three.js Plane array. For use with material.clippingPlanes.

Returns

Plane[]


getAllPlanes()

ts
getAllPlanes(): ClipPlane[];

Defined in: src/utils/ClipPlane.ts:331

Get all clip planes (enabled and disabled).

Returns

ClipPlane[]


getEnabledPlanes()

ts
getEnabledPlanes(): ClipPlane[];

Defined in: src/utils/ClipPlane.ts:338

Get enabled planes only.

Returns

ClipPlane[]


hasEnabledPlanes()

ts
hasEnabledPlanes(): boolean;

Defined in: src/utils/ClipPlane.ts:345

Check if any clip plane is enabled.

Returns

boolean


toStateJSON()

ts
toStateJSON(): object[];

Defined in: src/utils/ClipPlane.ts:349

Returns

object[]


getShaderUniforms()

ts
getShaderUniforms(): object;

Defined in: src/utils/ClipPlane.ts:356

Get shader uniforms for all three planes.

Returns

object

clipPlaneX
ts
clipPlaneX: object;
clipPlaneX.normal
ts
normal: Vector3;
clipPlaneX.point
ts
point: Vector3;
clipPlaneX.enabled
ts
enabled: boolean;
clipPlaneY
ts
clipPlaneY: object;
clipPlaneY.normal
ts
normal: Vector3;
clipPlaneY.point
ts
point: Vector3;
clipPlaneY.enabled
ts
enabled: boolean;
clipPlaneZ
ts
clipPlaneZ: object;
clipPlaneZ.normal
ts
normal: Vector3;
clipPlaneZ.point
ts
point: Vector3;
clipPlaneZ.enabled
ts
enabled: boolean;

Released under the MIT License.