This class is used to convert a series of shapes to an array of Path's, for example an SVG shape to a path.

Constructors

  • Creates a new ShapePath

    Returns ShapePath

    Remarks

    Unlike a Path, no points are passed in as the ShapePath is designed to be generated after creation.

Properties

color: Color

Color of the shape, by default set to white (0xffffff).

Default Value

new THREE.Color()

currentPath: null | Path

The current Path that is being generated.

Default Value

null

subPaths: Path[]

Array of Path'ss.

Default Value

[]

type: "ShapePath"

A Read-only string to check if this object type.

Remarks

Sub-classes will update this value.

Default Value

ShapePath

Methods

  • This creates a bezier curve from the currentPath's offset to x and y with cp1X, cp1Y and cp2X, cp2Y as control points and updates the currentPath's offset to x and y.

    Parameters

    • aCP1x: number
    • aCP1y: number
    • aCP2x: number
    • aCP2y: number
    • aX: number
    • aY: number

    Returns this

  • This creates a line from the currentPath's offset to X and Y and updates the offset to X and Y.

    Parameters

    • x: number

      Expects a Float

    • y: number

      Expects a Float

    Returns this

  • Starts a new Path and calls Path.moveTo( x, y ) on that Path

    Parameters

    • x: number

      Expects a Float

    • y: number

      Expects a Float

    Returns this

    Remarks

    Also points currentPath to that Path.

  • This creates a quadratic curve from the currentPath's offset to x and y with cpX and cpY as control point and updates the currentPath's offset to x and y.

    Parameters

    • aCPx: number
    • aCPy: number
    • aX: number
    • aY: number

    Returns this

  • Connects a new SplineCurve onto the currentPath.

    Parameters

    Returns this

  • Converts the subPaths array into an array of Shapes

    Parameters

    • isCCW: boolean

      Changes how solids and holes are generated

    Returns external.three.Shape[]

    Remarks

    By default solid shapes are defined clockwise (CW) and holes are defined counterclockwise (CCW) If isCCW is set to true, then those are flipped.