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

    Interface GCodeParameters

    Parameters for G-code commands used in 3D printing.

    This interface defines the common parameters used in G-code commands for 3D printing. While additional parameters may exist in G-code files, only the parameters listed here are actively used in this library. Other parameters are still parsed and preserved through the index signature.

    const params: GCodeParameters = {
    y: 100, // Move to Y position 100
    z: 0.2, // Set layer height to 0.2
    f: 1200, // Set feed rate to 1200mm/min
    e: 123.45 // Extrude filament
    };
    interface GCodeParameters {
        e?: number;
        f?: number;
        i?: number;
        j?: number;
        r?: number;
        t?: number;
        x?: number;
        y?: number;
        z?: number;
        [key: string]: number;
    }

    Indexable

    • [key: string]: number

      Index signature for additional G-code parameters. Allows parsing and storing of parameters not explicitly defined above.

    Index

    Properties

    Properties

    e?: number

    Extruder position/length in millimeters. Controls the amount of filament to extrude.

    f?: number

    Feed rate (speed) in millimeters per minute. Determines how fast the print head moves.

    i?: number

    X offset from current position to arc center in millimeters. Used in G2/G3 arc movement commands.

    j?: number

    Y offset from current position to arc center in millimeters. Used in G2/G3 arc movement commands.

    r?: number

    Radius of arc in millimeters. Alternative way to specify arc movement in G2/G3 commands.

    t?: number

    Tool number for multi-tool setups. Used to select between different extruders or tools.

    x?: number

    X-axis position in millimeters. Used for positioning the print head along the X axis.

    y?: number

    Y-axis position in millimeters. Used for positioning the print head along the Y axis.

    z?: number

    Z-axis position in millimeters. Typically used for layer height control and vertical positioning.