@eturnity/eturnity_maths 7.2.0 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -25,6 +25,12 @@ export function doLineSegmentsIntersect(A, B, C, D) {
|
|
|
25
25
|
export function isSelfIntersecting(outline, isClosePolygon = true) {
|
|
26
26
|
let isSelfIntersecting = false
|
|
27
27
|
const length = outline.length
|
|
28
|
+
//check if two nodes are in same position
|
|
29
|
+
for (let k = 0; k < length; k++) {
|
|
30
|
+
let A = outline[k]
|
|
31
|
+
let B = outline[(k + 1)%length]
|
|
32
|
+
if(isSamePoint2D(A,B)) return true
|
|
33
|
+
}
|
|
28
34
|
if (length < 4) return false
|
|
29
35
|
let closeOffset=isClosePolygon?0:1
|
|
30
36
|
//let AB and CD be two edges we are testing for intersection
|