G-code Preview — API Reference
    Preparing search index...
    interface OpenedContainer {
        id: "gcode-3mf";
        metadata: ContainerMetadata;
        plates: PlateEntry[];
        openPlate(index: number): StreamLike;
        thumbnailsFor(plate: number): Promise<PlateThumbnails>;
    }
    Index
    id: "gcode-3mf"
    plates: PlateEntry[]
    • The slicer's preview images for one plate (#483): Metadata/plate_N.png, then Metadata/plate_N_small.png, where either exists. top_N.png and pick_N.png are NOT included (pick_ is an object-id colour map, top_ is not the plate preview).

      plate is the index into OpenedContainer.plates — the same value as the parse {plate} option and metadata.plates.parsed — NOT the number N in the file name. A file with plates 1 and 3 has indices 0 and 1, and index 1 reads plate_3.png. An index outside plates returns no images.

      Call this AFTER the plate's G-code has been streamed: the images then draw on whatever is left of the archive-wide expanded-bytes budget, so they can never make the G-code read fail. An image that is too large, over budget, corrupt, or not a PNG is dropped with a warning; this method never throws. Every call returns freshly allocated bytes (safe to transfer).

      Parameters

      • plate: number

      Returns Promise<PlateThumbnails>