weasel API - v0.8.0
    Preparing search index...

    Class PathBuilder

    Fluent builder for PolygonPath; hides the Uint8Array/Float32Array encoding behind move/line/curve/close calls.

    Index

    Constructors

    Methods

    • Cubic bezier to (x, y) with control points (x1, y1) and (x2, y2).

      Parameters

      • x1: number
      • y1: number
      • x2: number
      • y2: number
      • x: number
      • y: number

      Returns this

    • Quadratic bezier to (x, y) with control point (x1, y1).

      Parameters

      • x1: number
      • y1: number
      • x: number
      • y: number

      Returns this

    • Seed a builder with an existing PolygonPath. Useful for extending an in-flight path with another segment (e.g. appending a cubic to the end of a curve in response to a user action) without hand- reaching into the commands / coords typed arrays.

      const next = PathBuilder.fromPath(current).curveTo(...).build();
      

      Parameters

      Returns PathBuilder