build-dxf 0.0.49 → 0.0.50
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/README.md +50 -1
- package/package.json +1 -1
- package/src/build.js +17 -16
- package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +1 -1
package/README.md
CHANGED
|
@@ -105,4 +105,53 @@ import "build-dxf/index.css"
|
|
|
105
105
|
import data from "../data/d4.json"
|
|
106
106
|
import dp8 from "../data/dp8.json"
|
|
107
107
|
</script>
|
|
108
|
-
```
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
# 内置类
|
|
111
|
+
### 1. 核心类
|
|
112
|
+
1. DxfSystem
|
|
113
|
+
|
|
114
|
+
### 核心组件类
|
|
115
|
+
1. Dxf
|
|
116
|
+
2. AngleCorrectionDxf
|
|
117
|
+
3. DoorsAnalysis
|
|
118
|
+
4. ThreeVJia
|
|
119
|
+
5. Variable
|
|
120
|
+
|
|
121
|
+
### 2. 渲染插件组件类
|
|
122
|
+
1. Renderer
|
|
123
|
+
2. DomContainer
|
|
124
|
+
3. DomEventRegister
|
|
125
|
+
4. EventInput
|
|
126
|
+
5. DetailsPointRender
|
|
127
|
+
6. ModelDataRender
|
|
128
|
+
7. OriginalLineRender
|
|
129
|
+
|
|
130
|
+
### 3. 模型数据提供插件组件类
|
|
131
|
+
1. DetailsPoint
|
|
132
|
+
2. DxfLineModel
|
|
133
|
+
3. WhiteModel
|
|
134
|
+
|
|
135
|
+
### 4. 编辑器插件组件类
|
|
136
|
+
|
|
137
|
+
##### 编辑器管理组件类
|
|
138
|
+
1. RenderManager
|
|
139
|
+
2. Editor
|
|
140
|
+
|
|
141
|
+
##### 命令流组件类
|
|
142
|
+
1. CommandFlowComponent
|
|
143
|
+
2. Default
|
|
144
|
+
3. ClippingLine
|
|
145
|
+
4. ConnectionLine
|
|
146
|
+
5. DeleteSelectLine
|
|
147
|
+
6. DeleteSelectWindow
|
|
148
|
+
7. DrawDoorLine
|
|
149
|
+
8. DrawLine
|
|
150
|
+
9. DrawWindow
|
|
151
|
+
10. IntersectionConnectionLine
|
|
152
|
+
11. MergeLine
|
|
153
|
+
12. PointDrag
|
|
154
|
+
13. SelectAll
|
|
155
|
+
14. VerticalCorrection
|
|
156
|
+
15. VerticalReferenceLine
|
|
157
|
+
16. ViewAngle
|
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -2807,8 +2807,8 @@ function _e(u, t, e) {
|
|
|
2807
2807
|
function ke(u) {
|
|
2808
2808
|
const t = u.filter((n) => n.userData.isBayWindow), e = /* @__PURE__ */ new Set();
|
|
2809
2809
|
return t.forEach((n) => {
|
|
2810
|
-
|
|
2811
|
-
if (s.length) {
|
|
2810
|
+
let s = Wt(u, [n], !1);
|
|
2811
|
+
if (s = s.filter((i) => i.some((r) => r.userData.isWindow && O.hasType(r, "bayWindow"))), s.length) {
|
|
2812
2812
|
const i = s[0], r = $();
|
|
2813
2813
|
i.forEach((o) => {
|
|
2814
2814
|
O.clear(o), O.set(o, r, "bayWindow"), e.add(o);
|
|
@@ -2817,10 +2817,11 @@ function ke(u) {
|
|
|
2817
2817
|
}), u.forEach((n) => e.has(n) || O.clear(n)), u;
|
|
2818
2818
|
}
|
|
2819
2819
|
function Ye(u) {
|
|
2820
|
-
|
|
2821
|
-
|
|
2820
|
+
const t = $();
|
|
2821
|
+
for (let e = 0; e < u.length; e++) {
|
|
2822
|
+
const n = u[e];
|
|
2822
2823
|
let { endIntersection: s, startIntersection: i } = n.userData;
|
|
2823
|
-
if (O.replace(n,
|
|
2824
|
+
if (O.replace(n, t, "door") || O.set(n, t, "door"), !(!s || !i)) {
|
|
2824
2825
|
if (i.userData.fittedLine && (i = i.userData.fittedLine), s.userData.fittedLine && (s = s.userData.fittedLine), n.parallel(i))
|
|
2825
2826
|
n.start.distance(i.start) < n.start.distance(i.end) ? n.start.copy(i.start) : n.start.copy(i.end);
|
|
2826
2827
|
else {
|
|
@@ -3738,17 +3739,17 @@ class He {
|
|
|
3738
3739
|
doors = [];
|
|
3739
3740
|
lineAnalysis;
|
|
3740
3741
|
continueFind = !0;
|
|
3741
|
-
constructor(t) {
|
|
3742
|
-
this.lineAnalysis = t, this.dxf = t.Dxf, this.findPointVirtualGrid = new q(), this.quadtree = t.quadtree, this.resultList = t.resultList, this.lineSegments = t.lineSegmentList, this.dxf.doorLineSegment.length = 0, this.lineSegments.forEach((
|
|
3743
|
-
this.pointVirtualGrid.insert(
|
|
3742
|
+
constructor(t, e) {
|
|
3743
|
+
this.lineAnalysis = t, this.dxf = t.Dxf, this.findPointVirtualGrid = new q(), this.quadtree = t.quadtree, this.resultList = t.resultList, this.lineSegments = t.lineSegmentList, this.dxf.doorLineSegment.length = 0, this.lineSegments.forEach((r) => {
|
|
3744
|
+
this.pointVirtualGrid.insert(r.start, r), this.pointVirtualGrid.insert(r.end, r);
|
|
3744
3745
|
});
|
|
3745
|
-
const { doorPoints:
|
|
3746
|
-
this.doorPoint =
|
|
3747
|
-
const
|
|
3748
|
-
this.addPointsExcludeRule((
|
|
3749
|
-
const
|
|
3750
|
-
return typeof
|
|
3751
|
-
}), this.addPointsExcludeRule((
|
|
3746
|
+
const { doorPoints: n, calculatedDoorPoint: s } = this.getDoorPoint();
|
|
3747
|
+
if (this.doorPoint = n, this.calculatedDoorPoint = s, e) return;
|
|
3748
|
+
const i = this.searchDoubleLinePoint();
|
|
3749
|
+
this.addPointsExcludeRule((r, o, a) => {
|
|
3750
|
+
const c = this.lineSegments.indexOf(r), l = i.get(c);
|
|
3751
|
+
return typeof l == "number" ? l === -1 || l === a : !1;
|
|
3752
|
+
}), this.addPointsExcludeRule((r, o) => !!this.doorPoint.find((a) => a.point.equal(o))), this.addPointsExcludeRule((r, o) => !!this.calculatedDoorPoint.find((a) => a.point.equal(o))), this.possibleDoorPoints = this.getPossiblePoints(), this.possibleDoorPoints.forEach((r) => this.findPointVirtualGrid.insert(r.point, r.line)), this.handle();
|
|
3752
3753
|
}
|
|
3753
3754
|
handle() {
|
|
3754
3755
|
this.dxf.doorLineSegment.push(...this.search(this.doorPoint, this.possibleDoorPoints, 0.5)), this.dxf.doors.length < 2 && this.dxf.doorLineSegment.push(...this.search(this.possibleDoorPoints, this.possibleDoorPoints, 0.6));
|
|
@@ -4046,7 +4047,7 @@ class $e extends z {
|
|
|
4046
4047
|
onAddFromParent(t) {
|
|
4047
4048
|
const e = t.findComponentByType(W), n = this.parent?.findComponentByType(Qt);
|
|
4048
4049
|
e.addEventListener("createGroup", () => {
|
|
4049
|
-
this.
|
|
4050
|
+
this.DoorsAnalysis = new He(n, this.skipFindDoor), this.needsSaveDoor && (this.doors = e.doors.map((s) => e.lineSegments[s[4]])), this.skipFindDoor = !1, this.dispatchEvent({ type: "analysisCompleted" });
|
|
4050
4051
|
});
|
|
4051
4052
|
}
|
|
4052
4053
|
}
|
|
@@ -33,7 +33,7 @@ declare class DoorsAnalysis {
|
|
|
33
33
|
doors: LineSegment[];
|
|
34
34
|
lineAnalysis: LineAnalysis;
|
|
35
35
|
continueFind: boolean;
|
|
36
|
-
constructor(lineAnalysis: LineAnalysis);
|
|
36
|
+
constructor(lineAnalysis: LineAnalysis, skipFindDoor: boolean);
|
|
37
37
|
private handle;
|
|
38
38
|
/** 查找
|
|
39
39
|
* @param doorPoints
|