build-dxf 0.1.149 → 0.1.150
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
package/src/build.js
CHANGED
|
@@ -9110,11 +9110,18 @@ class WallHole {
|
|
|
9110
9110
|
* @param source
|
|
9111
9111
|
*/
|
|
9112
9112
|
static splitHole(target, source) {
|
|
9113
|
-
if (!Array.isArray(source)) source = [];
|
|
9114
|
-
|
|
9113
|
+
if (!Array.isArray(source)) source = [source];
|
|
9114
|
+
if (target instanceof LineSegment) {
|
|
9115
|
+
this.filterIllegal(target);
|
|
9116
|
+
const iterator = this.getIterator(target);
|
|
9117
|
+
this.splitHole([...iterator], source);
|
|
9118
|
+
this.clear(target);
|
|
9119
|
+
return;
|
|
9120
|
+
} else if (!Array.isArray(target)) {
|
|
9121
|
+
throw new Error("传入参数非孔洞数组或线段");
|
|
9122
|
+
}
|
|
9115
9123
|
source = source.filter((line) => line.length > 1e-9);
|
|
9116
|
-
const
|
|
9117
|
-
for (const hole of iterator) {
|
|
9124
|
+
for (const hole of target) {
|
|
9118
9125
|
let find = false, min = Infinity, maxLine = null;
|
|
9119
9126
|
for (let i = 0; i < source.length; i++) {
|
|
9120
9127
|
const line = source[i];
|
|
@@ -9139,7 +9146,6 @@ class WallHole {
|
|
|
9139
9146
|
this.addHole(maxLine, hole);
|
|
9140
9147
|
}
|
|
9141
9148
|
}
|
|
9142
|
-
this.clear(target);
|
|
9143
9149
|
}
|
|
9144
9150
|
}
|
|
9145
9151
|
const WH = WallHole;
|
|
@@ -11037,6 +11043,8 @@ function mergeLineUserData(newLine, line2) {
|
|
|
11037
11043
|
return line2.forEach((l) => mergeLineUserData(newLine, l));
|
|
11038
11044
|
}
|
|
11039
11045
|
WallHole.cancelPairing(newLine, line2);
|
|
11046
|
+
if (line2.userData.isDoor === false) delete line2.userData.isDoor;
|
|
11047
|
+
if (line2.userData.isWindow === false) delete line2.userData.isWindow;
|
|
11040
11048
|
if (line2.userData.isBayWindow === false) delete line2.userData.isBayWindow;
|
|
11041
11049
|
if (line2.userData.isPassageEntrance === false) delete line2.userData.isPassageEntrance;
|
|
11042
11050
|
if (newLine.userData.isPassageEntrance === false) delete newLine.userData.isPassageEntrance;
|
|
@@ -11962,6 +11970,7 @@ class AlignToParallelSegments {
|
|
|
11962
11970
|
}
|
|
11963
11971
|
const intersectPoints = intersectList.filter((item) => item.userData.length > 1e-5).map((item) => item.point);
|
|
11964
11972
|
layoutDesign(group2, axisLine, intersectPoints, opt);
|
|
11973
|
+
opt.onLayoutDesign?.(group2, DELETE_SYMBOL);
|
|
11965
11974
|
}
|
|
11966
11975
|
return groups.flat().filter((line) => {
|
|
11967
11976
|
if (line.length < 1e-9) return false;
|
|
@@ -12130,8 +12139,9 @@ function correction(lines, targettLine, option) {
|
|
|
12130
12139
|
lines = AxisAlignCorr.start(lines, targettLine);
|
|
12131
12140
|
const bayWindow = lines.filter((line) => line.userData.isBayWindow).map((line) => line.center);
|
|
12132
12141
|
lines = splitIntersectedLine(lines, 1e-9);
|
|
12142
|
+
WallHole.filterIllegal(lines).merge(lines);
|
|
12133
12143
|
lines = LineSegmentUtils.GroupBuilder(LineSegmentUtils.group(lines, (line) => line.userData.isBalconyRailing ? "balconyRailing" : "lines")).handle("lines", (lines2) => {
|
|
12134
|
-
|
|
12144
|
+
lines2 = AlignToParallelSegments.align(lines2, {
|
|
12135
12145
|
onMergeLine: mergeLineUserData,
|
|
12136
12146
|
onGroup(group2, projValues, axis) {
|
|
12137
12147
|
if (group2.length <= 1) return;
|
|
@@ -12141,9 +12151,18 @@ function correction(lines, targettLine, option) {
|
|
|
12141
12151
|
line.userData.wallWidth = dist;
|
|
12142
12152
|
});
|
|
12143
12153
|
},
|
|
12144
|
-
|
|
12145
|
-
|
|
12154
|
+
onLayoutDesign(lines3, delKey) {
|
|
12155
|
+
const holes = [];
|
|
12156
|
+
lines3 = lines3.filter((line) => {
|
|
12157
|
+
holes.push(...WallHole.getIterator(line));
|
|
12158
|
+
WallHole.clear(line);
|
|
12159
|
+
return !line.currentData[delKey];
|
|
12160
|
+
});
|
|
12161
|
+
WallHole.splitHole(holes, lines3);
|
|
12162
|
+
}
|
|
12163
|
+
// onSegmentClippedAway: WallHole.splitHole.bind(WallHole)
|
|
12146
12164
|
});
|
|
12165
|
+
return lines2;
|
|
12147
12166
|
}).handle("balconyRailing", (lines2) => AlignToParallelSegments.align(lines2)).merge();
|
|
12148
12167
|
WallHole.merge(lines);
|
|
12149
12168
|
lines = adsorption(lines, option);
|
|
@@ -129,6 +129,6 @@ export declare class WallHole {
|
|
|
129
129
|
* @param target
|
|
130
130
|
* @param source
|
|
131
131
|
*/
|
|
132
|
-
static splitHole(target: LineSegment<LineUserData
|
|
132
|
+
static splitHole(target: LineSegment<LineUserData> | HoleData[], source: LineSegment<LineUserData> | LineSegment<LineUserData>[]): void;
|
|
133
133
|
}
|
|
134
134
|
export declare const WH: typeof WallHole;
|
package/src/index3.js
CHANGED
|
@@ -18163,7 +18163,7 @@ class DefaultCommand extends Command {
|
|
|
18163
18163
|
});
|
|
18164
18164
|
for await (const line2 of lineSelector) {
|
|
18165
18165
|
if (!line2) return;
|
|
18166
|
-
if (line2.
|
|
18166
|
+
if (line2.currentData.insertObject) {
|
|
18167
18167
|
this.setSelectHoleLine(line2);
|
|
18168
18168
|
} else {
|
|
18169
18169
|
if (eventInput.isKeyDown("alt")) return this.removeSelectLine(line2);
|
|
@@ -6,6 +6,7 @@ export interface AlignDescriptor {
|
|
|
6
6
|
onMergeLine?: (target: LineSegment, source: LineSegment) => void;
|
|
7
7
|
onGroup?: OnGroupFun;
|
|
8
8
|
onSegmentClippedAway?: (target: LineSegment, clipLines: LineSegment[]) => void;
|
|
9
|
+
onLayoutDesign?: (lines: LineSegment[], DELETE_SYMBOL: symbol) => void;
|
|
9
10
|
}
|
|
10
11
|
/** 通过平行轴和垂直轴分组对齐线段,搭配垂直纠正使用
|
|
11
12
|
*/
|