gcode-preview - v3.0.0-alpha.5
    Preparing search index...

    Abstract base class for slicer-specific metadata parsers

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    identificationPatterns: RegExp[] = ...

    Patterns that identify this slicer in gcode comments

    slicerName: "Slic3r" = 'Slic3r'

    The name of the slicer this parser handles

    Methods

    • Whether the moves of this gcode can be trusted to derive per-path extrusion dimensions from

      Parameters

      • commentCommands: GCodeCommand[]

        Array of gcode commands with comments

      Returns boolean

      True unless the dialect's E values are not filament lengths

      Deriving is the default, for every dialect and for gcode no parser recognised: a file that announces its dimensions simply outranks the derived values path by path (the Job resolves that order), so there is nothing to gate on. A dialect only opts out when the arithmetic itself does not hold -- Cura's UltiGCode flavor, whose E is cubic millimetres of material rather than millimetres of filament, would otherwise derive confidently wrong widths. Evaluated on the chunk that identified the slicer (like detectSlicerName), so it can inspect header comments.

    • Reads the filament diameter announced in header comments, when any

      Parameters

      • commentCommands: GCodeCommand[]

        Array of gcode commands with comments

      Returns number

      The filament diameter in millimeters, or undefined when unknown

      Feeds the volumetric dimension derivation (see derivesExtrusionDimensions), which converts extruded filament lengths into deposited volume. Only header-borne values may be reported here: a diameter that appears after moves (like Cura's end-of-file ;SETTING_3 blob) would reach a one-shot parse before any move executes but a streamed parse only after every move already ran, making the two disagree.