Members
box
+pc :Point
boxSource:
@@ -370,6 +370,16 @@ boxPoint
+
+
+
+
+
@@ -379,13 +389,13 @@ box
-center
+r :number
- Get center of arc
+ Arc radius
@@ -421,7 +431,7 @@ centerSource:
@@ -434,6 +444,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -443,13 +463,13 @@ center
-counterClockwise :boolean
+startAngle :number
- Arc orientation
+ Arc start angle in radians
@@ -485,7 +505,7 @@ count
Source:
@@ -502,7 +522,7 @@ Type:
-
-
boolean
+number
@@ -517,13 +537,13 @@ Type:
-end
+endAngle :number
- Get end point of arc
+ Arc end angle in radians
@@ -559,7 +579,7 @@ endSource:
@@ -572,6 +592,16 @@ endnumber
+
+
+
+
+
@@ -581,13 +611,13 @@ end
-endAngle :number
+counterClockwise :boolean
- Arc end angle in radians
+ Arc orientation
@@ -623,7 +653,7 @@ endAngleSource:
@@ -640,7 +670,7 @@ Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ Type:
-length
+sweep
- Get arc length
+ Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
@@ -697,7 +727,7 @@ lengthSource:
@@ -719,13 +749,13 @@ length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
@@ -774,16 +804,6 @@ pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
@@ -848,16 +868,6 @@ rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
@@ -931,13 +941,13 @@ start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
- Source:
@@ -986,16 +996,6 @@ startAngle<
- Type:
-
- -
-
-
number
-
-
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
@@ -1078,14 +1078,14 @@ Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
- Source:
@@ -1163,7 +1163,7 @@ Returns:
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
- Source:
@@ -1244,6 +1244,58 @@ chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
@@ -1348,6 +1400,58 @@ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
@@ -1452,56 +1556,108 @@ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 214
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ Returns:
-
-
boolean
+number
@@ -1546,14 +1702,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
- Source:
@@ -1650,7 +1806,7 @@ Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
- -
-
- -
- Type:
-
- -
-
number
-
-
-
-
-
-
-
- distance from arc to shape
-
-
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
-
- shortest segment between arc and shape (started at arc, ended at shape)
-
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
@@ -1830,7 +1962,7 @@ Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from arc to shape
+
+
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
-
+
+ shortest segment between arc and shape (started at arc, ended at shape)
+
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
@@ -1967,7 +2123,7 @@ Returns:
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
@@ -2071,7 +2227,7 @@ Returns:
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
@@ -2154,94 +2308,108 @@ rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 377
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
- Source:
@@ -2373,13 +2541,13 @@ Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
-
-
Array.<Point>
+Segment
-
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
@@ -2525,6 +2687,8 @@ Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
@@ -2681,6 +2881,8 @@ Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
- Source:
@@ -2824,108 +3062,56 @@ tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
- -
- Type:
-
- -
+
Name
-Vector
-
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
- - Source:
- -
- classes/arc.js, line 355
-
-
+
-
+
-
+
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
-
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
@@ -3033,6 +3218,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
-
-
Object
+Array.<Point>
+
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
@@ -3139,58 +3378,6 @@ transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
@@ -3320,13 +3507,13 @@ Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
@@ -344,6 +344,16 @@ boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
@@ -408,6 +418,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
@@ -472,6 +492,16 @@ highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
@@ -536,6 +566,16 @@ lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
@@ -609,13 +649,13 @@ max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
@@ -664,16 +704,6 @@ xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
@@ -738,16 +768,6 @@ xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
@@ -812,16 +832,6 @@ ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
@@ -886,16 +896,6 @@ yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
@@ -1122,7 +1122,7 @@ Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
@@ -1434,7 +1434,7 @@ Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
-
-
boolean
+Box
-
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
@@ -1594,7 +1590,7 @@ Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
-
-
Box
+boolean
+
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
- Source:
@@ -1750,7 +1750,7 @@ Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
@@ -2077,60 +2077,6 @@ svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
@@ -2258,7 +2204,7 @@ Returns:
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
- Source:
@@ -2339,6 +2285,58 @@ toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
@@ -292,6 +292,16 @@ boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
@@ -356,6 +366,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
@@ -420,16 +440,6 @@ pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
@@ -494,16 +504,6 @@ rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
- Source:
@@ -859,6 +859,8 @@ Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
@@ -1205,13 +1189,13 @@ Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from circle to shape
+
+
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
-
+
+ shortest segment between circle and shape (started at circle, ended at shape)
+
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
@@ -1338,66 +1344,6 @@ toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
@@ -1503,6 +1448,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
-
-
Object
+string
@@ -1557,7 +1554,7 @@ Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
@@ -207,6 +207,16 @@ B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
@@ -280,13 +290,13 @@ B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
@@ -344,13 +354,13 @@ B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
@@ -408,13 +418,13 @@ B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
@@ -472,13 +482,13 @@ B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
@@ -536,13 +546,13 @@ B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
@@ -600,13 +610,13 @@ E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
@@ -664,13 +674,13 @@ E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
@@ -728,13 +738,13 @@ E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
@@ -792,13 +802,13 @@ E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
@@ -856,13 +866,13 @@ E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
@@ -920,13 +930,13 @@ E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
@@ -984,13 +994,13 @@ I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
@@ -1048,13 +1058,13 @@ I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
@@ -1112,13 +1122,13 @@ I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
@@ -1176,13 +1186,13 @@ I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
@@ -1240,13 +1250,13 @@ I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
@@ -1304,13 +1314,13 @@ I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
@@ -1359,16 +1369,6 @@ mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
- Source:
@@ -275,7 +274,10 @@ Type:
-
-
number
+Segment
+|
+
+Arc
@@ -290,13 +292,13 @@ Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
@@ -345,6 +347,16 @@ boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
@@ -413,7 +425,7 @@ Type:
-
-
*
+Edge
@@ -428,13 +440,13 @@ Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
@@ -487,7 +499,7 @@ Type:
-
-
*
+Face
@@ -502,13 +514,13 @@ Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
@@ -561,7 +573,7 @@ Type:
-
-
*
+number
@@ -576,13 +588,13 @@ Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
@@ -631,6 +643,16 @@ end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
@@ -699,7 +721,7 @@ Type:
-
-
Face
+*
@@ -714,13 +736,13 @@ Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
@@ -769,6 +791,16 @@ lengthType:
+
+ -
+
+
*
+
+
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
@@ -837,7 +869,7 @@ Type:
-
-
Edge
+*
@@ -852,13 +884,13 @@ Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
@@ -907,16 +939,6 @@ overlapType:
-
- -
-
-
*
-
-
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
@@ -981,16 +1003,6 @@ prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
@@ -1055,19 +1067,6 @@ shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
@@ -1150,14 +1149,14 @@ Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
@@ -1212,56 +1211,11 @@ containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
Point
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
@@ -1347,11 +1315,56 @@ middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
- -
- Type:
-
- -
-
-
Point
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
@@ -345,13 +344,13 @@
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
@@ -426,7 +425,7 @@ (static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
@@ -310,13 +294,13 @@ box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
@@ -374,13 +358,13 @@ edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
@@ -603,14 +587,14 @@ Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
@@ -665,6 +649,84 @@ area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
-
-
number
+Face
@@ -707,14 +769,14 @@ Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
- Source:
@@ -794,13 +856,13 @@ Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
-
-
Edge
+Face
@@ -863,14 +925,14 @@ Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
@@ -925,82 +987,80 @@ insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/face.js, line 283
+
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ Parameters:
-
-Returns:
-
-
- -
- Type:
-
- -
-
-
Face
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
@@ -1109,58 +1153,6 @@ isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
- Source:
@@ -1312,14 +1299,14 @@ Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
@@ -1374,58 +1361,6 @@ removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
-
-
Face
+number
@@ -1468,16 +1403,14 @@ Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
@@ -1532,81 +1465,56 @@ reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
- - Source:
- -
- classes/face.js, line 283
-
-
+
-
+
-
+
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
boolean
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
- Source:
@@ -1703,6 +1621,58 @@ signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
@@ -1830,7 +1800,7 @@ Returns:
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
@@ -1934,7 +1904,7 @@ Returns:
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
@@ -299,6 +299,16 @@ boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
@@ -363,6 +373,16 @@ endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
@@ -436,13 +456,13 @@ length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Point
+
+
+
+
+
@@ -379,13 +389,13 @@ box
-center
+r :number
- Get center of arc
+ Arc radius
@@ -421,7 +431,7 @@ centerSource:
@@ -434,6 +444,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -443,13 +463,13 @@ center
-counterClockwise :boolean
+startAngle :number
- Arc orientation
+ Arc start angle in radians
@@ -485,7 +505,7 @@ count
Source:
@@ -502,7 +522,7 @@ Type:
-
-
boolean
+number
@@ -517,13 +537,13 @@ Type:
-end
+endAngle :number
- Get end point of arc
+ Arc end angle in radians
@@ -559,7 +579,7 @@ endSource:
@@ -572,6 +592,16 @@ endnumber
+
+
+
+
+
@@ -581,13 +611,13 @@ end
-endAngle :number
+counterClockwise :boolean
- Arc end angle in radians
+ Arc orientation
@@ -623,7 +653,7 @@ endAngleSource:
@@ -640,7 +670,7 @@ Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ Type:
-length
+sweep
- Get arc length
+ Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
@@ -697,7 +727,7 @@ lengthSource:
@@ -719,13 +749,13 @@ length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
@@ -774,16 +804,6 @@ pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
@@ -848,16 +868,6 @@ rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
@@ -931,13 +941,13 @@ start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
- Source:
@@ -986,16 +996,6 @@ startAngle<
- Type:
-
- -
-
-
number
-
-
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
@@ -1078,14 +1078,14 @@ Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
- Source:
@@ -1163,7 +1163,7 @@ Returns:
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
- Source:
@@ -1244,6 +1244,58 @@ chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
@@ -1348,6 +1400,58 @@ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
@@ -1452,56 +1556,108 @@ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 214
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ Returns:
-
-
boolean
+number
@@ -1546,14 +1702,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
- Source:
@@ -1650,7 +1806,7 @@ Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
- -
-
- -
- Type:
-
- -
-
number
-
-
-
-
-
-
-
- distance from arc to shape
-
-
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
-
- shortest segment between arc and shape (started at arc, ended at shape)
-
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
@@ -1830,7 +1962,7 @@ Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from arc to shape
+
+
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
-
+
+ shortest segment between arc and shape (started at arc, ended at shape)
+
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
@@ -1967,7 +2123,7 @@ Returns:
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
@@ -2071,7 +2227,7 @@ Returns:
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
@@ -2154,94 +2308,108 @@ rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 377
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
- Source:
@@ -2373,13 +2541,13 @@ Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
-
-
Array.<Point>
+Segment
-
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
@@ -2525,6 +2687,8 @@ Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
@@ -2681,6 +2881,8 @@ Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
- Source:
@@ -2824,108 +3062,56 @@ tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
- -
- Type:
-
- -
+
Name
-Vector
-
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
- - Source:
- -
- classes/arc.js, line 355
-
-
+
-
+
-
+
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
-
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
@@ -3033,6 +3218,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
-
-
Object
+Array.<Point>
+
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
@@ -3139,58 +3378,6 @@ transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
@@ -3320,13 +3507,13 @@ Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
@@ -344,6 +344,16 @@ boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
@@ -408,6 +418,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
@@ -472,6 +492,16 @@ highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
@@ -536,6 +566,16 @@ lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
@@ -609,13 +649,13 @@ max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
@@ -664,16 +704,6 @@ xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
@@ -738,16 +768,6 @@ xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
@@ -812,16 +832,6 @@ ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
@@ -886,16 +896,6 @@ yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
@@ -1122,7 +1122,7 @@ Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
@@ -1434,7 +1434,7 @@ Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
-
-
boolean
+Box
-
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
@@ -1594,7 +1590,7 @@ Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
-
-
Box
+boolean
+
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
- Source:
@@ -1750,7 +1750,7 @@ Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
@@ -2077,60 +2077,6 @@ svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
@@ -2258,7 +2204,7 @@ Returns:
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
- Source:
@@ -2339,6 +2285,58 @@ toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
@@ -292,6 +292,16 @@ boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
@@ -356,6 +366,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
@@ -420,16 +440,6 @@ pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
@@ -494,16 +504,6 @@ rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
- Source:
@@ -859,6 +859,8 @@ Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
@@ -1205,13 +1189,13 @@ Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from circle to shape
+
+
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
-
+
+ shortest segment between circle and shape (started at circle, ended at shape)
+
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
@@ -1338,66 +1344,6 @@ toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
@@ -1503,6 +1448,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
-
-
Object
+string
@@ -1557,7 +1554,7 @@ Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
@@ -207,6 +207,16 @@ B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
@@ -280,13 +290,13 @@ B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
@@ -344,13 +354,13 @@ B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
@@ -408,13 +418,13 @@ B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
@@ -472,13 +482,13 @@ B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
@@ -536,13 +546,13 @@ B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
@@ -600,13 +610,13 @@ E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
@@ -664,13 +674,13 @@ E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
@@ -728,13 +738,13 @@ E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
@@ -792,13 +802,13 @@ E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
@@ -856,13 +866,13 @@ E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
@@ -920,13 +930,13 @@ E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
@@ -984,13 +994,13 @@ I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
@@ -1048,13 +1058,13 @@ I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
@@ -1112,13 +1122,13 @@ I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
@@ -1176,13 +1186,13 @@ I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
@@ -1240,13 +1250,13 @@ I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
@@ -1304,13 +1314,13 @@ I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
@@ -1359,16 +1369,6 @@ mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
- Source:
@@ -275,7 +274,10 @@ Type:
-
-
number
+Segment
+|
+
+Arc
@@ -290,13 +292,13 @@ Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
@@ -345,6 +347,16 @@ boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
@@ -413,7 +425,7 @@ Type:
-
-
*
+Edge
@@ -428,13 +440,13 @@ Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
@@ -487,7 +499,7 @@ Type:
-
-
*
+Face
@@ -502,13 +514,13 @@ Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
@@ -561,7 +573,7 @@ Type:
-
-
*
+number
@@ -576,13 +588,13 @@ Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
@@ -631,6 +643,16 @@ end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
@@ -699,7 +721,7 @@ Type:
-
-
Face
+*
@@ -714,13 +736,13 @@ Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
@@ -769,6 +791,16 @@ lengthType:
+
+ -
+
+
*
+
+
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
@@ -837,7 +869,7 @@ Type:
-
-
Edge
+*
@@ -852,13 +884,13 @@ Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
@@ -907,16 +939,6 @@ overlapType:
-
- -
-
-
*
-
-
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
@@ -981,16 +1003,6 @@ prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
@@ -1055,19 +1067,6 @@ shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
@@ -1150,14 +1149,14 @@ Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
@@ -1212,56 +1211,11 @@ containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
Point
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
@@ -1347,11 +1315,56 @@ middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
- -
- Type:
-
- -
-
-
Point
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
@@ -345,13 +344,13 @@
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
@@ -426,7 +425,7 @@ (static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
@@ -310,13 +294,13 @@ box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
@@ -374,13 +358,13 @@ edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
@@ -603,14 +587,14 @@ Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
@@ -665,6 +649,84 @@ area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
-
-
number
+Face
@@ -707,14 +769,14 @@ Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
- Source:
@@ -794,13 +856,13 @@ Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
-
-
Edge
+Face
@@ -863,14 +925,14 @@ Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
@@ -925,82 +987,80 @@ insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/face.js, line 283
+
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ Parameters:
-
-Returns:
-
-
- -
- Type:
-
- -
-
-
Face
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
@@ -1109,58 +1153,6 @@ isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
- Source:
@@ -1312,14 +1299,14 @@ Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
@@ -1374,58 +1361,6 @@ removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
-
-
Face
+number
@@ -1468,16 +1403,14 @@ Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
@@ -1532,81 +1465,56 @@ reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
- - Source:
- -
- classes/face.js, line 283
-
-
+
-
+
-
+
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
boolean
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
- Source:
@@ -1703,6 +1621,58 @@ signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
@@ -1830,7 +1800,7 @@ Returns:
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
@@ -1934,7 +1904,7 @@ Returns:
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
@@ -299,6 +299,16 @@ boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
@@ -363,6 +373,16 @@ endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
@@ -436,13 +456,13 @@ length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -443,13 +463,13 @@ center
-counterClockwise :boolean
+startAngle :number
- Arc orientation
+ Arc start angle in radians
@@ -485,7 +505,7 @@ count
Source:
@@ -502,7 +522,7 @@ Type:
-
-
boolean
+number
@@ -517,13 +537,13 @@ Type:
-end
+endAngle :number
- Get end point of arc
+ Arc end angle in radians
@@ -559,7 +579,7 @@ endSource:
@@ -572,6 +592,16 @@ endnumber
+
+
+
+
+
@@ -581,13 +611,13 @@ end
-endAngle :number
+counterClockwise :boolean
- Arc end angle in radians
+ Arc orientation
@@ -623,7 +653,7 @@ endAngleSource:
@@ -640,7 +670,7 @@ Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ Type:
-length
+sweep
- Get arc length
+ Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
@@ -697,7 +727,7 @@ lengthSource:
@@ -719,13 +749,13 @@ length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
@@ -774,16 +804,6 @@ pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
@@ -848,16 +868,6 @@ rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
@@ -931,13 +941,13 @@ start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
- Source:
@@ -986,16 +996,6 @@ startAngle<
- Type:
-
- -
-
-
number
-
-
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
@@ -1078,14 +1078,14 @@ Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
- Source:
@@ -1163,7 +1163,7 @@ Returns:
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
- Source:
@@ -1244,6 +1244,58 @@ chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
@@ -1348,6 +1400,58 @@ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
@@ -1452,56 +1556,108 @@ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 214
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ Returns:
-
-
boolean
+number
@@ -1546,14 +1702,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
- Source:
@@ -1650,7 +1806,7 @@ Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
- -
-
- -
- Type:
-
- -
-
number
-
-
-
-
-
-
-
- distance from arc to shape
-
-
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
-
- shortest segment between arc and shape (started at arc, ended at shape)
-
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
@@ -1830,7 +1962,7 @@ Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from arc to shape
+
+
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
-
+
+ shortest segment between arc and shape (started at arc, ended at shape)
+
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
@@ -1967,7 +2123,7 @@ Returns:
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
@@ -2071,7 +2227,7 @@ Returns:
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
@@ -2154,94 +2308,108 @@ rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 377
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
- Source:
@@ -2373,13 +2541,13 @@ Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
-
-
Array.<Point>
+Segment
-
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
@@ -2525,6 +2687,8 @@ Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
@@ -2681,6 +2881,8 @@ Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
- Source:
@@ -2824,108 +3062,56 @@ tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
- -
- Type:
-
- -
+
Name
-Vector
-
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
- - Source:
- -
- classes/arc.js, line 355
-
-
+
-
+
-
+
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
-
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
@@ -3033,6 +3218,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
-
-
Object
+Array.<Point>
+
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
@@ -3139,58 +3378,6 @@ transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
@@ -3320,13 +3507,13 @@ Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
@@ -344,6 +344,16 @@ boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
@@ -408,6 +418,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
@@ -472,6 +492,16 @@ highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
@@ -536,6 +566,16 @@ lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
@@ -609,13 +649,13 @@ max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
@@ -664,16 +704,6 @@ xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
@@ -738,16 +768,6 @@ xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
@@ -812,16 +832,6 @@ ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
@@ -886,16 +896,6 @@ yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
@@ -1122,7 +1122,7 @@ Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
@@ -1434,7 +1434,7 @@ Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
-
-
boolean
+Box
-
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
@@ -1594,7 +1590,7 @@ Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
-
-
Box
+boolean
+
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
- Source:
@@ -1750,7 +1750,7 @@ Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
@@ -2077,60 +2077,6 @@ svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
@@ -2258,7 +2204,7 @@ Returns:
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
- Source:
@@ -2339,6 +2285,58 @@ toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
@@ -292,6 +292,16 @@ boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
@@ -356,6 +366,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
@@ -420,16 +440,6 @@ pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
@@ -494,16 +504,6 @@ rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
- Source:
@@ -859,6 +859,8 @@ Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
@@ -1205,13 +1189,13 @@ Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from circle to shape
+
+
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
-
+
+ shortest segment between circle and shape (started at circle, ended at shape)
+
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
@@ -1338,66 +1344,6 @@ toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
@@ -1503,6 +1448,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
-
-
Object
+string
@@ -1557,7 +1554,7 @@ Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
@@ -207,6 +207,16 @@ B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
@@ -280,13 +290,13 @@ B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
@@ -344,13 +354,13 @@ B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
@@ -408,13 +418,13 @@ B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
@@ -472,13 +482,13 @@ B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
@@ -536,13 +546,13 @@ B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
@@ -600,13 +610,13 @@ E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
@@ -664,13 +674,13 @@ E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
@@ -728,13 +738,13 @@ E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
@@ -792,13 +802,13 @@ E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
@@ -856,13 +866,13 @@ E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
@@ -920,13 +930,13 @@ E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
@@ -984,13 +994,13 @@ I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
@@ -1048,13 +1058,13 @@ I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
@@ -1112,13 +1122,13 @@ I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
@@ -1176,13 +1186,13 @@ I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
@@ -1240,13 +1250,13 @@ I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
@@ -1304,13 +1314,13 @@ I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
@@ -1359,16 +1369,6 @@ mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
- Source:
@@ -275,7 +274,10 @@ Type:
-
-
number
+Segment
+|
+
+Arc
@@ -290,13 +292,13 @@ Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
@@ -345,6 +347,16 @@ boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
@@ -413,7 +425,7 @@ Type:
-
-
*
+Edge
@@ -428,13 +440,13 @@ Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
@@ -487,7 +499,7 @@ Type:
-
-
*
+Face
@@ -502,13 +514,13 @@ Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
@@ -561,7 +573,7 @@ Type:
-
-
*
+number
@@ -576,13 +588,13 @@ Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
@@ -631,6 +643,16 @@ end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
@@ -699,7 +721,7 @@ Type:
-
-
Face
+*
@@ -714,13 +736,13 @@ Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
@@ -769,6 +791,16 @@ lengthType:
+
+ -
+
+
*
+
+
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
@@ -837,7 +869,7 @@ Type:
-
-
Edge
+*
@@ -852,13 +884,13 @@ Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
@@ -907,16 +939,6 @@ overlapType:
-
- -
-
-
*
-
-
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
@@ -981,16 +1003,6 @@ prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
@@ -1055,19 +1067,6 @@ shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
@@ -1150,14 +1149,14 @@ Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
@@ -1212,56 +1211,11 @@ containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
Point
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
@@ -1347,11 +1315,56 @@ middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
- -
- Type:
-
- -
-
-
Point
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
@@ -345,13 +344,13 @@
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
@@ -426,7 +425,7 @@ (static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
@@ -310,13 +294,13 @@ box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
@@ -374,13 +358,13 @@ edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
@@ -603,14 +587,14 @@ Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
@@ -665,6 +649,84 @@ area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
-
-
number
+Face
@@ -707,14 +769,14 @@ Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
- Source:
@@ -794,13 +856,13 @@ Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
-
-
Edge
+Face
@@ -863,14 +925,14 @@ Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
@@ -925,82 +987,80 @@ insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/face.js, line 283
+
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ Parameters:
-
-Returns:
-
-
- -
- Type:
-
- -
-
-
Face
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
@@ -1109,58 +1153,6 @@ isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
- Source:
@@ -1312,14 +1299,14 @@ Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
@@ -1374,58 +1361,6 @@ removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
-
-
Face
+number
@@ -1468,16 +1403,14 @@ Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
@@ -1532,81 +1465,56 @@ reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
- - Source:
- -
- classes/face.js, line 283
-
-
+
-
+
-
+
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
boolean
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
- Source:
@@ -1703,6 +1621,58 @@ signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
@@ -1830,7 +1800,7 @@ Returns:
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
@@ -1934,7 +1904,7 @@ Returns:
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
@@ -299,6 +299,16 @@ boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
@@ -363,6 +373,16 @@ endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
@@ -436,13 +456,13 @@ length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
+
+
+ counterClockwise :boolean
+startAngle :number
count
Source:
@@ -502,7 +522,7 @@ Type:
-
-
boolean
+number
@@ -517,13 +537,13 @@ Type:
-end
+endAngle :number
- Get end point of arc
+ Arc end angle in radians
@@ -559,7 +579,7 @@ endSource:
@@ -572,6 +592,16 @@ endnumber
+
+
+
+
+
@@ -581,13 +611,13 @@ end
-endAngle :number
+counterClockwise :boolean
- Arc end angle in radians
+ Arc orientation
@@ -623,7 +653,7 @@ endAngleSource:
@@ -640,7 +670,7 @@ Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ Type:
-length
+sweep
- Get arc length
+ Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
@@ -697,7 +727,7 @@ lengthSource:
@@ -719,13 +749,13 @@ length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
@@ -774,16 +804,6 @@ pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
@@ -848,16 +868,6 @@ rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
@@ -931,13 +941,13 @@ start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
- Source:
@@ -986,16 +996,6 @@ startAngle<
- Type:
-
- -
-
-
number
-
-
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
@@ -1078,14 +1078,14 @@ Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
- Source:
@@ -1163,7 +1163,7 @@ Returns:
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
- Source:
@@ -1244,6 +1244,58 @@ chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
@@ -1348,6 +1400,58 @@ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
@@ -1452,56 +1556,108 @@ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 214
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ Returns:
-
-
boolean
+number
@@ -1546,14 +1702,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
- Source:
@@ -1650,7 +1806,7 @@ Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
- -
-
- -
- Type:
-
- -
-
number
-
-
-
-
-
-
-
- distance from arc to shape
-
-
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
-
- shortest segment between arc and shape (started at arc, ended at shape)
-
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
@@ -1830,7 +1962,7 @@ Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from arc to shape
+
+
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
-
+
+ shortest segment between arc and shape (started at arc, ended at shape)
+
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
@@ -1967,7 +2123,7 @@ Returns:
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
@@ -2071,7 +2227,7 @@ Returns:
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
@@ -2154,94 +2308,108 @@ rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 377
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
- Source:
@@ -2373,13 +2541,13 @@ Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
-
-
Array.<Point>
+Segment
-
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
@@ -2525,6 +2687,8 @@ Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
@@ -2681,6 +2881,8 @@ Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
- Source:
@@ -2824,108 +3062,56 @@ tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
- -
- Type:
-
- -
+
Name
-Vector
-
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
- - Source:
- -
- classes/arc.js, line 355
-
-
+
-
+
-
+
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
-
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
@@ -3033,6 +3218,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
-
-
Object
+Array.<Point>
+
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
@@ -3139,58 +3378,6 @@ transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
@@ -3320,13 +3507,13 @@ Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
@@ -344,6 +344,16 @@ boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
@@ -408,6 +418,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
@@ -472,6 +492,16 @@ highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
@@ -536,6 +566,16 @@ lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
@@ -609,13 +649,13 @@ max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
@@ -664,16 +704,6 @@ xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
@@ -738,16 +768,6 @@ xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
@@ -812,16 +832,6 @@ ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
@@ -886,16 +896,6 @@ yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
@@ -1122,7 +1122,7 @@ Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
@@ -1434,7 +1434,7 @@ Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
-
-
boolean
+Box
-
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
@@ -1594,7 +1590,7 @@ Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
-
-
Box
+boolean
+
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
- Source:
@@ -1750,7 +1750,7 @@ Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
@@ -2077,60 +2077,6 @@ svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
@@ -2258,7 +2204,7 @@ Returns:
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
- Source:
@@ -2339,6 +2285,58 @@ toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
@@ -292,6 +292,16 @@ boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
@@ -356,6 +366,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
@@ -420,16 +440,6 @@ pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
@@ -494,16 +504,6 @@ rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
- Source:
@@ -859,6 +859,8 @@ Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
@@ -1205,13 +1189,13 @@ Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from circle to shape
+
+
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
-
+
+ shortest segment between circle and shape (started at circle, ended at shape)
+
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
@@ -1338,66 +1344,6 @@ toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
@@ -1503,6 +1448,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
-
-
Object
+string
@@ -1557,7 +1554,7 @@ Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
@@ -207,6 +207,16 @@ B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
@@ -280,13 +290,13 @@ B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
@@ -344,13 +354,13 @@ B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
@@ -408,13 +418,13 @@ B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
@@ -472,13 +482,13 @@ B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
@@ -536,13 +546,13 @@ B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
@@ -600,13 +610,13 @@ E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
@@ -664,13 +674,13 @@ E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
@@ -728,13 +738,13 @@ E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
@@ -792,13 +802,13 @@ E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
@@ -856,13 +866,13 @@ E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
@@ -920,13 +930,13 @@ E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
@@ -984,13 +994,13 @@ I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
@@ -1048,13 +1058,13 @@ I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
@@ -1112,13 +1122,13 @@ I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
@@ -1176,13 +1186,13 @@ I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
@@ -1240,13 +1250,13 @@ I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
@@ -1304,13 +1314,13 @@ I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
@@ -1359,16 +1369,6 @@ mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
- Source:
@@ -275,7 +274,10 @@ Type:
-
-
number
+Segment
+|
+
+Arc
@@ -290,13 +292,13 @@ Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
@@ -345,6 +347,16 @@ boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
@@ -413,7 +425,7 @@ Type:
-
-
*
+Edge
@@ -428,13 +440,13 @@ Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
@@ -487,7 +499,7 @@ Type:
-
-
*
+Face
@@ -502,13 +514,13 @@ Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
@@ -561,7 +573,7 @@ Type:
-
-
*
+number
@@ -576,13 +588,13 @@ Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
@@ -631,6 +643,16 @@ end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
@@ -699,7 +721,7 @@ Type:
-
-
Face
+*
@@ -714,13 +736,13 @@ Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
@@ -769,6 +791,16 @@ lengthType:
+
+ -
+
+
*
+
+
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
@@ -837,7 +869,7 @@ Type:
-
-
Edge
+*
@@ -852,13 +884,13 @@ Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
@@ -907,16 +939,6 @@ overlapType:
-
- -
-
-
*
-
-
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
@@ -981,16 +1003,6 @@ prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
@@ -1055,19 +1067,6 @@ shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
@@ -1150,14 +1149,14 @@ Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
@@ -1212,56 +1211,11 @@ containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
Point
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
@@ -1347,11 +1315,56 @@ middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
- -
- Type:
-
- -
-
-
Point
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
@@ -345,13 +344,13 @@
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
@@ -426,7 +425,7 @@ (static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
@@ -310,13 +294,13 @@ box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
@@ -374,13 +358,13 @@ edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
@@ -603,14 +587,14 @@ Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
@@ -665,6 +649,84 @@ area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
-
-
number
+Face
@@ -707,14 +769,14 @@ Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
- Source:
@@ -794,13 +856,13 @@ Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
-
-
Edge
+Face
@@ -863,14 +925,14 @@ Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
@@ -925,82 +987,80 @@ insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/face.js, line 283
+
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ Parameters:
-
-Returns:
-
-
- -
- Type:
-
- -
-
-
Face
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
@@ -1109,58 +1153,6 @@ isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
- Source:
@@ -1312,14 +1299,14 @@ Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
@@ -1374,58 +1361,6 @@ removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
-
-
Face
+number
@@ -1468,16 +1403,14 @@ Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
@@ -1532,81 +1465,56 @@ reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
- - Source:
- -
- classes/face.js, line 283
-
-
+
-
+
-
+
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
boolean
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
- Source:
@@ -1703,6 +1621,58 @@ signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
@@ -1830,7 +1800,7 @@ Returns:
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
@@ -1934,7 +1904,7 @@ Returns:
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
@@ -299,6 +299,16 @@ boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
@@ -363,6 +373,16 @@ endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
@@ -436,13 +456,13 @@ length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
boolean
+number
Type:
end
+endAngle :number
endSource:
@@ -572,6 +592,16 @@ endnumber
+
+
+
+
+
@@ -581,13 +611,13 @@ end
-endAngle :number
+counterClockwise :boolean
- Arc end angle in radians
+ Arc orientation
@@ -623,7 +653,7 @@ endAngleSource:
@@ -640,7 +670,7 @@ Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ Type:
-length
+sweep
- Get arc length
+ Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
@@ -697,7 +727,7 @@ lengthSource:
@@ -719,13 +749,13 @@ length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
@@ -774,16 +804,6 @@ pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
@@ -848,16 +868,6 @@ rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
@@ -931,13 +941,13 @@ start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
- Source:
@@ -986,16 +996,6 @@ startAngle<
- Type:
-
- -
-
-
number
-
-
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
@@ -1078,14 +1078,14 @@ Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
- Source:
@@ -1163,7 +1163,7 @@ Returns:
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
- Source:
@@ -1244,6 +1244,58 @@ chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
@@ -1348,6 +1400,58 @@ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
@@ -1452,56 +1556,108 @@ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 214
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ Returns:
-
-
boolean
+number
@@ -1546,14 +1702,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
- Source:
@@ -1650,7 +1806,7 @@ Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
- -
-
- -
- Type:
-
- -
-
number
-
-
-
-
-
-
-
- distance from arc to shape
-
-
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
-
- shortest segment between arc and shape (started at arc, ended at shape)
-
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
@@ -1830,7 +1962,7 @@ Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from arc to shape
+
+
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
-
+
+ shortest segment between arc and shape (started at arc, ended at shape)
+
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
@@ -1967,7 +2123,7 @@ Returns:
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
@@ -2071,7 +2227,7 @@ Returns:
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
@@ -2154,94 +2308,108 @@ rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 377
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
- Source:
@@ -2373,13 +2541,13 @@ Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
-
-
Array.<Point>
+Segment
-
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
@@ -2525,6 +2687,8 @@ Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
@@ -2681,6 +2881,8 @@ Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
- Source:
@@ -2824,108 +3062,56 @@ tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
- -
- Type:
-
- -
+
Name
-Vector
-
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
- - Source:
- -
- classes/arc.js, line 355
-
-
+
-
+
-
+
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
-
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
@@ -3033,6 +3218,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
-
-
Object
+Array.<Point>
+
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
@@ -3139,58 +3378,6 @@ transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
@@ -3320,13 +3507,13 @@ Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
@@ -344,6 +344,16 @@ boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
@@ -408,6 +418,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
@@ -472,6 +492,16 @@ highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
@@ -536,6 +566,16 @@ lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
@@ -609,13 +649,13 @@ max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
@@ -664,16 +704,6 @@ xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
@@ -738,16 +768,6 @@ xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
@@ -812,16 +832,6 @@ ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
@@ -886,16 +896,6 @@ yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
@@ -1122,7 +1122,7 @@ Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
@@ -1434,7 +1434,7 @@ Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
-
-
boolean
+Box
-
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
@@ -1594,7 +1590,7 @@ Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
-
-
Box
+boolean
+
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
- Source:
@@ -1750,7 +1750,7 @@ Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
@@ -2077,60 +2077,6 @@ svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
@@ -2258,7 +2204,7 @@ Returns:
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
- Source:
@@ -2339,6 +2285,58 @@ toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
@@ -292,6 +292,16 @@ boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
@@ -356,6 +366,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
@@ -420,16 +440,6 @@ pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
@@ -494,16 +504,6 @@ rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
- Source:
@@ -859,6 +859,8 @@ Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
@@ -1205,13 +1189,13 @@ Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from circle to shape
+
+
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
-
+
+ shortest segment between circle and shape (started at circle, ended at shape)
+
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
@@ -1338,66 +1344,6 @@ toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
@@ -1503,6 +1448,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
-
-
Object
+string
@@ -1557,7 +1554,7 @@ Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
@@ -207,6 +207,16 @@ B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
@@ -280,13 +290,13 @@ B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
@@ -344,13 +354,13 @@ B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
@@ -408,13 +418,13 @@ B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
@@ -472,13 +482,13 @@ B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
@@ -536,13 +546,13 @@ B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
@@ -600,13 +610,13 @@ E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
@@ -664,13 +674,13 @@ E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
@@ -728,13 +738,13 @@ E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
@@ -792,13 +802,13 @@ E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
@@ -856,13 +866,13 @@ E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
@@ -920,13 +930,13 @@ E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
@@ -984,13 +994,13 @@ I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
@@ -1048,13 +1058,13 @@ I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
@@ -1112,13 +1122,13 @@ I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
@@ -1176,13 +1186,13 @@ I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
@@ -1240,13 +1250,13 @@ I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
@@ -1304,13 +1314,13 @@ I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
@@ -1359,16 +1369,6 @@ mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
- Source:
@@ -275,7 +274,10 @@ Type:
-
-
number
+Segment
+|
+
+Arc
@@ -290,13 +292,13 @@ Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
@@ -345,6 +347,16 @@ boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
@@ -413,7 +425,7 @@ Type:
-
-
*
+Edge
@@ -428,13 +440,13 @@ Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
@@ -487,7 +499,7 @@ Type:
-
-
*
+Face
@@ -502,13 +514,13 @@ Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
@@ -561,7 +573,7 @@ Type:
-
-
*
+number
@@ -576,13 +588,13 @@ Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
@@ -631,6 +643,16 @@ end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
@@ -699,7 +721,7 @@ Type:
-
-
Face
+*
@@ -714,13 +736,13 @@ Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
@@ -769,6 +791,16 @@ lengthType:
+
+ -
+
+
*
+
+
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
@@ -837,7 +869,7 @@ Type:
-
-
Edge
+*
@@ -852,13 +884,13 @@ Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
@@ -907,16 +939,6 @@ overlapType:
-
- -
-
-
*
-
-
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
@@ -981,16 +1003,6 @@ prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
@@ -1055,19 +1067,6 @@ shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
@@ -1150,14 +1149,14 @@ Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
@@ -1212,56 +1211,11 @@ containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
Point
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
@@ -1347,11 +1315,56 @@ middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
- -
- Type:
-
- -
-
-
Point
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
@@ -345,13 +344,13 @@
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
@@ -426,7 +425,7 @@ (static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
@@ -310,13 +294,13 @@ box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
@@ -374,13 +358,13 @@ edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
@@ -603,14 +587,14 @@ Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
@@ -665,6 +649,84 @@ area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
-
-
number
+Face
@@ -707,14 +769,14 @@ Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
- Source:
@@ -794,13 +856,13 @@ Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
-
-
Edge
+Face
@@ -863,14 +925,14 @@ Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
@@ -925,82 +987,80 @@ insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/face.js, line 283
+
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ Parameters:
-
-Returns:
-
-
- -
- Type:
-
- -
-
-
Face
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
@@ -1109,58 +1153,6 @@ isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
- Source:
@@ -1312,14 +1299,14 @@ Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
@@ -1374,58 +1361,6 @@ removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
-
-
Face
+number
@@ -1468,16 +1403,14 @@ Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
@@ -1532,81 +1465,56 @@ reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
- - Source:
- -
- classes/face.js, line 283
-
-
+
-
+
-
+
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
boolean
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
- Source:
@@ -1703,6 +1621,58 @@ signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
@@ -1830,7 +1800,7 @@ Returns:
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
@@ -1934,7 +1904,7 @@ Returns:
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
@@ -299,6 +299,16 @@ boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
@@ -363,6 +373,16 @@ endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
@@ -436,13 +456,13 @@ length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
+
+
+
+
+
@@ -581,13 +611,13 @@ end
-endAngle :number
+counterClockwise :boolean
- Arc end angle in radians
+ Arc orientation
@@ -623,7 +653,7 @@ endAngleSource:
@@ -640,7 +670,7 @@ Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ Type:
-length
+sweep
- Get arc length
+ Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
@@ -697,7 +727,7 @@ lengthSource:
@@ -719,13 +749,13 @@ length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
@@ -774,16 +804,6 @@ pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
@@ -848,16 +868,6 @@ rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
@@ -931,13 +941,13 @@ start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
- Source:
@@ -986,16 +996,6 @@ startAngle<
- Type:
-
- -
-
-
number
-
-
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
@@ -1078,14 +1078,14 @@ Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
- Source:
@@ -1163,7 +1163,7 @@ Returns:
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
- Source:
@@ -1244,6 +1244,58 @@ chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
@@ -1348,6 +1400,58 @@ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
@@ -1452,56 +1556,108 @@ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 214
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ Returns:
-
-
boolean
+number
@@ -1546,14 +1702,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
- Source:
@@ -1650,7 +1806,7 @@ Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
- -
-
- -
- Type:
-
- -
-
number
-
-
-
-
-
-
-
- distance from arc to shape
-
-
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
-
- shortest segment between arc and shape (started at arc, ended at shape)
-
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
@@ -1830,7 +1962,7 @@ Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from arc to shape
+
+
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
-
+
+ shortest segment between arc and shape (started at arc, ended at shape)
+
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
@@ -1967,7 +2123,7 @@ Returns:
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
@@ -2071,7 +2227,7 @@ Returns:
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
@@ -2154,94 +2308,108 @@ rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/arc.js, line 377
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
- Source:
@@ -2373,13 +2541,13 @@ Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
-
-
Array.<Point>
+Segment
-
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
@@ -2525,6 +2687,8 @@ Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
@@ -2681,6 +2881,8 @@ Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
- Source:
@@ -2824,108 +3062,56 @@ tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
- -
- Type:
-
- -
+
Name
-Vector
-
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
- - Source:
- -
- classes/arc.js, line 355
-
-
+
-
+
-
+
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
-
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
@@ -3033,6 +3218,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
-
-
Object
+Array.<Point>
+
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
@@ -3139,58 +3378,6 @@ transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
@@ -3320,13 +3507,13 @@ Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
@@ -344,6 +344,16 @@ boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
@@ -408,6 +418,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
@@ -472,6 +492,16 @@ highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
@@ -536,6 +566,16 @@ lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
@@ -609,13 +649,13 @@ max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
@@ -664,16 +704,6 @@ xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
@@ -738,16 +768,6 @@ xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
@@ -812,16 +832,6 @@ ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
@@ -886,16 +896,6 @@ yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
@@ -1122,7 +1122,7 @@ Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
@@ -1434,7 +1434,7 @@ Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
-
-
boolean
+Box
-
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
@@ -1594,7 +1590,7 @@ Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
-
-
Box
+boolean
+
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
- Source:
@@ -1750,7 +1750,7 @@ Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
@@ -2077,60 +2077,6 @@ svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
@@ -2258,7 +2204,7 @@ Returns:
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
- Source:
@@ -2339,6 +2285,58 @@ toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
@@ -292,6 +292,16 @@ boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
@@ -356,6 +366,16 @@ centerType:
+
+ -
+
+
number
+
+
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
@@ -420,16 +440,6 @@ pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
@@ -494,16 +504,6 @@ rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
- Source:
@@ -859,6 +859,8 @@ Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
@@ -1205,13 +1189,13 @@ Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+ -
+
+ -
+ Type:
+
+ -
+
number
+
+
+
+
+
+
+
+ distance from circle to shape
+
+
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
-
+
+ shortest segment between circle and shape (started at circle, ended at shape)
+
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
@@ -1338,66 +1344,6 @@ toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
@@ -1503,6 +1448,58 @@ toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
-
-
Object
+string
@@ -1557,7 +1554,7 @@ Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
@@ -207,6 +207,16 @@ B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
@@ -280,13 +290,13 @@ B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
@@ -344,13 +354,13 @@ B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
@@ -408,13 +418,13 @@ B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
@@ -472,13 +482,13 @@ B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
@@ -536,13 +546,13 @@ B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
@@ -600,13 +610,13 @@ E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
@@ -664,13 +674,13 @@ E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
@@ -728,13 +738,13 @@ E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
@@ -792,13 +802,13 @@ E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
@@ -856,13 +866,13 @@ E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
@@ -920,13 +930,13 @@ E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
@@ -984,13 +994,13 @@ I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
@@ -1048,13 +1058,13 @@ I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
@@ -1112,13 +1122,13 @@ I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
@@ -1176,13 +1186,13 @@ I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
@@ -1240,13 +1250,13 @@ I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
@@ -1304,13 +1314,13 @@ I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
@@ -1359,16 +1369,6 @@ mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
- Source:
@@ -275,7 +274,10 @@ Type:
-
-
number
+Segment
+|
+
+Arc
@@ -290,13 +292,13 @@ Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
@@ -345,6 +347,16 @@ boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
@@ -413,7 +425,7 @@ Type:
-
-
*
+Edge
@@ -428,13 +440,13 @@ Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
@@ -487,7 +499,7 @@ Type:
-
-
*
+Face
@@ -502,13 +514,13 @@ Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
@@ -561,7 +573,7 @@ Type:
-
-
*
+number
@@ -576,13 +588,13 @@ Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
@@ -631,6 +643,16 @@ end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
@@ -699,7 +721,7 @@ Type:
-
-
Face
+*
@@ -714,13 +736,13 @@ Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
@@ -769,6 +791,16 @@ lengthType:
+
+ -
+
+
*
+
+
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
@@ -837,7 +869,7 @@ Type:
-
-
Edge
+*
@@ -852,13 +884,13 @@ Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
@@ -907,16 +939,6 @@ overlapType:
-
- -
-
-
*
-
-
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
@@ -981,16 +1003,6 @@ prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
@@ -1055,19 +1067,6 @@ shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
@@ -1150,14 +1149,14 @@ Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
@@ -1212,56 +1211,11 @@ containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
Point
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
@@ -1347,11 +1315,56 @@ middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
- -
- Type:
-
- -
-
-
Point
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
@@ -345,13 +344,13 @@
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
@@ -426,7 +425,7 @@ (static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
@@ -310,13 +294,13 @@ box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
@@ -374,13 +358,13 @@ edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
@@ -603,14 +587,14 @@ Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
@@ -665,6 +649,84 @@ area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
-
-
number
+Face
@@ -707,14 +769,14 @@ Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
- Source:
@@ -794,13 +856,13 @@ Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
-
-
Edge
+Face
@@ -863,14 +925,14 @@ Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
@@ -925,82 +987,80 @@ insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ - Source:
+ -
+ classes/face.js, line 283
+
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ Parameters:
-
-Returns:
-
-
- -
- Type:
-
- -
-
-
Face
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
@@ -1109,58 +1153,6 @@ isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
- Source:
@@ -1312,14 +1299,14 @@ Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
@@ -1374,58 +1361,6 @@ removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
-
-
Face
+number
@@ -1468,16 +1403,14 @@ Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
@@ -1532,81 +1465,56 @@ reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
- - Source:
- -
- classes/face.js, line 283
-
-
+
-
+
-
+
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+ -
+ Type:
+
+ -
+
+
boolean
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
- Source:
@@ -1703,6 +1621,58 @@ signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
@@ -1830,7 +1800,7 @@ Returns:
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
@@ -1934,7 +1904,7 @@ Returns:
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
@@ -299,6 +299,16 @@ boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
@@ -363,6 +373,16 @@ endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
@@ -436,13 +456,13 @@ length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
-
-
number
+boolean
@@ -655,13 +685,13 @@ - @@ -719,13 +749,13 @@
- @@ -774,16 +804,6 @@
- @@ -848,16 +868,6 @@
- @@ -931,13 +941,13 @@
- Source:
- @@ -986,16 +996,6 @@
-
-
-
number
- - -
- - @@ -1078,14 +1078,14 @@
- Source:
- @@ -1163,7 +1163,7 @@
-
-
Array.<Arcs>
+Arc
@@ -1182,14 +1182,14 @@ - Source:
- @@ -1244,6 +1244,58 @@
-
-
number
+boolean
@@ -1286,14 +1338,14 @@ - @@ -1348,6 +1400,58 @@
-
-
Arc
+Array.<Arc>
@@ -1390,14 +1494,14 @@ - @@ -1452,56 +1556,108 @@
- Source: +
- + classes/arc.js, line 214 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1527,7 +1683,7 @@ -
-
boolean
+number
@@ -1546,14 +1702,14 @@ - Source:
- @@ -1650,7 +1806,7 @@
-
-
-
-
- - Type: - -
-
-
number
- - -
-
- distance from arc to shape --
-
- -
-
@@ -1703,18 +1839,14 @@
Returns:
-
-
Segment
+Array.<Points>
- shortest segment between arc and shape (started at arc, ended at shape) --
- -
@@ -1703,18 +1839,14 @@
- @@ -1830,7 +1962,7 @@
-
+
-
+
- + Type: + +
-
+
number
+ + +
+
+ distance from arc to shape ++
+
+ -
-
@@ -1863,14 +2015,18 @@
Returns:
-
-
Array.<Points>
+Segment
+ shortest segment between arc and shape (started at arc, ended at shape) ++
+ -
@@ -1863,14 +2015,18 @@
- @@ -1967,7 +2123,7 @@
-
-
Point
+Array.<Arcs>
@@ -1986,14 +2142,14 @@ - @@ -2071,7 +2227,7 @@
-
-
Arc
+Vector
@@ -2090,16 +2246,14 @@ - @@ -2154,94 +2308,108 @@
- Source: +
- + classes/arc.js, line 377 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2286,14 +2454,14 @@ - Source:
- @@ -2373,13 +2541,13 @@
-
-
Array.<Point>
+Segment
- - @@ -2525,6 +2687,8 @@
-
-
Array.<Arc>
+Arc
@@ -2604,14 +2804,14 @@ - @@ -2681,6 +2881,8 @@
-
-
string
+Arc
@@ -2762,14 +3000,14 @@ - Source:
- @@ -2824,108 +3062,56 @@
- - Type: - -
-
+
Name -Vector
- - -
- - Source: -
- - classes/arc.js, line 355 -
-
+
-
+
-
+ -
-
Vector
+Arc
@@ -2970,15 +3156,14 @@ - @@ -3033,6 +3218,58 @@
-
-
Object
+Array.<Point>
+ - @@ -3139,58 +3378,6 @@
-
-
Arc
+Object
@@ -3233,14 +3420,14 @@ - @@ -3320,13 +3507,13 @@
-
-
Segment
+string
@@ -3401,7 +3588,7 @@ - @@ -344,6 +344,16 @@
- @@ -408,6 +418,16 @@
-
+
+
number
+ + +
+ - @@ -472,6 +492,16 @@
- @@ -536,6 +566,16 @@
- @@ -609,13 +649,13 @@
- @@ -664,16 +704,6 @@
- @@ -738,16 +768,6 @@
- @@ -812,16 +832,6 @@
- @@ -886,16 +896,6 @@
- @@ -1122,7 +1122,7 @@
- @@ -1434,7 +1434,7 @@
-
-
boolean
+Box
- - @@ -1594,7 +1590,7 @@
-
-
Box
+boolean
+ - Source:
- @@ -1750,7 +1750,7 @@
- @@ -2077,60 +2077,6 @@
-
-
string
+Array.<Point>
@@ -2173,14 +2119,14 @@ - @@ -2258,7 +2204,7 @@
-
-
Array.<Point>
+Array.<Segment>
@@ -2277,14 +2223,14 @@ - Source:
- @@ -2339,6 +2285,58 @@
-
-
Array.<Segment>
+string
@@ -2393,7 +2391,7 @@ - @@ -292,6 +292,16 @@
- @@ -356,6 +366,16 @@
-
+
+
number
+ + +
+ - @@ -420,16 +440,6 @@
- @@ -494,16 +504,6 @@
- Source:
- @@ -859,6 +859,8 @@
- @@ -1205,13 +1189,13 @@
-
+
-
+
- + Type: + +
-
+
number
+ + +
+
+ distance from circle to shape ++
+
+ -
-
@@ -1257,14 +1259,18 @@
Returns:
-
-
string
+Segment
+ shortest segment between circle and shape (started at circle, ended at shape) ++
+ -
@@ -1257,14 +1259,18 @@
- @@ -1338,66 +1344,6 @@
-
-
Arc
+Object
@@ -1440,15 +1386,14 @@ - @@ -1503,6 +1448,58 @@
-
-
Object
+string
@@ -1557,7 +1554,7 @@ - @@ -207,6 +207,16 @@
- @@ -280,13 +290,13 @@
- @@ -344,13 +354,13 @@
- @@ -408,13 +418,13 @@
- @@ -472,13 +482,13 @@
- @@ -536,13 +546,13 @@
- @@ -600,13 +610,13 @@
- @@ -664,13 +674,13 @@
- @@ -728,13 +738,13 @@
- @@ -792,13 +802,13 @@
- @@ -856,13 +866,13 @@
- @@ -920,13 +930,13 @@
- @@ -984,13 +994,13 @@
- @@ -1048,13 +1058,13 @@
- @@ -1112,13 +1122,13 @@
- @@ -1176,13 +1186,13 @@
- @@ -1240,13 +1250,13 @@
- @@ -1304,13 +1314,13 @@
- @@ -1359,16 +1369,6 @@
- Source:
- @@ -275,7 +274,10 @@
-
-
number
+Segment
+| + +Arc
@@ -290,13 +292,13 @@ - @@ -345,6 +347,16 @@
- @@ -413,7 +425,7 @@
-
-
*
+Edge
@@ -428,13 +440,13 @@ - @@ -487,7 +499,7 @@
-
-
*
+Face
@@ -502,13 +514,13 @@ - @@ -561,7 +573,7 @@
-
-
*
+number
@@ -576,13 +588,13 @@ - @@ -631,6 +643,16 @@
- @@ -699,7 +721,7 @@
-
-
Face
+*
@@ -714,13 +736,13 @@ - @@ -769,6 +791,16 @@
-
+
+
*
+ + +
+ - @@ -837,7 +869,7 @@
-
-
Edge
+*
@@ -852,13 +884,13 @@ - @@ -907,16 +939,6 @@
-
-
-
*
- - -
- - @@ -981,16 +1003,6 @@
- @@ -1055,19 +1067,6 @@
- @@ -1150,14 +1149,14 @@
- @@ -1212,56 +1211,11 @@
- + Type: + +
-
+
+
Point
+
+ - @@ -1347,11 +1315,56 @@
- - Type: - -
-
-
-
Point
-
- - @@ -345,13 +344,13 @@
- @@ -426,7 +425,7 @@
- @@ -310,13 +294,13 @@
- @@ -374,13 +358,13 @@
- @@ -603,14 +587,14 @@
- @@ -665,6 +649,84 @@
-
-
number
+Face
@@ -707,14 +769,14 @@ - Source:
- @@ -794,13 +856,13 @@
-
-
Edge
+Face
@@ -863,14 +925,14 @@ - @@ -925,82 +987,80 @@
- Source: +
- + classes/face.js, line 283 +
+
+
+
+
+
+
+
+
@@ -1015,26 +1075,12 @@ - - Type: - -
-
-
-
Face
-
- - @@ -1109,58 +1153,6 @@
-
-
boolean
+number
@@ -1203,19 +1195,14 @@ - Source:
- @@ -1312,14 +1299,14 @@
- @@ -1374,58 +1361,6 @@
-
-
Face
+number
@@ -1468,16 +1403,14 @@ - @@ -1532,81 +1465,56 @@
- Source: -
- - classes/face.js, line 283 -
-
+
-
+
-
+ - + Type: + +
-
+
+
boolean
+
+ - Source:
- @@ -1703,6 +1621,58 @@
-
-
number
+Edge
@@ -1745,14 +1715,14 @@ - @@ -1830,7 +1800,7 @@
-
-
string
+Polygon
@@ -1849,14 +1819,14 @@ - @@ -1934,7 +1904,7 @@
-
-
Polygon
+string
@@ -1965,7 +1935,7 @@ - @@ -299,6 +299,16 @@
- @@ -363,6 +373,16 @@
- @@ -436,13 +456,13 @@
Type:
length
+sweep
lengthSource:
length
-pc :Point
+start
- Arc center
+ Get start point of arc
@@ -761,7 +791,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
startAngle<
- Type:
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
Returns:
Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
pc :Point
+start
pcSource:
pcPoint
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
-r :number
+end
- Arc radius
+ Get end point of arc
@@ -835,7 +855,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
startAngle<
- Type:
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
Returns:
Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Point
-
-
-
-
-
@@ -793,13 +813,13 @@ Type:
r :number
+end
rSource:
rnumber
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
-start
+center
- Get start point of arc
+ Get center of arc
@@ -909,7 +919,7 @@ startSource:
start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
startAngle<
- Type:
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
Returns:
Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
-
-
-
-
-
@@ -867,13 +877,13 @@ Type:
start
+center
startSource:
start
-startAngle :number
+length
- Arc start angle in radians
+ Get arc length
@@ -973,7 +983,7 @@ startAngle<
startAngle<
- Type:
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
Returns:
Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
startAngle :number
+length
startAngle<
startAngle<
- Type:
-
-
-
@@ -1005,13 +1005,13 @@ Type:
-sweep
+box
- Get sweep angle in radians. Sweep angle is non-negative number from 0 to 2*PI
+ Get bounding box of the arc
@@ -1047,7 +1047,7 @@ sweepSource:
Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
Returns:
Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
@@ -2446,16 +2610,14 @@ Returns:
- split(pt) → {Array.<Arc>}
+ rotate(angle, center) → {Arc}
- When given point belongs to arc, return array of two arcs split by this point. If points is incident
-to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
-empty array.
+ Return new segment rotated by given angle around given point
If point omitted, rotate around origin (0,0)
Positive value of angle defines rotation counter clockwise, negative - clockwise
@@ -2491,7 +2653,7 @@ splitSource:
Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
--
-
Type:
sweep
+box
sweepSource:
Methods
- breakToFunctional() → {Array.<Arcs>}
+ clone() → {Arc}
- Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
+ Return new cloned instance of arc
@@ -1121,7 +1121,7 @@ brea
Returns:
Returns:
- chordHeight() → {number}
+ contains(pt) → {boolean}
- Returns chord height ("sagitta") of the arc
+ Returns true if arc contains point, false otherwise
@@ -1225,7 +1225,7 @@ chordHeigh
chordHeigh
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ point to test
+
+
+
+
+
+
+
+
+
@@ -1267,7 +1319,7 @@ Returns:
Returns:
- clone() → {Arc}
+ split(pt) → {Array.<Arc>}
- Return new cloned instance of arc
+ When given point belongs to arc, return array of two arcs split by this point. If points is incident
to start or end point of the arc, return clone of the arc. If point does not belong to the arcs, return
empty array.
@@ -1329,7 +1381,7 @@ cloneSource:
cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
Returns:
Returns:
-chordHeight() → {number}
+contains(pt) → {boolean}
chordHeigh
chordHeigh
+ Parameters:
+
+
+
Parameters:
+ + +pt
Point
+
+
+
+ cloneParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ Query point
+
+
+
+
+
+
+
+
+
@@ -1371,7 +1475,7 @@ Returns:
Returns:
- contains(pt) → {boolean}
+ middle() → {Point}
- Returns true if arc contains point, false otherwise
+ Return middle point of the arc
@@ -1433,7 +1537,7 @@ containsSource:
containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
pt
Point
+
+
+
+ containsParameters:
-
-
-
-
-
- Name
-
- Type
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
- pt
-
-
+
+
+
-
-Point
+
+
-
-
+ chordHeight() → {number}
-
+
+
+
+
+
+ Returns chord height ("sagitta") of the arc
+
-
-
- point to test
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ Returns:
Returns:
- distanceTo(shape) → {number|Segment}
+ intersect(shape) → {Array.<Points>}
- Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
+ Returns array of intersection points between arc and other shape
@@ -1589,7 +1745,7 @@ distanceTo<
Parameters:
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+ Shape of the one of supported types
@@ -1674,28 +1830,8 @@ Parameters:
Returns:
-
-
+
@@ -1726,14 +1858,14 @@ Returns:
- intersect(shape) → {Array.<Points>}
+ distanceTo(shape) → {number|Segment}
- Returns array of intersection points between arc and other shape
+ Calculate distance and shortest segment from arc to shape and return array [distance, shortest segment]
@@ -1769,7 +1901,7 @@ intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
pt
Point
+chordHeight() → {number}
- + + + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
Parameters:
Parameters:
Returns:
--
-
Returns:
-intersect(shape) → {Array.<Points>}
+distanceTo(shape) → {number|Segment}
intersectSource:
Parameters:
- Shape of the one of supported types
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1854,8 +1986,28 @@ Parameters:
Returns:
+
+
@@ -1882,14 +2038,14 @@ Returns:
- middle() → {Point}
+ breakToFunctional() → {Array.<Arcs>}
- Return middle point of the arc
+ Breaks arc in extreme point 0, pi/2, pi, 3*pi/2 and returns array of sub-arcs
@@ -1925,7 +2081,7 @@ middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
Parameters:
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
Parameters:
Returns:
+-
+
Returns:
-middle() → {Point}
+breakToFunctional() → {Array.<Arcs>}
middleSource:
Returns:
Returns:
- reverse() → {Arc}
+ tangentInStart() → {Vector}
- Returns new arc with swapped start and end angles and reversed direction
+ Return tangent unit vector in the start point in the direction from start to end
@@ -2029,7 +2185,7 @@ reverseSource:
Returns:
Returns:
- rotate(angle, center) → {Arc}
+ tangentInEnd() → {Vector}
- Return new segment rotated by given angle around given point
-If point omitted, rotate around origin (0,0)
-Positive value of angle defines rotation counter clockwise, negative - clockwise
+ Return tangent unit vector in the end point in the direction from end to start
@@ -2135,7 +2289,7 @@ rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
Returns:
Returns:
-rotate(angle, center) → {Arc}
+tangentInEnd() → {Vector}
rotateSource:
rotateParameters:
-
-
-
-
-
- Name
-
- Type
-
-
- Default
-
- Description
-
-
-
-
-
-
- angle
-
-
-
-
-number
-
-
-
-
-
-
- 0
-
-
-
+
+
-
-
- center
-
-
+
+
+
-
-Point
+
+
-
-
+ reverse() → {Arc}
-
+
+
+
+
+
+ Returns new arc with swapped start and end angles and reversed direction
+
-
-
-
-
-
-
- center point, default is (0,0)
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
- sortPoints(array) → {Array.<Point>}
+ translate(vec) → {Segment}
- Sort given array of points from arc start to end, assuming all points lay on the arc
+ Returns new arc translated by vector vec
@@ -2329,7 +2497,7 @@ sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
Name | - -Type | - - -Default | - -Description | -
---|---|---|---|
angle |
-
-
-
-
-number
-
- |
-
-
- - - 0 - - | - +|
center |
-
-
+
+
+
-
-Point
+
+
-
- |
+ - - | - -- center point, default is (0,0) - - | -
Returns:
-sortPoints(array) → {Array.<Point>}
+translate(vec) → {Segment}
sortPoints<
Parameters:
- array
+ vec
-Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
- of points
+
@@ -2423,17 +2591,13 @@ Returns:
- new array sorted
-
-
array
vec
Array.<Point>
+Vector
@@ -2390,7 +2558,7 @@ Parameters:
Returns:
-split(pt) → {Array.<Arc>}
+rotate(angle, center) → {Arc}
splitSource:
Parameters:
+ Default
+
Description
@@ -2535,7 +2699,39 @@ Parameters:
- pt
+ angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+ rotation angle in radians
+
+
+
+
+
+
+
+
+ center
@@ -2550,9 +2746,13 @@ Parameters:
+
+
+
+
- Query point
+ center point, default is (0,0)
@@ -2585,7 +2785,7 @@ Returns:
Returns:
- svg(attrs) → {string}
+ scale(scaleX, scaleY) → {Arc}
- Return string to draw arc in svg
+ Return new arc scaled by scaleX, scaleY.
@@ -2647,7 +2847,7 @@ svgSource:
Parameters:
+ Default
+
Description
@@ -2691,13 +2893,13 @@ Parameters:
- attrs
+ scaleX
-Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+
+
+ 1
+
+
+
- an object with attributes of svg path element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ scale value by X
+
+
+
+
+
+
+
+
+ scaleY
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+ scale value by Y
@@ -2743,7 +2981,7 @@ Returns:
Returns:
- tangentInEnd() → {Vector}
+ transform(matrix) → {Arc}
- Return tangent unit vector in the end point in the direction from end to start
+ Return new arc transformed using affine transformation matrix
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because
it should create elliptic arc but this package does not support ellipses
Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite
TODO: support non-equal scaling arc to ellipse or throw exception ?
@@ -2805,7 +3043,7 @@ tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
pt
angle
number
+
+
+
+ center
Parameters:
+Parameters:
+Parameters:
attrs
scaleX
Object
+number
@@ -2706,11 +2908,47 @@ Parameters:
+-Defaults are stroke:"black", strokeWidth:"1", fill:"none" + scale value by X + +
scaleY
number
+
+
+
+ Returns:
Returns:
-tangentInEnd() → {Vector}
+transform(matrix) → {Arc}
Note 1. Non-equal scaling by x and y (abs(matrix[0]) != abs(matrix[3])) produce illegal result because it should create elliptic arc but this package does not support ellipses Note 2. Mirror transformation (matrix[0] * matrix[3] < 0) change direction of the arc to the opposite TODO: support non-equal scaling arc to ellipse or throw exception ?
tangentIn
tangentIn
+ Parameters:
+
-
-
-
-
-
-
-
-
-
-
-
-
-Returns:
-
+
+
+
-
-
-
-
-
-
-
-
+ Type
-
-
-
-
-
-
- tangentInStart() → {Vector}
-
-
+
+ Description
+
+
-
- Return tangent unit vector in the start point in the direction from start to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+ matrix
+
-
+
+
+
+Matrix
-
-
+
+
-
-
+ affine transformation matrix
+
+
+
-
-
-
-
-
-
-
-
+
+
@@ -2951,7 +3137,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ sortPoints(array) → {Array.<Point>}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Sort given array of points from arc start to end, assuming all points lay on the arc
@@ -3014,7 +3199,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
@@ -3075,16 +3316,14 @@ Returns:
- transform(matrix) → {Arc}
+ toJSON() → {Object}
- Return new arc transformed using affine transformation matrix
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result
-TODO: support non-equal scaling arc to ellipse or throw exception ?
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -3120,7 +3359,7 @@ transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Parameters:
+ - - - - - - - - - - - -Returns:
- +Type | - - -Description | +|
---|---|---|
matrix |
+
-
+
+
+
+Matrix
-
-
+
+ |
-
- + affine transformation matrix + + | +
Returns:
Returns:
-toJSON() → {Object}
+sortPoints(array) → {Array.<Point>}
toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ array
+
+
+
+
+
+Array.<Point>
+
+
+
+
+
+
+
+
+
+
+ of points
+
+
+
+
+
+
+
+
+
@@ -3056,13 +3293,17 @@ Returns:
+ new array sorted
+
+
Name | + + +Type | + + + + + +Description | +
---|---|---|
array |
+
+
+
+
+
+Array.<Point>
+
+
+
+ |
+
+
+
+
+
+ + of points + + | +
Returns:
Returns:
-transform(matrix) → {Arc}
+toJSON() → {Object}
-Note, that non-equal scaling by x and y (matrix[0] != matrix[3]) produce illegal result -TODO: support non-equal scaling arc to ellipse or throw exception ? + This method returns an object that defines how data will be serialized when called JSON.stringify() method
transformSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
transformParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- matrix
-
-
-
-
-
-Matrix
-
-
-
-
-
-
-
-
-
-
- affine transformation matrix
-
-
-
-
-
-
-
-
-
@@ -3214,7 +3401,7 @@ Returns:
Returns:
- translate(vec) → {Segment}
+ svg(attrs) → {string}
- Returns new arc translated by vector vec
+ Return string to draw arc in svg
@@ -3276,7 +3463,7 @@ translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Name | - - -Type | - - - - - -Description | -
---|---|---|
matrix |
-
-
-
-
-
-Matrix
-
-
-
- |
-
-
-
-
-
- - affine transformation matrix - - | -
Returns:
Returns:
-translate(vec) → {Segment}
+svg(attrs) → {string}
translateSource:
Parameters:
- vec
+ attrs
-Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
-
+ an object with attributes of svg path element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
@@ -3370,7 +3557,7 @@ Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html
index 23eb0d71..212f0452 100644
--- a/docs/Box.html
+++ b/docs/Box.html
@@ -24,7 +24,7 @@
@@ -289,13 +289,13 @@ Members
-box
+xmin :number
- Return property box like all other shapes
+ Minimal x coordinate
@@ -331,7 +331,7 @@ boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Parameters:
vec
attrs
Vector
+Object
@@ -3337,7 +3524,7 @@ Parameters:
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
Returns:
Returns:
diff --git a/docs/Box.html b/docs/Box.html index 23eb0d71..212f0452 100644 --- a/docs/Box.html +++ b/docs/Box.html @@ -24,7 +24,7 @@
Members
box
+xmin :number
boxSource:
boxnumber
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
+
+
+
+
+
@@ -353,13 +363,13 @@ box
-center
+ymin :number
- Return center of the box
+ Minimal y coordinate
@@ -395,7 +405,7 @@ centerSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
centerType:
+
+
+
@@ -417,13 +437,13 @@ center
-high
+xmax :number
- Property high need for interval tree interface
+ Maximal x coordinate
@@ -459,7 +479,7 @@ highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
high
+xmax :number
highSource:
highnumber
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
+
+
+
+
+
@@ -481,13 +511,13 @@ high
-low
+ymax :number
- Property low need for interval tree interface
+ Maximal y coordinate
@@ -523,7 +553,7 @@ lowSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
lownumber
+
+
+
+
+
@@ -545,13 +585,13 @@ low
-max
+low
- Property max returns the box itself !
+ Property low need for interval tree interface
@@ -587,7 +627,7 @@ maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
max
+low
maxSource:
max
-xmax :number
+high
- Maximal x coordinate
+ Property high need for interval tree interface
@@ -651,7 +691,7 @@ xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
xmax :number
+high
xmaxSource:
xmaxnumber
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
-xmin :number
+max
- Minimal x coordinate
+ Property max returns the box itself !
@@ -725,7 +755,7 @@ xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
-
-
-
-
-
@@ -683,13 +713,13 @@ Type:
xmin :number
+max
xminSource:
xminnumber
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
-ymax :number
+center
- Maximal y coordinate
+ Return center of the box
@@ -799,7 +819,7 @@ ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
@@ -1646,14 +1646,14 @@ Returns:
- not_intersect(other_box) → {boolean}
+ equal_to(other_box) → {boolean}
- Returns true if not intersected with other box
+ Returns true if this box is equal to other box, false otherwise
@@ -1689,7 +1689,7 @@ not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
-
-
-
-
-
@@ -757,13 +777,13 @@ Type:
ymax :number
+center
ymaxSource:
ymaxnumber
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
-ymin :number
+box
- Minimal y coordinate
+ Return property box like all other shapes
@@ -873,7 +883,7 @@ yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
@@ -1490,14 +1486,14 @@ Returns:
- merge(other_box) → {Box}
+ less_than(other_box) → {boolean}
- Returns new box merged with other box
+ Defines predicate "less than" between two boxes. Need for interval index
@@ -1533,7 +1529,7 @@ mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
number
-
-
-
-
-
@@ -831,13 +841,13 @@ Type:
ymin :number
+box
yminSource:
yminnumber
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
- equal_to(other_box) → {boolean}
+ not_intersect(other_box) → {boolean}
- Returns true if this box is equal to other box, false otherwise
+ Returns true if not intersected with other box
@@ -1061,7 +1061,7 @@ equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
number
-
-
-
-
-
@@ -1018,14 +1018,14 @@ Returns:
-equal_to(other_box) → {boolean}
+not_intersect(other_box) → {boolean}
equal_toSource:
Parameters:
- query box
+ other box to test
@@ -1330,14 +1330,14 @@ Returns:
- less_than(other_box) → {boolean}
+ merge(other_box) → {Box}
- Defines predicate "less than" between two boxes. Need for interval index
+ Returns new box merged with other box
@@ -1373,7 +1373,7 @@ less_thanSource:
Parameters:
- other box
+ Other box to merge with
@@ -1467,17 +1467,13 @@ Returns:
- - true if this box less than other box, false otherwise
-
-
Parameters:
Returns:
Returns:
-merge(other_box) → {Box}
+less_than(other_box) → {boolean}
mergeSource:
Parameters:
- Other box to merge with
+ other box
@@ -1627,13 +1623,17 @@ Returns:
+ - true if this box less than other box, false otherwise
+
+
Returns:
-not_intersect(other_box) → {boolean}
+equal_to(other_box) → {boolean}
not_inte
Parameters:
- other box to test
+ query box
@@ -2015,14 +2015,14 @@ Parameters:
- svg(attrs) → {string}
+ toPoints() → {Array.<Point>}
- Return string to draw circle in svg
+ Transform box into array of points from low left corner in counter clockwise
@@ -2058,7 +2058,7 @@ svgSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
svg
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- attrs
-
-
-
-
-
-Object
-
-
-
-
-
-
-
-
-
-
- an object with attributes of svg rectangle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
-
-
-
-
-
-
-
-
-
@@ -2154,7 +2100,7 @@ Returns:
Returns:
- toPoints() → {Array.<Point>}
+ toSegments() → {Array.<Segment>}
- Transform box into array of points from low left corner in counter clockwise
+ Transform box into array of segments from low left corner in counter clockwise
@@ -2216,7 +2162,7 @@ toPointsSource:
Returns:
Returns:
- toSegments() → {Array.<Segment>}
+ svg(attrs) → {string}
- Transform box into array of segments from low left corner in counter clockwise
+ Return string to draw circle in svg
@@ -2320,7 +2266,7 @@ toSegments<
toSegments<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -2362,7 +2360,7 @@ Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html
index 56f2072e..ced5c831 100644
--- a/docs/Circle.html
+++ b/docs/Circle.html
@@ -24,7 +24,7 @@
@@ -237,13 +237,13 @@ Members
-box
+pc :Point
- Circle bounding box
+ Circle center
@@ -279,7 +279,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
attrs
Object
-
-
-
- -Defaults are stroke:"black", strokeWidth:"1", fill:"none" - -
Returns:
Returns:
-toSegments() → {Array.<Segment>}
+svg(attrs) → {string}
toSegments<
toSegments<
+ Parameters:
+
+
+
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
attrs |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+
+ an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill" Defaults are stroke:"black", strokeWidth:"1", fill:"none" + + |
+
Returns:
Returns:
diff --git a/docs/Circle.html b/docs/Circle.html index 56f2072e..ced5c831 100644 --- a/docs/Circle.html +++ b/docs/Circle.html @@ -24,7 +24,7 @@
Members
box
+pc :Point
boxSource:
boxPoint
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Point
+
+
+
+
+
@@ -301,13 +311,13 @@ box
-center
+r :number
- Circle center
+ Circle radius
@@ -343,7 +353,7 @@ centerSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
centerType:
+
+
+
@@ -365,7 +385,7 @@ center
-pc :Point
+center
@@ -407,7 +427,7 @@ pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
pc :Point
+center
@@ -407,7 +427,7 @@pcSource:
pcPoint
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
-r :number
+box
- Circle radius
+ Circle bounding box
@@ -481,7 +491,7 @@ rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Point
-
-
-
-
-
@@ -439,13 +449,13 @@ Type:
r :number
+box
rSource:
rnumber
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
- distanceTo(shape) → {number|Segment}
+ toArc(counterclockwise) → {Arc}
- Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
+ Transform circle to closed arc
@@ -825,7 +825,7 @@ distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
number
-
-
-
-
-
@@ -782,14 +782,14 @@ Returns:
-distanceTo(shape) → {number|Segment}
+toArc(counterclockwise) → {Arc}
distanceTo<
Parameters:
+ Default
+
Description
@@ -869,13 +871,13 @@ Parameters:
- shape
+ counterclockwise
-Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+
+
+ true
+
+
+
- Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
+
@@ -910,28 +918,8 @@ Parameters:
Returns:
-
+
@@ -1118,14 +1102,14 @@ Returns:
- svg(attrs) → {string}
+ distanceTo(shape) → {number|Segment}
- Return string to draw circle in svg
+ Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]
@@ -1161,7 +1145,7 @@ svgSource:
Parameters:
- attrs
+ shape
-Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
- an object with attributes of svg circle element,
-like "stroke", "strokeWidth", "fill"
-Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+ Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
@@ -1248,8 +1230,28 @@ Parameters:
Returns:
+
+
@@ -1276,14 +1282,14 @@ Returns:
- toArc(counterclockwise) → {Arc}
+ toJSON() → {Object}
- Transform circle to closed arc
+ This method returns an object that defines how data will be
serialized when called JSON.stringify() method
@@ -1319,7 +1325,7 @@ toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
shape
counterclockwise
Shape
+boolean
@@ -884,9 +886,15 @@ Parameters:
+Returns:
- +Parameters:
attrs
shape
Object
+Shape
@@ -1222,9 +1206,7 @@ Parameters:
-Defaults are stroke:"black", strokeWidth:"1", fill:"none" + Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set
Parameters:
Returns:
+-
+
Returns:
-toArc(counterclockwise) → {Arc}
+toJSON() → {Object}
toArcSource:
toArcParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- counterclockwise
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1421,7 +1367,7 @@ Returns:
Returns:
- toJSON() → {Object}
+ svg(attrs) → {string}
- This method returns an object that defines how data will be
-serialized when called JSON.stringify() method
+ Return string to draw circle in svg
@@ -1484,7 +1429,7 @@ toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Name | - - -Type | - - - - -Default | - - -Description | -
---|---|---|---|
counterclockwise |
-
-
-
-
-
-boolean
-
-
-
- |
-
-
-
-
- - - true - - | - - -- - - | -
Returns:
Returns:
-toJSON() → {Object}
+svg(attrs) → {string}
toJSONSource:
toJSONParameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ attrs
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill"
Defaults are stroke:"black", strokeWidth:"1", fill:"none"
+
+
+
+
+
+
+
+
+
@@ -1526,7 +1523,7 @@ Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html
index 704d44dd..1ac8c214 100644
--- a/docs/CircularLinkedList.html
+++ b/docs/CircularLinkedList.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
CircularLinkedList
- Class implements circular bidirectional linked list
-LinkedListElement - object of any type that has properties next and prev.
+ Class implements circular bidirectional linked list
LinkedListElement - object of any type that has properties next and prev.
@@ -664,7 +663,7 @@ Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html
index d01021fe..035b2c9d 100644
--- a/docs/DE9IM.html
+++ b/docs/DE9IM.html
@@ -24,7 +24,7 @@
@@ -152,13 +152,13 @@ Members
-B2B
+m :Array.<Shape>
- Get Boundary To Boundary intersection
+ Array representing 3x3 intersection matrix
@@ -194,7 +194,7 @@ B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
@@ -1507,7 +1503,7 @@ Returns:
diff --git a/docs/Edge.html b/docs/Edge.html
index e415d39f..591c8e3e 100644
--- a/docs/Edge.html
+++ b/docs/Edge.html
@@ -24,7 +24,7 @@
@@ -45,8 +45,7 @@
Edge
- Class representing an edge of polygon. Edge shape may be Segment or Arc.
-Each edge contains references to the next and previous edges in the face of the polygon.
+ Class representing an edge of polygon. Edge shape may be Segment or Arc.
Each edge contains references to the next and previous edges in the face of the polygon.
@@ -216,13 +215,13 @@ Members
-arc_length :number
+shape :Segment|Arc
- "Arc distance" from the face start
+ Shape of the edge: Segment or Arc
@@ -258,7 +257,7 @@ arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Name | + + +Type | + + + + + +Description | +
---|---|---|
attrs |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+
+
+ an object with attributes of svg circle element,
like "stroke", "strokeWidth", "fill" Defaults are stroke:"black", strokeWidth:"1", fill:"none" + + |
+
Returns:
Returns:
diff --git a/docs/CircularLinkedList.html b/docs/CircularLinkedList.html index 704d44dd..1ac8c214 100644 --- a/docs/CircularLinkedList.html +++ b/docs/CircularLinkedList.html @@ -24,7 +24,7 @@
CircularLinkedList
--LinkedListElement - object of any type that has properties next and prev.
LinkedListElement - object of any type that has properties next and prev.
Returns:
diff --git a/docs/DE9IM.html b/docs/DE9IM.html index d01021fe..035b2c9d 100644 --- a/docs/DE9IM.html +++ b/docs/DE9IM.html @@ -24,7 +24,7 @@
Members
B2B
+m :Array.<Shape>
B2BSource:
B2BArray.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
Array.<Shape>
+
+
+
+
+
@@ -216,13 +226,13 @@ B2B
-B2B
+I2I
- Set Boundary to Boundary intersection
+ Get Interior To Interior intersection
@@ -258,7 +268,7 @@ B2BSource:
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
B2B
-B2E
+I2I
- Get Boundary To Exterior intersection
+ Set Interior To Interior intersection
@@ -322,7 +332,7 @@ B2ESource:
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
B2E
-B2E
+I2B
- Set Boundary to Exterior intersection
+ Get Interior To Boundary intersection
@@ -386,7 +396,7 @@ B2ESource:
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
B2E
-B2I
+I2B
- Get Boundary To Interior intersection
+ Set Interior to Boundary intersection
@@ -450,7 +460,7 @@ B2ISource:
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
B2I
-B2I
+I2E
- Set Boundary to Interior intersection
+ Get Interior To Exterior intersection
@@ -514,7 +524,7 @@ B2ISource:
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
B2I
-E2B
+I2E
- Get Exterior To Boundary intersection
+ Set Interior to Exterior intersection
@@ -578,7 +588,7 @@ E2BSource:
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
E2B
-E2B
+B2I
- Set Exterior to Boundary intersection
+ Get Boundary To Interior intersection
@@ -642,7 +652,7 @@ E2BSource:
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
E2B
-E2E
+B2I
- Get Exterior to Exterior intersection
+ Set Boundary to Interior intersection
@@ -706,7 +716,7 @@ E2ESource:
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
E2E
-E2E
+B2B
- Set Exterior to Exterior intersection
+ Get Boundary To Boundary intersection
@@ -770,7 +780,7 @@ E2ESource:
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
E2E
-E2I
+B2B
- Get Exterior To Interior intersection
+ Set Boundary to Boundary intersection
@@ -834,7 +844,7 @@ E2ISource:
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
E2I
-E2I
+B2E
- Set Exterior to Interior intersection
+ Get Boundary To Exterior intersection
@@ -898,7 +908,7 @@ E2ISource:
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
E2I
-I2B
+B2E
- Get Interior To Boundary intersection
+ Set Boundary to Exterior intersection
@@ -962,7 +972,7 @@ I2BSource:
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
I2B
-I2B
+E2I
- Set Interior to Boundary intersection
+ Get Exterior To Interior intersection
@@ -1026,7 +1036,7 @@ I2BSource:
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
I2B
-I2E
+E2I
- Get Interior To Exterior intersection
+ Set Exterior to Interior intersection
@@ -1090,7 +1100,7 @@ I2ESource:
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
I2E
-I2E
+E2B
- Set Interior to Exterior intersection
+ Get Exterior To Boundary intersection
@@ -1154,7 +1164,7 @@ I2ESource:
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
I2E
-I2I
+E2B
- Get Interior To Interior intersection
+ Set Exterior to Boundary intersection
@@ -1218,7 +1228,7 @@ I2ISource:
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
I2I
-I2I
+E2E
- Set Interior To Interior intersection
+ Get Exterior to Exterior intersection
@@ -1282,7 +1292,7 @@ I2ISource:
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
I2I
-m :Array.<Shape>
+E2E
- Array representing 3x3 intersection matrix
+ Set Exterior to Exterior intersection
@@ -1346,7 +1356,7 @@ mSource:
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
mArray.<Shape>
-
-
-
-
-
@@ -1394,11 +1394,7 @@ toString
- Return de9im matrix as string where
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT'
+ Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
-- intersection is 'T'
-- not intersected is 'F'
-- not relevant is '*'
-For example, string 'FF**FF****' means 'DISJOINT' + Return de9im matrix as string where
- intersection is 'T'
- not intersected is 'F'
- not relevant is '*'
For example, string 'FF**FF****' means 'DISJOINT'
Returns:
diff --git a/docs/Edge.html b/docs/Edge.html index e415d39f..591c8e3e 100644 --- a/docs/Edge.html +++ b/docs/Edge.html @@ -24,7 +24,7 @@
Edge
-Members
arc_length :number
+shape :Segment|Arc
arc_length<
Type:
Type:
-box
+next :Edge
- Get bounding box of the edge
+ Pointer to the next edge in the face
@@ -332,7 +334,7 @@ boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
box
+next :Edge
boxSource:
boxEdge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Edge
+
+
+
+
+
@@ -354,13 +366,13 @@ box
-bv :*
+prev :Edge
- Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
+ Pointer to the previous edge in the face
@@ -396,7 +408,7 @@ bvSource:
Type:
Type:
-bvEnd :*
+face :Face
- End inclusion flag (inside/outside/boundary)
+ Pointer to the face containing this edge
@@ -470,7 +482,7 @@ bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
Type:
bvEnd :*
+face :Face
bvEndSource:
Type:
Type:
-bvStart :*
+arc_length :number
- Start inclusion flag (inside/outside/boundary)
+ "Arc distance" from the face start
@@ -544,7 +556,7 @@ bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
bvStart :*
+arc_length :number
bvStartSource:
Type:
Type:
-end
+bvStart :*
- Get edge end point
+ Start inclusion flag (inside/outside/boundary)
@@ -618,7 +630,7 @@ endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
end
+bvStart :*
endSource:
end*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
*
+
+
+
+
+
@@ -640,13 +662,13 @@ end
-face :Face
+bvEnd :*
- Pointer to the face containing this edge
+ End inclusion flag (inside/outside/boundary)
@@ -682,7 +704,7 @@ faceSource:
Type:
Type:
-length
+bv :*
- Get edge length
+ Edge inclusion flag (Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY)
@@ -756,7 +778,7 @@ lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
Type:
length
+bv :*
lengthSource:
lengthType:
+
+
+
@@ -778,13 +810,13 @@ length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
-
+
length
-next :Edge
+overlap :*
- Pointer to the next edge in the face
+ Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
@@ -820,7 +852,7 @@ nextSource:
Type:
Type:
-overlap :*
+start
- Overlap flag for boundary edge (Flatten.OVERLAP_SAME/Flatten.OVERLAP_OPPOSITE)
+ Get edge start point
@@ -894,7 +926,7 @@ overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
Type:
overlap :*
+start
overlapSource:
overlapType:
-
-
-
@@ -926,13 +948,13 @@ Type:
-prev :Edge
+end
- Pointer to the previous edge in the face
+ Get edge end point
@@ -968,7 +990,7 @@ prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
-
-
Type:
prev :Edge
+end
prevSource:
prevEdge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
-shape :Segment|Arc
+length
- Shape of the edge: Segment or Arc
+ Get edge length
@@ -1042,7 +1054,7 @@ shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Edge
-
-
-
-
-
@@ -1000,13 +1012,13 @@ Type:
shape :Segment|Arc
+length
shapeSource:
shapeType:
-
-
@@ -1077,13 +1076,13 @@ Type:
-start
+box
- Get edge start point
+ Get bounding box of the edge
@@ -1119,7 +1118,7 @@ startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
@@ -1396,8 +1395,7 @@ setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Type:
start
+box
startSource:
Methods
- contains(pt)
+ middle() → {Point}
- Returns true if point belongs to the edge, false otherwise
+ Get middle point of the edge
@@ -1193,7 +1192,7 @@ containsSource:
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
containsParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- pt
-
-
-
-
-
-Point
-
-
-
-
-
-
- test point
-
-
-
-
-
-
@@ -1269,12 +1223,26 @@ Parameters:
+
+Returns:
+
+
+
+
+
@@ -1285,14 +1253,14 @@ Parameters:
- middle() → {Point}
+ contains(pt)
- Get middle point of the edge
+ Returns true if point belongs to the edge, false otherwise
@@ -1328,7 +1296,7 @@ middleSource:
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
pt
Point
-
-
- Returns:
+ +-
+
middleParameters:
+
+
+
+
+
+ Name
+
+ Type
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
@@ -1359,26 +1372,12 @@ middle
-Returns:
-
-
-
-
-
pt
Point
+
+
+
+ Returns:
- --
-
setInclus
- Set inclusion flag of the edge with respect to another polygon
-Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
+ Set inclusion flag of the edge with respect to another polygon
Inclusion flag is one of Flatten.INSIDE, Flatten.OUTSIDE, Flatten.BOUNDARY
@@ -1527,8 +1525,7 @@ setOverlap<
- Set overlapping between two coincident boundary edges
-Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
+ Set overlapping between two coincident boundary edges
Overlapping flag is one of Flatten.OVERLAP_SAME or Flatten.OVERLAP_OPPOSITE
@@ -1663,7 +1660,7 @@ Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html
index df9d5e41..c0fe26ee 100644
--- a/docs/Errors.html
+++ b/docs/Errors.html
@@ -24,7 +24,7 @@
@@ -216,14 +216,13 @@ (static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Parameters:
diff --git a/docs/Errors.html b/docs/Errors.html index df9d5e41..c0fe26ee 100644 --- a/docs/Errors.html +++ b/docs/Errors.html @@ -24,7 +24,7 @@
(static)
-(static) INFINITE_LOOP
+(static) ZERO_DIVISION
- Error to throw from LinkedList:testInfiniteLoop static method
-in case when circular loop detected in linked list
+ Throw error ZERO_DIVISION to catch situation of zero division
@@ -259,7 +258,7 @@ (static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
(static) INFINITE_LOOP
+(static) ZERO_DIVISION
(static) Source:
-(static) ZERO_DIVISION
+(static) INFINITE_LOOP
- Throw error ZERO_DIVISION to catch situation of zero division
+ Error to throw from LinkedList:testInfiniteLoop static method
in case when circular loop detected in linked list
@@ -387,7 +386,7 @@ (static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
(static) ZERO_DIVISION
+(static) INFINITE_LOOP
(static) Source:
(static)
diff --git a/docs/Face.html b/docs/Face.html
index d0c0be0c..c7fd1767 100644
--- a/docs/Face.html
+++ b/docs/Face.html
@@ -24,7 +24,7 @@
@@ -45,13 +45,7 @@
Face
- Class representing a face (closed loop) in a polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
-
-Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
-Container of edges is a property of the polygon object.
+ Class representing a face (closed loop) in a polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself.
Container of edges is a property of the polygon object.
@@ -141,17 +135,7 @@ new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
@@ -246,13 +230,13 @@ _box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Face
-polygon
object.
-Face is a circular bidirectional linked list of edges
.
-Face object cannot be instantiated with a constructor.
-Instead, use polygon.addFace()
method.
--Note, that face only set entry point to the linked list of edges but does not contain edges by itself. -Container of edges is a property of the polygon object.
polygon
object.
Face is a circular bidirectional linked list of edges
.
Face object cannot be instantiated with a constructor.
Instead, use polygon.addFace()
method.
Note, that face only set entry point to the linked list of edges but does not contain edges by itself. Container of edges is a property of the polygon object.
new Face
Example
- // Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
+ // Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
// Face implements "next" iterator which enables to iterate edges in for loop:
-for (let edge of face) {
- console.log(edge.shape.length) // do something
-}
-
-// Instead, it is possible to iterate edges as linked list, starting from face.first:
-let edge = face.first;
-do {
- console.log(edge.shape.length); // do something
- edge = edge.next;
-} while (edge != face.first)
// Face implements "next" iterator which enables to iterate edges in for loop:
for (let edge of face) {
console.log(edge.shape.length) // do something
}
// Instead, it is possible to iterate edges as linked list, starting from face.first:
let edge = face.first;
do {
console.log(edge.shape.length); // do something
edge = edge.next;
} while (edge != face.first)
_box
-box
+edges
- Return bounding box of the face
+ Return array of edges from first to last
@@ -288,7 +272,7 @@ boxSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
box
-edges
+shapes
- Return array of edges from first to last
+ Return array of shapes which comprise face
@@ -352,7 +336,7 @@ edgesSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
edges
-shapes
+box
- Return array of shapes which comprise face
+ Return bounding box of the face
@@ -416,7 +400,7 @@ shapesSource:
Returns:
- area() → {number}
+ insert(newEdge, edgeBefore) → {Face}
- Returns the absolute value of the area of the face
+ Insert edge newEdge into the linked list after the edge edgeBefore
@@ -646,7 +630,7 @@ areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Returns:
-area() → {number}
+insert(newEdge, edgeBefore) → {Face}
areaSource:
area
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ newEdge
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to be inserted into linked list
+
+
+
+
+
+
+
+
+ edgeBefore
+
+
+
+
+
+Edge
+
+
+
+
+
+
+
+
+
+
+ Edge to insert newEdge after it
+
+
+
+
+
+
+
+
+
@@ -688,7 +750,7 @@ Returns:
Returns:
- findEdgeByPoint(pt) → {Edge}
+ remove(edge) → {Face}
- Returns edge which contains given point
+ Remove the given edge from the linked list of the face
@@ -750,7 +812,7 @@ findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
newEdge
Edge
+
+
+
+ edgeBefore
Edge
+
+
+
+ Returns:
Returns:
-findEdgeByPoint(pt) → {Edge}
+remove(edge) → {Face}
findEd
Parameters:
- pt
+ edge
-Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
- test point
+ Edge to be removed
@@ -844,7 +906,7 @@ Returns:
Returns:
- insert(newEdge, edgeBefore) → {Face}
+ reverse()
- Insert edge newEdge into the linked list after the edge edgeBefore
+ Reverse orientation of the face: first edge become last and vice a verse,
all edges starts and ends swapped, direction of arcs inverted. If face was oriented
clockwise, it becomes counter clockwise and vice versa
@@ -906,7 +968,7 @@ insertSource:
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
pt
edge
Point
+Edge
@@ -811,7 +873,7 @@ Parameters:
+ Reverse orientation of the face: first edge become last and vice a verse, all edges starts and ends swapped, direction of arcs inverted. If face was oriented clockwise, it becomes counter clockwise and vice versa
insertParameters:
-
-
-
-
-
- Name
-
- Type
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Description
-
-
+
+
+ setArcLength()
-
-
-
- newEdge
-
-
-
-
-Edge
+
+ Set arc_length property for each of the edges in the face.
Arc_length of the edge it the arc length from the first edge of the face
+
-
-
-
-
-
- Edge to be inserted into linked list
-
-
-
+
+
-
-
- edgeBefore
-
+
-
-
-
-Edge
+
+
-
-
+
-
+
-
+
-
- Edge to insert newEdge after it
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+ Parameters:
-
-Returns:
-
-
-
-
-
@@ -1045,16 +1091,14 @@ Returns:
- isSimple(edges) → {boolean}
+ area() → {number}
- Returns true if face of the polygon is simple (no self-intersection points found)
-NOTE: this method is incomplete because it does not exclude touching points.
-Self intersection test should check if polygon change orientation in the test point.
+ Returns the absolute value of the area of the face
@@ -1090,7 +1134,7 @@ isSimpleSource:
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
setArcLength()
- -newEdge
Edge
+-
-
edgeBefore
Edge
+
+
-
- Returns:
- --
-
isSimpleParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edges
-
-
-
-
-
-Edges
-
-
-
-
-
-
-
-
-
-
- reference to polygon.edges to provide search index
-
-
-
-
-
-
-
-
-
@@ -1184,7 +1176,7 @@ Returns:
Returns:
- orientation() → {number}
+ signedArea() → {number}
- Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
-According to Green theorem the area of a closed curve may be calculated as double integral,
-and the sign of the integral will be defined by the direction of the curve.
-When the integral ("signed area") will be negative, direction is counter clockwise,
-when positive - clockwise and when it is zero, polygon is not orientable.
-See https://mathinsight.org/greens_theorem_find_area
+ Returns signed area of the simple face.
Face is simple if it has no self intersections that change its orientation.
Then the area will be positive if the orientation of the face is clockwise,
and negative if orientation is counterclockwise.
It may be zero if polygon is degenerated.
@@ -1251,7 +1238,7 @@ orientatio
Returns:
- remove(edge) → {Face}
+ orientation() → {number}
- Remove the given edge from the linked list of the face
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral,
and the sign of the integral will be defined by the direction of the curve.
When the integral ("signed area") will be negative, direction is counter clockwise,
when positive - clockwise and when it is zero, polygon is not orientable.
See https://mathinsight.org/greens_theorem_find_area
@@ -1355,7 +1342,7 @@ removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
edges
Edges
-
-
-
- -According to Green theorem the area of a closed curve may be calculated as double integral, -and the sign of the integral will be defined by the direction of the curve. -When the integral ("signed area") will be negative, direction is counter clockwise, -when positive - clockwise and when it is zero, polygon is not orientable. -See https://mathinsight.org/greens_theorem_find_area + Returns signed area of the simple face. Face is simple if it has no self intersections that change its orientation. Then the area will be positive if the orientation of the face is clockwise, and negative if orientation is counterclockwise. It may be zero if polygon is degenerated.
Returns:
-remove(edge) → {Face}
+orientation() → {number}
+ Return face orientation: one of Flatten.ORIENTATION.CCW, Flatten.ORIENTATION.CW, Flatten.ORIENTATION.NOT_ORIENTABLE
According to Green theorem the area of a closed curve may be calculated as double integral, and the sign of the integral will be defined by the direction of the curve. When the integral ("signed area") will be negative, direction is counter clockwise, when positive - clockwise and when it is zero, polygon is not orientable. See https://mathinsight.org/greens_theorem_find_area
removeSource:
removeParameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- edge
-
-
-
-
-
-Edge
-
-
-
-
-
-
-
-
-
-
- Edge to be removed
-
-
-
-
-
-
-
-
-
@@ -1449,7 +1384,7 @@ Returns:
Returns:
- reverse()
+ isSimple(edges) → {boolean}
- Reverse orientation of the face: first edge become last and vice a verse,
-all edges starts and ends swapped, direction of arcs inverted. If face was oriented
-clockwise, it becomes counter clockwise and vice versa
+ Returns true if face of the polygon is simple (no self-intersection points found)
NOTE: this method is incomplete because it does not exclude touching points.
Self intersection test should check if polygon change orientation in the test point.
@@ -1513,7 +1446,7 @@ reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Name | - - -Type | - - - - - -Description | -
---|---|---|
edge |
-
-
-
-
-
-Edge
-
-
-
- |
-
-
-
-
-
- - Edge to be removed - - | -
Returns:
Returns:
-reverse()
+isSimple(edges) → {boolean}
reverseSource:
reverse
-
-
-
-
-
-
- setArcLength()
-
-
-
-
-
-
- Set arc_length property for each of the edges in the face.
-Arc_length of the edge it the arc length from the first edge of the face
-
-
-
-
-
-
-
-
-
-
+ Parameters:
-
+
+
+
+
+ Name
+
-
+ Type
-
+
-
+
-
+ Description
+
+
+
-
+
+
+ edges
+
-
+
+
+
+Edges
-
-
+
+
-
-
+ reference to polygon.edges to provide search index
+
+
+
-
+
+
@@ -1621,12 +1529,26 @@ setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pt
+
+
+
+
+
+Point
+
+
+
+
+
+
+
+
+
+
+ test point
+
+
+
+
+
+
+
+
+
@@ -1726,7 +1696,7 @@ Returns:
Returns:
- svg() → {string}
+ toPolygon() → {Polygon}
- Returns string to be assigned to "d" attribute inside defined "path"
+ Returns new polygon created from one face
@@ -1788,7 +1758,7 @@ svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
setArcLength()
- - - - - --
-
-
-
+
Parameters:
- +Name | + - +Type | - + - + - +Description | +
---|---|---|
edges |
+
-
+
+
+
+Edges
-
-
+
+ |
-
- + reference to polygon.edges to provide search index + + | +
setArcLen
+
+Returns:
+
+
+
+
+
@@ -1637,18 +1559,14 @@ setArcLen
- signedArea() → {number}
+ findEdgeByPoint(pt) → {Edge}
- Returns signed area of the simple face.
-Face is simple if it has no self intersections that change its orientation.
-Then the area will be positive if the orientation of the face is clockwise,
-and negative if orientation is counterclockwise.
-It may be zero if polygon is degenerated.
+ Returns edge which contains given point
@@ -1684,7 +1602,7 @@ signedArea<
signedArea<
+ Parameters:
+
+
+
Returns:
+ +-
+
signedArea() → {number}
+findEdgeByPoint(pt) → {Edge}
signedArea<
signedArea<
+ Parameters:
+
+
+
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
pt |
+
+
+
+
+
+Point
+
+
+
+ |
+
+
+
+
+
+ + test point + + | +
Returns:
Returns:
-svg() → {string}
+toPolygon() → {Polygon}
svgSource:
Returns:
Returns:
- toPolygon() → {Polygon}
+ svg() → {string}
- Returns new polygon created from one face
+ Returns string to be assigned to "d" attribute inside defined "path"
@@ -1892,7 +1862,7 @@ toPolygonSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html
index 852bc2d1..aad0284f 100644
--- a/docs/Line.html
+++ b/docs/Line.html
@@ -24,7 +24,7 @@
@@ -244,13 +244,13 @@ Members
-box
+pt :Point
- Returns infinite box
+ Point a line passes through
@@ -286,7 +286,7 @@ boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Returns:
Returns:
diff --git a/docs/Line.html b/docs/Line.html index 852bc2d1..aad0284f 100644 --- a/docs/Line.html +++ b/docs/Line.html @@ -24,7 +24,7 @@
Members
box
+pt :Point
boxSource:
boxPoint
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Point
+
+
+
+
+
@@ -308,13 +318,13 @@ box
-end
+norm :Vector
- Line has no end point
+ Normal vector to a line
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0
@@ -350,7 +360,7 @@ endSource:
endVector
+
+
+
+
+
@@ -372,13 +392,13 @@ end
-length
+end
- Return positive infinity number as length
+ Line has no end point
@@ -414,7 +434,7 @@ lengthSource:
length
-middle
+length
- Middle point is undefined
+ Return positive infinity number as length
@@ -478,7 +498,7 @@ middleSource:
Vector is normalized (length == 1)
Direction of the vector is chosen to satisfy inequality norm * p >= 0