G-code Preview — API Reference
    Preparing search index...
    • Map a raycast hit on a toolpath chunk mesh — identified by its hit vertex index — back to the IR segment index (#184, the "click a segment → source line" half). Lines mode has 2 vertices per segment; tube meshes carry a vertexSegment table (vertex → in-chunk segment). Returns null when the mesh isn't a pickable chunk or the index is out of range. Pure — testable without a GL context.

      Parameters

      • mesh:
            | LineSegments<
                BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                Material | Material[],
                Object3DEventMap,
            >
            | Mesh<
                BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                Material | Material[],
                Object3DEventMap,
            >
      • vertexIndex: number

      Returns null | number