Skip to content

Class: LazyFillPrimitive ​

Experimental

A FillPrimitive whose code loads on first use: the same data, updates and transform, and the same drawing once loaded. Until then it keeps the latest data, transform and viewport size and draws nothing; ready resolves once the fill is drawn (at once when the code has already loaded). A failed load resolves ready too (the fill stays undrawn) and is retried by the next update.

object is the fill's mesh from the start: a hidden placeholder that the fill primitive draws into once loaded, so callers can set its renderOrder (or hold it) at any time.

Implements ​

Constructors ​

Constructor ​

ts
new LazyFillPrimitive(context, data): LazyFillPrimitive;

Experimental

Parameters ​

ParameterType
contextPrimitiveContext
dataFillData

Returns ​

LazyFillPrimitive

Properties ​

PropertyModifierTypeDescription
objectreadonlyMeshExperimental Root object to add to a viewport's scene.

Accessors ​

fill ​

Get Signature ​

ts
get fill(): FillPrimitive | null;

Experimental

The underlying fill primitive, once the fill code has loaded (else null).

Returns ​

FillPrimitive | null


ready ​

Get Signature ​

ts
get ready(): Promise<void>;

Experimental

Resolves once the fill is drawn: its code has loaded (or failed to) and it holds the data, and so has the code of its pattern paint, if any (plan E8.10).

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<FillData>

Returns ​

void

Implementation of ​

Primitive.update

Released under the MIT License.