Skip to content

Interface: ExtrusionPrimitive ​

Experimental

See the module comment.

Implements ​

Properties ​

PropertyModifierTypeDescription
objectreadonlyGroup<Object3DEventMap>Experimental Root object to add to a viewport's scene.

Accessors ​

data ​

Get Signature ​

ts
get data(): Readonly<ExtrusionData>;

Experimental

The resolved data.

Returns ​

Readonly<ExtrusionData>


maxDepth ​

Get Signature ​

ts
get maxDepth(): number;

Experimental

The largest depth drawn (px).

Returns ​

number


mesh ​

Get Signature ​

ts
get mesh(): MeshPrimitive;

Experimental

The mesh primitive drawing the prisms (tests, shader access).

Returns ​

MeshPrimitive

Methods ​

dispose() ​

ts
dispose(): void;

Experimental

Release GPU resources. The primitive must not be used afterwards.

Returns ​

void

Implementation of ​

ts
Primitive.dispose;

raycast() ​

ts
raycast(origin, direction): ExtrusionHit | undefined;

Experimental

The nearest extruded shape a world-space ray (origin + t · direction, t ≥ 0) hits, inside the clip box: its box for rects, its outline's bounding box for other shapes. The hit point is moved just inside the shape's footprint, so the flat shape under it contains it.

Parameters ​

ParameterType
originVector3
directionVector3

Returns ​

ExtrusionHit | undefined


setTransform() ​

ts
setTransform(transform): void;

Experimental

Set the data → world transform (cheap: uniforms only, no buffer uploads).

Parameters ​

ParameterType
transformDataTransform

Returns ​

void

Implementation of ​

ts
Primitive.setTransform;

setViewport() ​

ts
setViewport(size): void;

Experimental

Update viewport-dependent uniforms (resolution, pixel ratio).

Parameters ​

ParameterType
sizeViewportSize

Returns ​

void

Implementation of ​

ts
Primitive.setViewport;

update() ​

ts
update(patch): void;

Experimental

Replace or patch the primitive's data. Omitted fields keep their previous values.

Parameters ​

ParameterType
patchPartial<ExtrusionData>

Returns ​

void

Implementation of ​

ts
Primitive.update;

Released under the MIT License.