Api - measure Namespace
Index
Classes
Functions
- augment
- bounding
Hexagon - 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
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 - model
Extents - model
Path Length - path
Extents - path
Length - point
Distance
Functions
augment
-
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.
-
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.
-
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
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
Generated using TypeDoc
Augment a measurement - add more properties such as center point, height and width.