Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

A class for elliptic sectors.

requires

Line

requires

Vector

requires

VertTuple

requires

Vertex

requires

SVGSerializale

requires

UID

requires

UIDGenerator

Hierarchy

  • VEllipseSector

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

  • Create a new elliptic sector from the given ellipse and two angles.

    Note that the direction from start to end goes clockwise, and that start and end angle will be wrapped to [0,PI*2).

    name

    VEllipseSector

    Parameters

    • ellipse: VEllipse
    • startAngle: number

      The start angle of the sector.

    • endAngle: number

      The end angle of the sector.

    Returns VEllipseSector

Properties

Readonly className

className: string = "VEllipseSector"

Required to generate proper CSS classes and other class related IDs.

ellipse

ellipse: VEllipse
member

{VEllipse}

memberof

VEllipseSector

instance

endAngle

endAngle: number
member

{number}

memberof

VEllipseSector

instance

startAngle

startAngle: number
member

{number}

memberof

VEllipseSector

instance

Readonly uid

uid: UID

The UID of this drawable object.

member

{UID}

memberof

VEllipseSector

instance
readonly

Methods

toCubicBezier

  • toCubicBezier(quarterSegmentCount?: number, threshold?: number): Array<CubicBezierCurve>
  • Convert this elliptic sector into cubic Bézier curves.

    Parameters

    • Optional quarterSegmentCount: number

      The number of segments per base elliptic quarter (default is 3, min is 1).

    • Optional threshold: number

      The Bézier threshold (default value 0.666666 approximates the ellipse with best results but you might wish to use other values)

    Returns Array<CubicBezierCurve>

    An array of cubic Bézier curves representing the elliptic sector.

Object literals

Static ellipseSectorUtils

ellipseSectorUtils: object

describeSVGArc

  • describeSVGArc(x: number, y: number, radiusH: number, radiusV: number, startAngle: number, endAngle: number, rotation?: number, options?: { moveToStart: boolean }): SVGPathParams

endpointToCenterParameters

  • endpointToCenterParameters(x1: number, y1: number, rx: number, ry: number, phi: number, fa: boolean, fs: boolean, x2: number, y2: number): VEllipseSector
  • Convert the elliptic arc from endpoint parameters to center parameters as described in the w3c svg arc implementation note.

    https://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter

    Parameters

    • x1: number

      The x component of the start point (end of last SVG command).

    • y1: number

      The y component of the start point (end of last SVG command).

    • rx: number

      The first (horizontal) radius of the ellipse.

    • ry: number

      The second (vertical) radius of the ellipse.

    • phi: number

      The ellipse's rotational angle (angle of axis rotation) in radians (not in degrees as the SVG command uses!)

    • fa: boolean

      The large-arc-flag (boolean, not 0 or 1).

    • fs: boolean

      The sweep-flag (boolean, not 0 or 1).

    • x2: number

      The x component of the end point (end of last SVG command).

    • y2: number

      The y component of the end point (end of last SVG command).

    Returns VEllipseSector

equidistantVertAngles

  • equidistantVertAngles(radiusH: number, radiusV: number, startAngle: number, endAngle: number, fullEllipsePointCount: number): Array<number>
  • Helper function to find second-kind elliptic angles, so that the euclidean distance along the the elliptic sector is the same for all.

    Note that this is based on the full ellipse calculuation and start and end will be cropped; so the distance from the start angle to the first angle and/or the distance from the last angle to the end angle may be different to the others.

    Furthermore the computation is only possible on un-rotated ellipses; if your source ellipse has a rotation on the plane please 'rotate' the result angles afterwards to find matching angles.

    Returned angles are normalized to the interval [ 0, PI*2 ].

    Parameters

    • radiusH: number

      The first (horizonal) radius of the ellipse.

    • radiusV: number

      The second (vertical) radius of the ellipse.

    • startAngle: number

      The opening angle of your elliptic sector (please use normalized angles).

    • endAngle: number

      The closing angle of your elliptic sector (please use normalized angles).

    • fullEllipsePointCount: number

      The number of base segments to use from the source ellipse (12 or 16 are good numbers).

    Returns Array<number>

    An array of n angles inside startAngle and endAngle (where n <= fullEllipsePointCount).

findClosestToStartAngle

  • findClosestToStartAngle(startAngle: number, endAngle: number, ellipseAngles: Array<number>): number

normalizeAngle

  • normalizeAngle(angle: number): number

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Private property
  • Private method
  • Static property
  • Static method

Generated using TypeDoc