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

    Class Job

    Represents a complete print job containing paths, layers, and state

    Manages the collection of paths, organizes them into layers and tools, and tracks the current print state

    Index

    Constructors

    • Creates a new Job instance

      Parameters

      • opts: { minLayerThreshold?: number; state?: State } = {}

        Job options

        • OptionalminLayerThreshold?: number

          Minimum layer height threshold (default: LayersIndexer.DEFAULT_TOLERANCE)

        • Optionalstate?: State

          Initial state (default: State.initial)

      Returns Job

    Properties

    boundingBox: BoundingBox = ...
    inprogressPath: Path

    Current in-progress path

    paths: Path[] = []

    All paths in the job

    state: State

    Current print state

    Accessors

    • get extrusions(): Path[]

      Gets all extrusion paths in the job

      Returns Path[]

      Array of extrusion paths

    • get toolPaths(): Path[][]

      Gets paths organized by tool

      Returns Path[][]

      2D array of paths, where each sub-array contains paths for a specific tool

    • get travels(): Path[]

      Gets all travel paths in the job

      Returns Path[]

      Array of travel paths

    Methods

    • Adds a path to the job and indexes it

      Parameters

      • path: Path

        Path to add

      Returns void

    • Finalizes the current in-progress path

      Returns void

      If the in-progress path has vertices, it will be added to the job and the in-progress path reference will be cleared

    • Checks if the job contains planar layers

      Returns boolean

      True if the job contains at least one layer, false otherwise

    • Resumes the last path from the job as the current in-progress path

      Returns void

      Removes the path from all indexes and sets it as the current in-progress path