← Back to Docs
  • index.html
  • Clayground
  • Clayground.Lab
  • BoardWires3D
  • Clayground 2026.7
  • BoardWires3D QML Type

    Every wire on a Board as one flat instanced line batch, plus the dangling preview. More...

    Import Statement: import Clayground.Lab

    Properties

    Methods

    Detailed Description

    Wires lie flat on the board as one LineBatch3D: that is what buys a flowing animation along them, it stays a single draw call however many wires the board grows, and a line lying on the paper casts no shadow, so the shadow question is simply gone. Two lines per wire when something flows: the ink body and a chevron overlay riding a hair above it, marching at one of flowSteps speeds.

    The board owns the geometry; the domain owns what a wire carries. lineOf is asked once per wire and says how to draw it - the circuit kit colours a hot wire in alarm ink and picks the chevron speed relative to the largest current on the board, so a junction visibly splits.

    BoardWires3D {
        board: board; y: stage.overlayMaxY; clock: clock; solved: root.sim
        lineOf: (w, pts, hovered) => root.wireLine(w, pts, hovered)
    }

    See also Board, LineBatch3D, and LabStage3D.

    Property Documentation

    board : Board


    clock : var


    clock \brief The \l SimClock the flow animation runs on - deterministic, never a wall clock. : var


    flowSteps : int [read-only]


    flowSteps \brief How many chevron speeds there are. : int [read-only]


    lineOf : var

    (wire, points, hovered) -> { color, width, styleId, flow }.

    flow is null for an idle wire, or { reverse, color, width, styleId } for the chevron overlay - reverse draws it the other way round, which is how a negative current points its arrows. flowStyle turns a 0..1 share of the board's maximum into a styleId. The default draws a quiet ink line and never flows.


    lines : var [read-only]

    What the batch draws; rebuilt on every board change, hover, eraser flip and solved.


    previewColor : color


    previewColor \brief The dangling wire's ink. : color


    previewWidth : real


    solved : var

    Bind the domain's solve result here; the lines are rebuilt whenever it changes.


    y : real


    y \brief Height above the board the wires are drawn at (the stage's overlay budget). : real


    Method Documentation

    int flowStyle(real rel)

    Style 0 for no flow, else 1..flowSteps from a 0..1 share of the maximum.


    vector3d midOf(var wire)


    var pathOf(var wire)