@eturnity/eturnity_maths 7.2.2-qa-7.2.4 → 7.2.2-qa-7.2.6
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 +1 -1
- package/src/geometry.js +1 -1
- package/src/intersectionPolygon.js +8 -3
package/package.json
CHANGED
package/src/geometry.js
CHANGED
|
@@ -21,7 +21,7 @@ export function getConcaveOutlines(selectedPanels,onePanelOutline){
|
|
|
21
21
|
for(let bucketIndex=0;bucketIndex<buckets.length;bucketIndex++){
|
|
22
22
|
outlines.push(getConcaveOutline(selectedPanels.filter((p,i)=>buckets[bucketIndex].includes(i)),onePanelOutline))
|
|
23
23
|
}
|
|
24
|
-
return outlines
|
|
24
|
+
return {outlines,buckets}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export function getConcaveOutline(selectedPanels,onePanelOutline){
|
|
@@ -73,6 +73,7 @@ export function logicOperationOnPolygons(outline1,outline2,mode='intersect')
|
|
|
73
73
|
return {outline:[p,fig2[(index+1)%fig2.length]]}
|
|
74
74
|
})
|
|
75
75
|
let intersections = getIntersections({outline:fig1}, edges)
|
|
76
|
+
|
|
76
77
|
//2. gather all nodes+intersection in a list[[x,y],[x,y]]
|
|
77
78
|
const nodeList = getNodeList(intersections, edges, {outline:fig1})
|
|
78
79
|
//3. generate all edges not cut, those cut and those from construction polyline
|
|
@@ -86,9 +87,13 @@ export function logicOperationOnPolygons(outline1,outline2,mode='intersect')
|
|
|
86
87
|
1
|
|
87
88
|
)
|
|
88
89
|
//4. run planar-face-discovery to get all cycles and rebuild our polygons
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
try{
|
|
91
|
+
const outlineList = getOutlineList(nodeList, edgeList)
|
|
92
|
+
return filterPolygons(outlineList, fig1, fig2, mode)
|
|
93
|
+
}catch(err){
|
|
94
|
+
console.error("error with getOutlineList",nodeList, edgeList,err)
|
|
95
|
+
return []
|
|
96
|
+
}
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
function filterPolygons(polygons, fig1, fig2, mode) {
|