G-code Preview — API Reference
    Preparing search index...

    Accumulates segments and produces a canonical ToolpathIR.

    The builder accumulates into plain number arrays and converts to typed arrays in ToolpathIRBuilder.finalize. The canonical IR it returns is already the compact, transferable typed-array contract from DD-001; E2 (the worker parser) will additionally write directly into growable typed buffers to avoid the intermediate arrays.

    Index

    Constructors

    Methods

    • Record an M600 color-change boundary (DD-009 D2, #147). Position is absolute; stored origin-relative.

      Parameters

      • c: {
            segIndex: number;
            srcByte: number;
            tool: number;
            x: number;
            y: number;
            z: number;
        }

      Returns void

    • Register an object; returns its 1-based index for use in SegmentInput.object.

      Parameters

      Returns number

    • Record a retraction/unretraction event (DD-009 D1, #148). Position is absolute; stored origin-relative.

      Parameters

      • r: {
            kind: "retract" | "unretract";
            segIndex: number;
            srcByte: number;
            x: number;
            y: number;
            z: number;
        }

      Returns void