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

    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).

new THREE.Color()

currentPath: null | Path

The current Path that is being generated.

null

subPaths: Path[]

Array of Path'ss.

[]

type

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

Sub-classes will update this 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

    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[]

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