build-dxf 0.1.69 → 0.1.71
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/build.js +10 -11
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -6159,7 +6159,7 @@ class BayWindowHelper {
|
|
|
6159
6159
|
for (let i = 0; i < lines.length; i++) {
|
|
6160
6160
|
const line = lines[i];
|
|
6161
6161
|
if (line.userData.isBayWindow) bayWindowLine = line;
|
|
6162
|
-
else if (line.userData.isWindow && line.userData.drawWindow) windowLine = line;
|
|
6162
|
+
else if (line.userData.isWindow && line.userData.drawWindow && line.userData.drawWindow.length) windowLine = line;
|
|
6163
6163
|
else deptLine = line;
|
|
6164
6164
|
}
|
|
6165
6165
|
if (bayWindowLine && windowLine && deptLine) {
|
|
@@ -6197,7 +6197,7 @@ class BayWindowHelper {
|
|
|
6197
6197
|
for (let i = 0; i < lines.length; i++) {
|
|
6198
6198
|
const line = lines[i];
|
|
6199
6199
|
if (line.userData.isBayWindow) bayWindowLine = line;
|
|
6200
|
-
else if (line.userData.isWindow && line.userData.drawWindow) windowLine = line;
|
|
6200
|
+
else if (line.userData.isWindow && line.userData.drawWindow && line.userData.drawWindow.length) windowLine = line;
|
|
6201
6201
|
}
|
|
6202
6202
|
if (bayWindowLine && windowLine) {
|
|
6203
6203
|
const { width, height, groundClearance } = windowLine.userData.drawWindow[0];
|
|
@@ -17869,17 +17869,16 @@ class SceneAutoGenerat {
|
|
|
17869
17869
|
}
|
|
17870
17870
|
buildPlane(lines) {
|
|
17871
17871
|
lines = lineSegmentClipping(lines, 0);
|
|
17872
|
-
lines
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
|
|
17876
|
-
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
const doors = lines2.filter((line) => line.userData.isDoor), maxiCircles2 = new MaxiCircles(), { circles } = maxiCircles2.miniCircle(lines2, { circleEdges: doors, side: Side.IN }), { circles: outCircles } = maxiCircles2.miniCircle(lines2, { circleEdges: doors, side: Side.OUT }), ploys = circles.map(((p2) => Polygon.fromByLinePath(p2)));
|
|
17872
|
+
LineSegment.groupByPath(lines).forEach((group2, i) => {
|
|
17873
|
+
const removeSet = findDiscretePointLine2(group2, null, true);
|
|
17874
|
+
lines = group2.filter((line) => !removeSet.has(line) && !line.userData.isBayWindow);
|
|
17875
|
+
const doors = lines.filter((line) => line.userData.isDoor), maxiCircles2 = new MaxiCircles(), { circles } = maxiCircles2.miniCircle(lines, { circleEdges: doors, side: Side.IN }), { circles: outCircles } = maxiCircles2.miniCircle(lines, { circleEdges: doors, side: Side.OUT }), ploys = circles.map(((p2) => Polygon.fromByLinePath(p2))), ploys2 = LineGroupType.getGroupsByType(group2, "bayWindow").map((lines2) => {
|
|
17876
|
+
const poly = Polygon.fromByLines2(lines2);
|
|
17877
|
+
if (poly.closedLoop()) return poly;
|
|
17878
|
+
}).filter((poly) => !!poly);
|
|
17880
17879
|
outCircles.forEach((circle) => {
|
|
17881
17880
|
const polygon2 = Polygon.fromByLinePath(circle);
|
|
17882
|
-
const newPolys = Polygon.booleanOp(polygon2, ploys, { scale: 100, type: "Difference" });
|
|
17881
|
+
const newPolys = Polygon.booleanOp(polygon2, [...ploys, ...ploys2], { scale: 100, type: "Difference" });
|
|
17883
17882
|
newPolys.forEach((poly, j) => {
|
|
17884
17883
|
const geometry = this.createGeometryByLines(poly.toLines());
|
|
17885
17884
|
const mesh = new THREE.Mesh(geometry, new THREE.MeshStandardMaterial({ color: 11184810, side: THREE.DoubleSide }));
|