<sk-spline>

← prev index next →

A spline you place directly in the scene and give any spline-source as its geometry — the general-purpose way to draw a curve when you need a source that the convenience leaves cannot build (GPU, morphing, or a moving node's trail).

Remarks

This is the source-host member of the AbstractSpline family: it is a spline you position, transform and paint like any other, but it owns no geometry of its own — it draws whichever spline-source you give it. The source arrives as the single geometry child (<sk-svg-spline-source>, <sk-points-spline-source>, <sk-morph-spline-source>, <sk-compute-buffer-spline-source>, <sk-custom-wgsl-spline-source>, or <sk-trail-spline-source>); a stroke paint child then renders the resulting curve as a ribbon. Sources compose — a sk-morph-spline-source blends two other sources, recursively.

Key attributes. Like every spline this leaf has no geometry attributes of its own — the curve comes entirely from its spline-source child. What it does carry are the standard node controls: the transform (x/y/z, h/p/b, sx/sy/sz/s) positions and orients the whole curve in the scene, id lets an sk-align-to-spline-constraint reference it by #id, and cast-shadow toggles whether the drawn ribbon casts a shadow.

Related. For the two everyday input modalities, the convenience leaves build the source themselves and expose its parameters as their own attributes: sk-path-spline (SVG path data) and sk-points-spline (control points). This source-hosting spline is the choice when the curve needs a source those leaves cannot produce. The full geometry-provider set is the spline-source family — sk-svg-spline-source, sk-points-spline-source, sk-morph-spline-source, sk-trail-spline-source, and the GPU sources sk-compute-buffer-spline-source / sk-custom-wgsl-spline-source. The base concept is AbstractSpline.

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.
draggable <boolean> false Gets whether this node can be dragged.
xanimatable <number> 0 X position.
yanimatable <number> 0 Y position.
zanimatable <number> 0 Z position.
hanimatable <angle> 0 Heading (Y-axis rotation) in radians.
panimatable <angle> 0 Pitch (X-axis rotation) in radians.
banimatable <angle> 0 Bank (Z-axis rotation) in radians.
quaternionanimatable <quaternion> ({ <number>, <number>, <number>, <number> }) Rotation as quaternion (overrides h, p, b if provided)
sxanimatable <number> 1 X-axis scale factor.
syanimatable <number> 1 Y-axis scale factor.
szanimatable <number> 1 Z-axis scale factor.
s <number> Uniform scale factor for all axes (overrides sx, sy, sz if provided) write-only
overlay <boolean> false Whether this node renders as an overlay with depth-aware translucency.
overlay-occluded-opacity <number> 0.3 Alpha multiplier for overlay fragments occluded by scene geometry.
cast-shadow <boolean> true Whether this spline casts shadows.

Event handler attributes

Standard DOM event-handler content attributes — the value is JavaScript run when the event fires. They behave exactly as on any HTML element.

onclick, ondblclick, onauxclick, oncontextmenu, onpointerdown, onpointerup, onpointermove, onpointercancel, onpointerover, onpointerout, onpointerenter, onpointerleave, ongotpointercapture, onlostpointercapture, onwheel, ondragstart, ondrag, ondragenter, ondragover, ondragleave, ondrop, ondragend

Children

Exactly one *-spline-source child (svg / points / trail / gpu / morph).