Skip to main content

Segment

abstract class Segment 

Extended by

  • CircleSegment
  • LineSegment

Constructors​

constructor​

public new Segment(): Segment

Properties​

points​

abstract readonly public points: Vector2[]

Accessors​

arcLength​

abstract public get arcLength(): number

Methods​

draw​

abstract public drawcontext: CanvasRenderingContext2DPath2Dstart: numberend: numbermove: boolean: CurvePointCurvePoint

Parameters


getPoint​

abstract public getPointdistance: number: CurvePoint

Parameters


toSVGCommands​

abstract public toSVGCommandsstart: numberend: numbermove: boolean: string

Convert this segment to SVG path commands.

Parameters

  • start: number

    Start distance along the segment (0 to arcLength)

  • end: number

    End distance along the segment (0 to arcLength)

  • move: boolean

    Whether to include a moveTo command at the start