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

    Class CuraMetadataParser

    Parser for Cura metadata comments

    Cura uses the following layer comment format: ;LAYER:0 ;LAYER:1 ;LAYER:2

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    identificationPatterns: RegExp[] = ...

    Patterns that identify this slicer in gcode comments

    slicerName: "Cura" = 'Cura'

    The name of the slicer this parser handles

    Methods

    • Whether per-path extrusion dimensions should be derived from the moves

      Parameters

      • commentCommands: GCodeCommand[]

        Array of gcode commands with comments

      Returns boolean

      True except for the volumetric UltiGCode flavor

      Cura emits no ;WIDTH: / ;HEIGHT: comments, so dimensions can only be reconstructed from extrusion amounts and Z changes. The UltiGCode flavor (Ultimaker 2 era) is excluded: its E values are cubic millimeters of material rather than millimeters of filament, which the derivation does not model — deriving from them would produce confidently wrong widths.

    • Reads the filament diameter implied by the header flavor

      Parameters

      • commentCommands: GCodeCommand[]

        Array of gcode commands with comments

      Returns number

      2.85 for the Griffin flavor, otherwise undefined

      Cura's own material_diameter setting only appears in the ;SETTING_3 blob at the very end of the file, too late to inform the derivation of the moves that precede it (see the base class remarks). The ;FLAVOR: header line is emitted first instead, and Griffin is only ever generated for Ultimaker's own 2.85 mm machines (UM3 and S-line); every other flavor falls back to the 1.75 mm default downstream.