Api  measure Module
Index
Classes
Interfaces
Variables
Functions
 add
Unique Points  augment
 bounding
Hexagon  clone
Measure  get
Angled Bounds  get
Extreme Point  get
Far Point  hex
Solution  increase
 is
Angle Equal  is
Arc Concave Towards Point  is
Arc Overlapping  is
Arc Span Overlapping  is
Between  is
Between Arc Angles  is
Between Points  is
Bezier Seed Linear  is
Chain Clockwise  is
Circular  is
Line Overlapping  is
Measurement Overlapping  is
Path Equal  is
Point Array Clockwise  is
Point Distinct  is
Point Equal  is
Point Inside Model  is
Point OnCircle  is
Point OnPath  is
Point OnSlope  is
Slope Equal  is
Slope Parallel  line
Slope  loop
Index  model
Extents  model
Path Length  path
Extents  path
Length  point
Distance  point
OnSlope AtX  serialize
Point  y
AtX
Variables
Private Const graham_scan
Private Const onPathMap
Type declaration

[pathType: string]: function


Parameters

point: IPoint

path: IPath

withinDistance: number

Optional options: IIsPointOnPathOptions
Returns boolean



Private pathAreEqualMap
Private pathExtentsMap
Private pathLengthMap
Type declaration

[pathType: string]: function


Parameters

pathToMeasure: IPath
Returns number



Functions
Private addUniquePoints

Parameters

pointArray: IPoint[]

pointsToAdd: IPoint[]
Returns number

augment

Augment a measurement  add more properties such as center point, height and width.
Parameters

measureToAugment: IMeasure
The measurement to augment.
Returns IMeasureWithCenter
Measurement object with augmented properties.

boundingHexagon

Measures the minimum bounding hexagon surrounding a model. The hexagon is oriented such that the right and left sides are vertical, and the top and bottom are pointed.
Parameters

modelToMeasure: IModel
The model to measure.
Returns IBoundingHex
IBoundingHex object which is a hexagon model, with an additional radius property.

Private cloneMeasure
Private getAngledBounds

Parameters

index: number

modelToMeasure: IModel

rotateModel: number

rotatePaths: number
Returns IAngledBoundary

Private getExtremePoint

Parameters

a: IPoint

b: IPoint

fn: IMathMinMax
Returns IPoint

Private getFarPoint
Private hexSolution

Parameters

lines: IPathLine[]

bounds: IAngledBoundary[]
Returns IHexSolution

increase

Increase a measurement by an additional measurement.
Parameters

baseMeasure: IMeasure
The measurement to increase.

addMeasure: IMeasure
The additional measurement.

Optional augmentBaseMeasure: boolean
Optional flag to call measure.augment on the measurement.
Returns IMeasure
The increased original measurement (for cascading).

isAngleEqual

Find out if two angles are equal.
Parameters

angleA: number
First angle.

angleB: number
Second angle.

Default value accuracy: number = 0.0001
Returns boolean
true if angles are the same, false if they are not

isArcConcaveTowardsPoint
isArcOverlapping
isArcSpanOverlapping
isBetween

Check if a given number is between two given limits.
Parameters

valueInQuestion: number
The number to test.

limitA: number
First limit.

limitB: number
Second limit.

exclusive: boolean
Flag to exclude equaling the limits.
Returns boolean
Boolean true if value is between (or equal to) the limits.

isBetweenArcAngles

Check if a given angle is between an arc's start and end angles.
Parameters

angleInQuestion: number
The angle to test.

arc: IPathArc
Arc to test against.

exclusive: boolean
Flag to exclude equaling the start or end angles.
Returns boolean
Boolean true if angle is between (or equal to) the arc's start and end angles.

isBetweenPoints

Check if a given point is between a line's end points.
Parameters

pointInQuestion: IPoint
The point to test.

line: IPathLine
Line to test against.

exclusive: boolean
Flag to exclude equaling the origin or end points.
Returns boolean
Boolean true if point is between (or equal to) the line's origin and end points.

isBezierSeedLinear

Check if a given bezier seed has all points on the same slope.
Parameters

seed: IPathBezierSeed
The bezier seed to test.

Optional exclusive: boolean
Optional boolean to test only within the boundary of the endpoints.
Returns boolean
Boolean true if bezier seed has control points on the line slope and between the line endpoints.

isChainClockwise

Check for flow of paths in a chain being clockwise or not.
Parameters

chainContext: IChain
The chain to test.

Optional out_result: object
Optional output object, if provided, will be populated with convex hull results.

Optional hull
Points?: IPoint[] 
Optional key
Points?: IPoint[]

Returns boolean
Boolean true if paths in the chain flow clockwise.

Private isCircular

Parameters

bounds: IAngledBoundary[]
Returns boolean

isLineOverlapping
isMeasurementOverlapping
isPathEqual
isPointArrayClockwise

Check for array of points being clockwise or not.
Parameters

points: IPoint[]
The array of points to test.

Optional out_result: object
Optional output object, if provided, will be populated with convex hull results.

Optional hull
Points?: IPoint[] 
Optional key
Points?: IPoint[]

Returns boolean
Boolean true if points flow clockwise.

isPointDistinct

Find out if a point is distinct among an array of points.
Parameters

pointToCheck: IPoint
point to check.

pointArray: IPoint[]
array of points.

Optional withinDistance: number
Optional distance to consider points equal.
Returns boolean
false if point is equal to any point in the array.

isPointEqual
isPointInsideModel

Check to see if a point is inside of a model.
Parameters

pointToCheck: IPoint
The point to check.

modelContext: IModel
The model to check against.

Default value options: IMeasurePointInsideOptions = {}
Optional IMeasurePointInsideOptions object.
Returns boolean
Boolean true if the path is inside of the modelContext.

isPointOnCircle

Find out if point is on a circle.
Parameters

p: IPoint
Point to check.

circle: IPathCircle
Circle.

Default value withinDistance: number = 0
Optional distance of tolerance.
Returns boolean
true if point is on the circle

isPointOnPath

Find out if a point lies on a path.
Parameters

pointToCheck: IPoint
point to check.

onPath: IPath
path to check against.

Default value withinDistance: number = 0
Optional distance to consider point on the path.

Optional pathOffset: IPoint
Optional offset of path from [0, 0].

Optional options: IIsPointOnPathOptions
Optional IIsPointOnPathOptions to cache computation.
Returns boolean

isPointOnSlope
isSlopeEqual
isSlopeParallel
lineSlope
Private loopIndex

Parameters

base: number

i: number
Returns number

modelExtents

Measures the smallest rectangle which contains a model.
Parameters

modelToMeasure: IModel
The model to measure.

Optional atlas: Atlas
Optional atlas to save measurements.
Returns IMeasureWithCenter
object with low and high points.

modelPathLength

Measures the length of all paths in a model.
Parameters

modelToMeasure: IModel
The model containing paths to measure.
Returns number
Length of all paths in the model.

pathExtents
pathLength

Measures the length of a path.
Parameters

pathToMeasure: IPath
The path to measure.
Returns number
Length of the path.

pointDistance
Private pointOnSlopeAtX
Private serializePoint

Parameters

p: number[]
Returns string

Private yAtX

Parameters

slope: ISlope

x: number
Returns number

Generated using TypeDoc