Skip to main content

Shapes

Index

Constructors

constructor

Methods

publicstaticcreateArrowPolygonPoints

  • createArrowPolygonPoints(bluntPoint: Vertex3, arrowPoint: Vertex3, lineThickness: number, arrowHeadWidth: number, arrowHeadHeight: number): Vertex3[]
  • Creates 7 points which form the contour of an arrow


    Parameters

    • bluntPoint: Vertex3

      The point which forms the blunt end of the arrow

    • arrowPoint: Vertex3

      The point where the arrow will point from

    • lineThickness: number

      How thick the line should be

    • arrowHeadWidth: number

      How far out the arrow wings should be, in relation to the line thickness

    • arrowHeadHeight: number

      How far out the arrow point should project from arrowPoint, in relation to the line thickness

    Returns Vertex3[]

    The 7 contour points which form the arrow

publicstaticcreateCirclePolygonPoints

  • createCirclePolygonPoints(circlePoint: Vertex3, radiusPoint: Vertex3, lineThickness: number, segments: number): Vertex3[]
  • Creates a bunch of points that form the contours in a circle (so no center point is created)


    Parameters

    • circlePoint: Vertex3

      The center of the circle

    • radiusPoint: Vertex3

      An arbitrary point on the plane of the circle, it’s distance from the circlePoint is used as the radius of the circle

    • lineThickness: number

      How thick the line representing the circle should be, a value less than or equal to 0 indicates that the circle should be completely filled

    • segments: number

      How many segments you want around circlePoint

    Returns Vertex3[]

    The points to use to form the contour around the circle

publicstaticcreateLinePolygonPoints

  • createLinePolygonPoints(linePoints: Vertex3[], thickness: number): Vertex3[]
  • Creates points to form the contour of a polygon of a certain thickness that follows a line of points


    Parameters

    • linePoints: Vertex3[]

      The points forming a poly line, they must be in sequence (a -> b -> c)

    • thickness: number

      The distance between the points that form the polygon contour

    Returns Vertex3[]

    The points forming the contour around the poly line

staticlineIntersects

  • lineIntersects(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): null | { seg1: boolean; seg2: boolean; x: number; y: number }
  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • x3: number
    • y3: number
    • x4: number
    • y4: number

    Returns null | { seg1: boolean; seg2: boolean; x: number; y: number }