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

    Class Path

    Represents a path in 3D space with associated properties

    Used to store and manipulate G-code path data including vertices, extrusion parameters, and tool information

    Index

    Constructors

    • Creates a new Path instance

      Parameters

      • travelType: PathType

        Type of path movement

      • extrusionWidth: number = 0.6

        Width of extruded material (default: 0.6)

      • lineHeight: number = 0.2

        Height of extruded line (default: 0.2)

      • tool: number = 0

        Tool number (default: 0)

      Returns Path

    Properties

    extrusionWidth: number

    Width of extruded material

    lineHeight: number

    Height of extruded line

    tool: number

    Tool number used for this path

    travelType: PathType

    Type of path movement

    Accessors

    • get vertices(): number[]

      Gets the path's vertices as a flat array of numbers

      Returns number[]

      Array of vertex coordinates in [x,y,z] order

    Methods

    • Adds a new point to the path

      Parameters

      • x: number

        X coordinate

      • y: number

        Y coordinate

      • z: number

        Z coordinate

      Returns void

    • Checks if a point continues the current line

      Parameters

      • x: number

        X coordinate to check

      • y: number

        Y coordinate to check

      • z: number

        Z coordinate to check

      Returns boolean

      True if the point matches the last point in the path

    • Creates a 3D geometry from the path

      Parameters

      • opts: { extrusionWidthOverride?: number; lineHeightOverride?: number } = {}

        Geometry options

        • OptionalextrusionWidthOverride?: number

          Optional override for extrusion width

        • OptionallineHeightOverride?: number

          Optional override for line height

      Returns BufferGeometry

      BufferGeometry representing the path

    • Checks if the path contains any vertical moves

      Returns boolean

      True if any Z coordinates differ from the initial Z

    • Creates a line geometry from the path

      Returns LineSegmentsGeometry

      LineSegmentsGeometry representing the path

    • Converts the path's vertices to an array of Vector3 points

      Returns Vector3[]

      Array of Vector3 points