Readonlymode"local" over a Scene, "worker" over a WorkerScene.
ReadonlysceneThe scene, for the renderer adapters (bindMesh, ...).
Adds a mesh (default display) and returns its handle at once.
Optionaloptions: StoreAddMeshOptionsAdds a plane section and returns its handle at once.
The targets of the store-owned field behind the mesh's colouring (the
one last sent to the scene), in the field's order: the order its
nearest-target indices (Scene.fieldNearest,
WorkerScene.fetchFieldNearest) refer to. That is ascending scene id,
not the order of distanceTo or of a contact group's members. A target
removed since leaves the list, as it leaves the field. Frozen; null
when the mesh has no colouring.
Call once per animation frame (instead of the scene's commitFrame()):
applies the frame's declarative changes, then commits the scene's frame
and returns its change records. From the first call on, declarative
changes wait for it instead of applying on a microtask.
Removes the distance fields the store owns (fast-mesh-store:<n>, and
so the colourings by them) and stops listening to the scene. The rest of
the scene is left as it is (it is the app's). On a Worker scene the
removals are queued like any call, and sent with the scene's next
commitFrame(); errors from a scene that can no longer take them (a
poisoned Worker scene, for one) are ignored. Later actions throw
INVALID_ARGUMENT; the last snapshot stays readable.
Starts a drag of a mesh; see the scene's drag(). Ending or cancelling it updates the snapshot.
Edits a mesh's triangles (one undo step).
The values of the store-owned field behind the mesh's colouring (the one
last sent to the scene), one per vertex slot, as of the field's last
update: a copy the caller owns. null when the mesh has no colouring.
On a Worker scene the request is ordered after the calls made before
it, so it reads the colouring last flushed. Never a history step.
Rejects with UNKNOWN_MESH for a mesh not in the store, and
INVALID_ARGUMENT once the store is disposed.
The current snapshot: frozen, replaced (never mutated) on change. It is up to date with the scene's statuses when read: a status change not yet announced refreshes it here, and its listeners are called on a microtask.
Redoes the latest undone step.
Removes a mesh; it leaves the snapshot (and the selection) at once. The
scene drops the fields measured to it alone, and the colourings by them:
a mesh coloured by distance to it alone shows no colouring, keeps its
rule in desired, and is in "error" (UNKNOWN_MESH) from the next
flush until its colouring changes. A colouring measured to it and other
meshes keeps the others (its distanceTo loses the mesh). It leaves its
contact groups, whose members' partners follow. Sections stop cutting it.
Repairs a mesh (one undo step).
Repairs a mesh (one undo step).
Restarts the Worker scene (see WorkerScene.restart()). Rejects with
INVALID_ARGUMENT on a local (synchronous) scene.
Selects a mesh, or nothing with null. UI state only: the scene never sees it.
Sets contact group id, or removes it with null. Every member is
coloured by group.coloring with its partners (the members it is paired
with) as distanceTo, through one field per member measured to all of
its partners: each vertex shows the smallest signed distance over them
(the nearest surface, or the deepest penetration). Moving a member then
recomputes only its own field and those of its partners. A member
without partners shows no colouring.
Members are coloured through setDisplay, so desired and
display show the colourings (groups themselves are not in the
snapshot). Setting the group colours every member, overriding a
colouring the app gave it. A member's later setDisplay colouring
overrides the group's: the group then leaves that member alone when it
shrinks, is removed, or loses a mesh, until it is set again. Members
dropped from the group, or all of them when it is removed, stop being
coloured, and their store-owned fields are removed (not kept for later,
as setDisplay keeps them). A removed mesh leaves its groups (and their
pairs); a member left without partners stops being coloured.
Changes how a mesh is shown. desired changes at once; display follows
at the next commitFrame() (or a microtask without a frame loop). A
patch equal to the current request changes nothing.
A coloring colours the mesh by distance to distanceTo (one mesh or
several) through a field the store owns (one per mesh, named
fast-mesh-store:<n>, kept while colouring is off and replaced only
when the set of meshes in distanceTo, maxDistance or sign
changes). display.coloring is the colouring
last applied: on a Worker scene, once its display: request is ready.
Sets a mesh's placement (one undo step).
Changes a section's plane, meshes or fill. desired changes at once;
the section follows at the next commitFrame() (or a microtask without
a frame loop), each aspect set only when it changed, the last value
per frame winning.
Registers a listener called after each new snapshot; returns the function
that removes it. A listener that throws does not stop the others nor the
action that changed the state (which has taken effect): its error is
reported with reportError (an async rethrow where there is none), as
the Worker scene does with its listeners.
Undoes the latest step.
An observable store over a scene. Read with getSnapshot and subscribe; change through its actions. Call commitFrame once per animation frame instead of the scene's.