Skip to content

Class: ClipPlaneSet ​

Defined in: utils/ClipPlane.ts:277

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: utils/ClipPlane.ts:286

Returns ​

ClipPlaneSet

Properties ​

x ​

ts
readonly x: ClipPlane;

Defined in: utils/ClipPlane.ts:279

Clip planes indexed by axis


y ​

ts
readonly y: ClipPlane;

Defined in: utils/ClipPlane.ts:280


z ​

ts
readonly z: ClipPlane;

Defined in: utils/ClipPlane.ts:281

Methods ​

setClipPlane() ​

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

Defined in: utils/ClipPlane.ts:301

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: utils/ClipPlane.ts:316

Get clip plane by axis.

Parameters ​

axis ​

ClipAxis

Returns ​

ClipPlane


enableClipPlane() ​

ts
enableClipPlane(axis): this;

Defined in: utils/ClipPlane.ts:323

Enable a clip plane.

Parameters ​

axis ​

ClipAxis

Returns ​

this


disableClipPlane() ​

ts
disableClipPlane(axis): this;

Defined in: utils/ClipPlane.ts:331

Disable a clip plane.

Parameters ​

axis ​

ClipAxis

Returns ​

this


clearClipPlanes() ​

ts
clearClipPlanes(): this;

Defined in: utils/ClipPlane.ts:339

Disable all clip planes.

Returns ​

this


getThreePlanes() ​

ts
getThreePlanes(): Plane[];

Defined in: utils/ClipPlane.ts:348

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

Returns ​

Plane[]


getAllPlanes() ​

ts
getAllPlanes(): ClipPlane[];

Defined in: utils/ClipPlane.ts:357

Get all clip planes (enabled and disabled).

Returns ​

ClipPlane[]


getEnabledPlanes() ​

ts
getEnabledPlanes(): ClipPlane[];

Defined in: utils/ClipPlane.ts:364

Get enabled planes only.

Returns ​

ClipPlane[]


hasEnabledPlanes() ​

ts
hasEnabledPlanes(): boolean;

Defined in: utils/ClipPlane.ts:371

Check if any clip plane is enabled.

Returns ​

boolean


toStateJSON() ​

ts
toStateJSON(): object[];

Defined in: utils/ClipPlane.ts:375

Returns ​

object[]


getShaderUniforms() ​

ts
getShaderUniforms(): object;

Defined in: utils/ClipPlane.ts:382

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.