Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Module types/line-primitive

    Line rendering primitive — which fragment model draws a line segment (issue #1352).

    primitive model
    screen-space today's flat quad: perpendicular super-Gaussian profile,
    screen-space width, degenerate end-on
    capsule gaussian-like profile of the 2D point-to-segment distance
    in pixel space: direction-stable near-axial (end-on is a
    radial disc), 2D bisector-cut joins, quad-class cost —
    see _shared/line-capsule.ts for the model + the three
    deliberate exactness relaxations

    capsule is calibrated so the side-on appearance matches screen-space by construction (the Gaussian-equivalent truncation T in _shared/line-capsule.ts relates drawn width to σ), which is what makes a session-wide A/B meaningful.

    A third primitive, volumetric (segment ⊛ isotropic 3D Gaussian, solved per-fragment against the true camera-space segment), shipped behind this toggle during #1352 and was deleted after the capsule flip: the capsule matched or beat it visually — including near-axial, its signature case — at quad-class cost. Its closed-form ray-integral math survives in git history (branch point 1481995d9).

    Unlike lineJoin this is NOT an authorable node attribute: the primitive is a renderer implementation choice, not scene content, and the flip to a new default (#1352) must not leave authored attributes behind. It is selected per session — ?linePrimitive= override, then the Advanced → Line primitive policy setting — with the auto policy additionally sizing the scene once before material build (sceneEffectiveLineLoad) and each node once at material build (resolveLinePrimitiveForNode).

    It lives here, in the layer-neutral types/, rather than in rendering/ because config/url-params.ts must both parse it and install it, and config/ may not import from rendering/ (see .dependency-cruiser.cjs). The override and policy are installed once at startup; the aggregate load is replaced for each scene before any line material is constructed.

    LineNodeLoad
    SceneLineLoadNode
    LinePrimitive
    LinePrimitivePolicy
    DEFAULT_LINE_PRIMITIVE
    LINE_PRIMITIVES
    LINE_PRIMITIVE_POLICIES
    AUTO_QUAD_EFFECTIVE_SEGMENTS
    NOMINAL_VIEWPORT_PX
    MIN_RENDERED_WIDTH_PX
    parseLinePrimitive
    setLinePrimitiveOverride
    setLinePrimitivePolicy
    setSceneLineLoad
    lineNodeLoadFromAttrs
    effectiveSegmentLoad
    sceneEffectiveLineLoad
    resolveLinePrimitive
    resolveLinePrimitiveForNode