EdgePaint

← prev index next →

Draws a mesh's edges as a wireframe in a material — the way to reveal an object's structure as clean lines, on its own or laid over a filled surface.

Remarks

This is the edge member of the Paint family: like every paint it applies a material to one part of a node's geometry; here that part is the mesh edges, rendered as a wireframe. Edges composite with the node's surface paints in document order (source-over): an edge paint declared after a surface paint renders above it, one declared before renders below — there is no depth-bias separation, so ordering is how you control which shows on top.

Key attributes. material (inherited from Paint) references the material to draw the wireframe with, by id. show toggles the wireframe on and off (default true), so it can be hidden without removing the paint. Beyond those, the visual result is governed by that material and by paint order relative to the node's other paints.

Related. Its sibling paints cover the other parts of the geometry: sk-surface-paint (filled faces) and sk-stroke-paint (spline strokes); stack several on one node in document order to combine fill and wireframe. The material it applies is a sk-plain-material.

Constructor

constructor(config?: { show?: boolean })

Properties

Config Properties

PropertyTypeDefaultDescriptionDeclared by
show boolean true Gets whether this paint is visible. Paint

Other Properties

PropertyTypeDefaultDescriptionDeclared by
materialanimatable Material Gets the material this paint applies. Paint
noderead-only SceneNode Gets the node this paint is applied to. Paint
paintTargetread-only PaintTarget Gets the paint target. Paint
sceneread-only any Gets the Scene this animatable belongs to, if any. SkenraAnimatable
animationsread-only SkenraAnimation[] Public getter for the animations affecting this target. SkenraAnimatable

Methods

MethodDescriptionDeclared by
animate(firstArg: TypedKeyframe<this>[] | TypedPropertyIndexedKeyframes<this> | Record<string, any> | globalThis.Keyframe[] | globalThis.PropertyIndexedKeyframes | null, secondArg?: number | KeyframeAnimationOptions | globalThis.KeyframeAnimationOptions): SkenraAnimation & Animation Creates a new SkenraAnimation for this target per Web Animations API. SkenraAnimatable
removeAnimation(animation: SkenraAnimation): boolean Removes a specific animation from this object. SkenraAnimatable
constrain(type: K, config: ConstraintConfigMap[K]): ConstraintReturnMap[K] Creates a constraint on this Animatable using a fluent API. SkenraAnimatable

Example

// Create edge paint with default settings
const edgePaint = sphere.addMaterialPaint(material, 'edges');

// Toggle edge visibility
edgePaint.show = false;