Skip to content
TREN
Atlıhan Harita

LCC for Web User Manual · API Reference

LCCObject::setClipPrism

Chapter 06.25 / 07Manual version v0.6.4English

Sets a polygonal prism clipping region.

Defines a prism volume by extruding a set of coplanar polygon vertices along the face normal direction using offsetMin / offsetMax, and clips the scene accordingly. Supports both convex and concave polygons; self-intersecting polygons are not supported.

Pass undefined or omit the parameter to clear the clipping.

Version Requirement

SDK v0.6.4+

Engine Support

Three.js

API

LCCObject::setClipPrism(param?: LccClipPrismParams): void

Parameters

LccClipPrismParams

ParameterTypeRequiredDefaultDescription
verticesIPoint3[]Yes-Reference plane polygon vertices (world coordinates, coplanar, any winding order). Min 3, max 200.
offsetMaxnumberYes-Upper offset along the face normal direction (can be negative, must be greater than offsetMin).
offsetMinnumberYes-Lower offset along the face normal direction (can be negative, must be less than offsetMax).
normalIPoint3Yes-Normal direction.
clipSidenumberNo1Clipping mode: 1 = keep interior (clip exterior), -1 = keep exterior (clip interior).

IPoint3

interface IPoint3 {
    x: number;
    y: number;
    z: number;
}

Return Value

void

Usage Example

// Set a rectangular prism clipping region (4 coplanar vertices)
lccObject.setClipPrism({
    vertices: [
        { x: 0, y: 0, z: 0 },
        { x: 10, y: 0, z: 0 },
        { x: 10, y: 10, z: 0 },
        { x: 0, y: 10, z: 0 }
    ],
    offsetMin: -5,
    offsetMax: 5,
    normal: { x: 0, y: 0, z: 1 },
    clipSide: 1
});

// Inverse clipping: keep the exterior of the prism
lccObject.setClipPrism({
    vertices: [
        { x: 0, y: 0, z: 0 },
        { x: 10, y: 0, z: 0 },
        { x: 10, y: 10, z: 0 },
        { x: 0, y: 10, z: 0 }
    ],
    offsetMin: -5,
    offsetMax: 5,
    normal: { x: 0, y: 0, z: 1 },
    clipSide: -1
});

// Clear clipping
lccObject.setClipPrism();

Notes

  • Vertices must be coplanar (tolerance: 0.01 world coordinate units). Non-coplanar vertices will cause the call to fail with an error log.
  • The vertex count must be between 3 and 200. Values outside this range will cause the call to fail.
  • offsetMax must be strictly greater than offsetMin; otherwise the call will fail.
  • Adjusting offsetMin / offsetMax / clipSide is a lightweight operation and can be called at high frequency.
  • Modifying polygon vertices triggers an internal texture update, so frequent vertex updates are not recommended.
  • Self-intersecting polygons are not supported; using them will produce unpredictable clipping results.
  • LCCObject::setClipBox() — Axis-aligned bounding box clipping
  • LCCObject::setClipPlane() — Plane clipping

This chapter is from the official XGRIDS user manual. Official source (opens in a new tab) · Updated:

XGRIDS Türkiye

We're With You During Setup and in the Field

Atlıhan Harita provides training and technical support for device setup, firmware updates, software use, and field applications. Send us your question and our specialist will get back to you.

+90 216 546 0804