ClippingPlaneObject - Verge3D User Manual - Soft8Soft
Description: Learn how to use ClippingPlaneObject in your interactive 3D apps made with Verge3D

Object3D →

# ClippingPlaneObject

An object which represents clipping plane.

Clipping in Verge3D is quite complex as you require several objects to render it correctly:

- Instance of ClippingPlaneObject.
- One or many Mesh objects you need to clip.
- Two stencil (front/back) meshes per each clipped mesh. These meshes share the geometry of the original mesh but have the special materials based on MeshBasicMaterial.
- Optional object with planar geometry which represents filled cross-section. Contrary to stencil meshes, this object is parented to ClippingPlaneObject.

Stencil and cross-section objects are marked by the special `.isAuxClippingMesh = true` flag.

## Constructor

### ClippingPlaneObject()

Creates a new ClippingPlaneObject.

## Properties

See the base Object3D class for common properties.

### # .isClippingPlaneObject : Boolean

Read-only flag to check if a given object is of type ClippingPlaneObject.

### # .type : String

Always set to `"ClippingPlaneObject"`, this can be used to find all clipping planes in a scene.

## Methods

See the base Object3D class for common methods.

### # .needsClippingPlane(objToClip : Object3D) → Boolean

objToClip — object to clip.

Checks if the given mesh object should be clipped.

### # .assignToObject(objToClip : Object3D, renderOrder : Float = 0)

- objToClip — object to clip.
- renderOrder — (optional) rendering order assigned on the auxiliary stencil objects.

Assigns clipping parameters and auxiliary stencil meshes on the mesh object.

### # .createCrossSectionPlane(planes : Array, renderOrder : Float = 0)

- planes — array with all clipping planes located on the scene.
- renderOrder — (optional) rendering order assigned on the auxiliary cross-section plane object.

Creates and assigns auxiliary cross-section plane on the ClippingPlaneObject.

### # .cleanupAuxMeshes(objToClip : Object3D = null)

objToClip — (optional) object to clip.

Cleanup auxiliary meshes from `objToClip` or the clipping plane itself if `objToClip=null`.

## Source

For more info on how to obtain the source code of this module see this page.