<sk-selection>

← prev index next →

Names a subset of a mesh's topology — the faces (triangles), and later edges or points, that authoring surfaces target.

Remarks

A <sk-selection> is a selection: a non-rendered, id-addressable data child of a mesh (a sk-cube, sk-sphere, sk-mesh, …) that names a subset of that mesh's topology, the way USD's GeomSubset names a subset of a mesh's faces. It renders nothing itself; instead a consumer — a sk-surface-paint via its selection attribute (and points-sources in a later slice) — references it to restrict what it paints or samples to exactly those elements. It sits as a child of the mesh it addresses, and resolves against that mesh's element-index space.

Key attributes. selection-type is the kind of element addressed — face (a triangle, the default and the only kind resolved today), edge, or point (the type name is reserved as the element discriminant). A leaf selection lists explicit indices as a range list ("0-1 4 6-7" — inclusive ranges and singletons over the mesh's faces; the empty string is the empty set, not "all"). A composite selection instead composes other selections via include/exclude, optionally filtered by a field above a threshold — these compositional forms are authored here but resolved in later slices. A selection carries a global id (so it is referenceable as #id) and/or a mesh-local name; a #id reference must point at a selection under the SAME mesh.

Related. Its parent is always a mesh (AbstractMeshNode); an unresolved or invalid selection resolves inert (draws/samples nothing) and never falls back to the whole mesh. Out-of-range or malformed indices are diagnosed, not silently clipped.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
name <string> "" The mesh-local registry name for bare-token references.
selection-type <selection-type> ("face" | "edge" | "point") "face" The kind of topology addressed: face (default), edge, or point.
indices <index-range-list> "" Explicit face indices as a range list ("0-1 4 6-7"); the leaf form.
include <selection-token-list> "" Selections/names to union (composite form); absent or empty = all.
exclude <selection-token-list> "" Selections/names to subtract from the base set (composite form).
field <id-ref> "" A field reference (#id) that intersects the base set as a filter. reference by id
threshold <number> 0.5 The field-weight threshold an element must exceed to remain selected.