Type Alias Path

Path: {
    kind:
        | "compound"
        | "elliptical"
        | "circular"
        | "arc"
        | "bezier/cubic"
        | "bezier/quadratic"
        | "line";
    bbox(): RectPositioned;
    distanceToPoint(point: Point): number;
    interpolate(t: number): Point;
    length(): number;
    nearest(point: Point): Point;
    relativePosition(point: Point, intersectionThreshold: number): number;
    toString(): string;
    toSvgString(): readonly string[];
}

Type declaration

  • Readonlykind:
        | "compound"
        | "elliptical"
        | "circular"
        | "arc"
        | "bezier/cubic"
        | "bezier/quadratic"
        | "line"

    Well-known path kind

  • bbox:function
  • distanceToPoint:function
    • Distance from start of path to this point. If path is closed (eg. a circle) it may have some arbitary 'start' point

      Parameters

      Returns number

  • interpolate:function
    • Returns a point at a relative (0.0-1.0) position along the path

      Inverse of relativePosition.

      Parameters

      • t: number

        Relative position (0.0-1.0)

      Returns Point

      Point

  • length:function
    • Length of path

      Returns number

  • nearest:function
    • Returns the nearest point on path to point

      Parameters

      Returns Point

  • relativePosition:function
    • Returns relative position of point along path. If pt is same as start, result will be 0, if it's the same as end, it will be 1.

      Inverse of interpolate.

      Parameters

      • point: Point
      • intersectionThreshold: number

      Returns number

  • toString:function
    • Returns a string representation of pth values

      Returns string

  • toSvgString:function
    • Returns an array of SVG segments that can render path

      Returns readonly string[]