Skip to content

Class: ArcPrimitive ​

Experimental

Instanced, anti-aliased annular sectors (pie / donut / gauge wedges) in a single draw call. Style-only updates (fill, borderColor, borderWidth) re-upload only that attribute; shape updates (radii, angles, pad, corners) re-upload the shape + bounds; center updates the centers.

Implements ​

Constructors ​

Constructor ​

ts
new ArcPrimitive(ctx, data?): ArcPrimitive;

Experimental

Parameters ​

ParameterType
ctxPrimitiveContext
dataPartial<ArcData>

Returns ​

ArcPrimitive

Properties ​

PropertyModifierTypeDescription
objectreadonlyMeshExperimental The mesh to add to a scene.

Accessors ​

instanceCount ​

Get Signature ​

ts
get instanceCount(): number;

Experimental

Number of wedge instances currently drawn.

Returns ​

number


ready ​

Get Signature ​

ts
get ready(): Promise<void>;

Experimental

Resolves once the pattern (if any) is drawn: its code loads on first use.

Returns ​

Promise<void>

Methods ​

dispose() ​

ts
dispose(): void;

Experimental

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

Returns ​

void

Implementation of ​

Primitive.dispose


setTransform() ​

ts
setTransform(transform): void;

Experimental

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

Parameters ​

ParameterType
transformDataTransform

Returns ​

void

Implementation of ​

Primitive.setTransform


setViewport() ​

ts
setViewport(size): void;

Experimental

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

Parameters ​

ParameterType
sizeViewportSize

Returns ​

void

Implementation of ​

Primitive.setViewport


update() ​

ts
update(patch): void;

Experimental

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

Parameters ​

ParameterType
patchPartial<ArcData>

Returns ​

void

Implementation of ​

Primitive.update

Released under the MIT License.