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

    Reactive snapshot of the model viewer, derived from engine events. Immutable — every change replaces it.

    interface ModelPreviewState {
        bounds: ModelBounds | null;
        cameraState: CameraState | null;
        decimationApplied: number;
        error: { code: string; message: string } | null;
        hasPlates: boolean;
        instancedCount: number;
        loading: boolean;
        materials: Confidence;
        objectCount: number;
        placement: ModelPlacement | null;
        placementOffset: PlacementOffset | null;
        plates: { active?: number; list: ModelPlateSummary[] } | null;
        progress: LoadProgress | null;
        ready: boolean;
        rendererSupported: boolean;
    }
    Index
    bounds: ModelBounds | null

    Model bounds, or null before ready.

    cameraState: CameraState | null

    Current camera pose, or null before a source / when unsupported.

    decimationApplied: number

    Every-Nth-triangle decimation applied to fit the LOD budget (1 = none).

    error: { code: string; message: string } | null

    Last error (parse/loader/limit/renderer), or null.

    hasPlates: boolean

    Capability-aware convenience: the source declares plates (build a plate selector).

    instancedCount: number

    Instance placements drawn — > objectCount when geometry was reused ("N copies").

    loading: boolean

    A setSource is in flight (parse → build).

    materials: Confidence

    Material/colour capability tier of the source (honesty model).

    objectCount: number

    Objects in the current source (0 before ready).

    placement: ModelPlacement | null

    How the model's position on the drawn plate is known (DD-032 §4.3): 'known' (a Bambu/Orca project whose parts lie on the bed), 'inferred' (such a project, shifted by whole workspace cells), 'approximated' (anything else: centred on the bed at z = 0), or null — no plate is drawn (no buildVolume, nothing shown, or the render scope spans more than one declared plate).

    placementOffset: PlacementOffset | null

    The presentation offset applied to the model, mm (printer axes), to map authored ↔ drawn; null with no plate. bounds stays authored.

    plates: { active?: number; list: ModelPlateSummary[] } | null

    Declared plate structure when the source declares plates (materials-style capability); else null.

    progress: LoadProgress | null

    Latest staged loading progress (DD-024), or null.

    ready: boolean

    A source has loaded successfully at least once and is currently shown.

    rendererSupported: boolean

    False when WebGL is unavailable — the handle is inert; fall back to a renderModelStill image.