build-dxf 0.1.114 → 0.1.115
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 +38 -34
- package/src/dxf-system/plugins/editor/components/CommandFlow/CFComponent.d.ts +4 -0
- package/src/dxf-system/plugins/editor/components/CommandFlow/DrawHole.d.ts +3 -2
- package/src/dxf-system/plugins/editor/components/RenderManager.d.ts +7 -7
- package/src/index.css +4 -0
- package/src/index.js +10 -10
- package/src/index3.js +244 -98
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -3322,7 +3322,7 @@ class LineSegmentUtils {
|
|
|
3322
3322
|
static GroupBuilder(groups) {
|
|
3323
3323
|
const builder = {
|
|
3324
3324
|
handle(k, fn2) {
|
|
3325
|
-
groups[k] = fn2(groups[k]
|
|
3325
|
+
if (groups[k]) groups[k] = fn2(groups[k]);
|
|
3326
3326
|
return builder;
|
|
3327
3327
|
},
|
|
3328
3328
|
merge() {
|
|
@@ -11369,20 +11369,22 @@ function correction(lines, targettLine, option) {
|
|
|
11369
11369
|
lines = AxisAlignCorr.start(lines, targettLine);
|
|
11370
11370
|
const bayWindow = lines.filter((line) => line.userData.isBayWindow).map((line) => line.center);
|
|
11371
11371
|
lines = lineSegmentClipping(lines, 1e-9);
|
|
11372
|
-
lines =
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
line
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11372
|
+
lines = LineSegmentUtils.GroupBuilder(LineSegmentUtils.group(lines, (line) => line.userData.isBalconyRailing ? "balconyRailing" : "lines")).handle("lines", (lines2) => {
|
|
11373
|
+
return AlignToParallelSegments.align(lines2, {
|
|
11374
|
+
onMergeLine: mergeLineUserData,
|
|
11375
|
+
onGroup(group, projValues, axis) {
|
|
11376
|
+
if (group.length <= 1) return;
|
|
11377
|
+
const max = Math.max(...projValues);
|
|
11378
|
+
const min = Math.min(...projValues);
|
|
11379
|
+
const dist = precision4((max - min) * axis.length);
|
|
11380
|
+
if (dist < DEFAULT_WALL_WIDTH) return;
|
|
11381
|
+
group.forEach((line) => {
|
|
11382
|
+
line.userData.wallWidth = dist;
|
|
11383
|
+
});
|
|
11384
|
+
}
|
|
11385
|
+
// esp: 0.2
|
|
11386
|
+
});
|
|
11387
|
+
}).handle("balconyRailing", (lines2) => AlignToParallelSegments.align(lines2)).merge();
|
|
11386
11388
|
lines = adsorption(lines, option);
|
|
11387
11389
|
lines = lineSegmentClipping(lines, 1e-9);
|
|
11388
11390
|
lines = recoveryBayWindow(lines, bayWindow);
|
|
@@ -23196,29 +23198,31 @@ export {
|
|
|
23196
23198
|
SelectLocalFile as S,
|
|
23197
23199
|
ThreeVJia as T,
|
|
23198
23200
|
Variable as V,
|
|
23199
|
-
|
|
23201
|
+
WallGroupManager as W,
|
|
23200
23202
|
Point as a,
|
|
23201
|
-
|
|
23203
|
+
Pipeline as b,
|
|
23202
23204
|
cloneUserData as c,
|
|
23203
|
-
|
|
23205
|
+
WallInsertObject as d,
|
|
23204
23206
|
LineSegmentUtils as e,
|
|
23205
|
-
|
|
23207
|
+
LineSegment as f,
|
|
23206
23208
|
getDefaultExportFromCjs as g,
|
|
23207
|
-
|
|
23208
|
-
|
|
23209
|
-
|
|
23210
|
-
|
|
23211
|
-
|
|
23209
|
+
createQuadtree as h,
|
|
23210
|
+
Lines as i,
|
|
23211
|
+
drawText$1 as j,
|
|
23212
|
+
mergeChains as k,
|
|
23213
|
+
mmTom as l,
|
|
23212
23214
|
mToMm as m,
|
|
23213
|
-
|
|
23214
|
-
|
|
23215
|
-
|
|
23216
|
-
|
|
23217
|
-
|
|
23218
|
-
|
|
23219
|
-
|
|
23215
|
+
LinePipeline as n,
|
|
23216
|
+
WhiteModel as o,
|
|
23217
|
+
CommandManager as p,
|
|
23218
|
+
index as q,
|
|
23219
|
+
buildJson as r,
|
|
23220
|
+
createEditor as s,
|
|
23221
|
+
index$2 as t,
|
|
23220
23222
|
uuid as u,
|
|
23221
|
-
|
|
23222
|
-
|
|
23223
|
-
|
|
23223
|
+
getFileAll as v,
|
|
23224
|
+
getGlobalDxfSystem as w,
|
|
23225
|
+
getModels as x,
|
|
23226
|
+
hasCircle as y,
|
|
23227
|
+
index$3 as z
|
|
23224
23228
|
};
|
|
@@ -133,6 +133,8 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
|
|
|
133
133
|
radius?: number;
|
|
134
134
|
}): {
|
|
135
135
|
readonly ended: boolean;
|
|
136
|
+
paused(): void;
|
|
137
|
+
resume(): void;
|
|
136
138
|
next: (mode_?: "all" | "door" | "wall" | "window" | "none") => Promise<LineSegment<Record<string, any>> | null>;
|
|
137
139
|
end: () => void;
|
|
138
140
|
lines(mode_: "all" | "door" | "wall" | "window" | "none"): {
|
|
@@ -147,6 +149,8 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
|
|
|
147
149
|
};
|
|
148
150
|
awaitEach(mode_: "all" | "door" | "wall" | "window" | "none", callBack: (line: LineSegment | undefined, self: any) => void): Promise<{
|
|
149
151
|
readonly ended: boolean;
|
|
152
|
+
paused(): void;
|
|
153
|
+
resume(): void;
|
|
150
154
|
next: (mode_?: "all" | "door" | "wall" | "window" | "none") => Promise<LineSegment<Record<string, any>> | null>;
|
|
151
155
|
end: () => void;
|
|
152
156
|
lines(mode_: "all" | "door" | "wall" | "window" | "none"): {
|
|
@@ -16,6 +16,7 @@ export declare class DrawHole extends CommandFlowComponent<{
|
|
|
16
16
|
container: THREE.Group<THREE.Object3DEventMap>;
|
|
17
17
|
static shortcutKeys: string[];
|
|
18
18
|
static commandName: string;
|
|
19
|
+
defaultWidth: number;
|
|
19
20
|
onAddFromParent(parent: ComponentSystem): void;
|
|
20
21
|
/** 选择开始点
|
|
21
22
|
* @param next
|
|
@@ -27,11 +28,11 @@ export declare class DrawHole extends CommandFlowComponent<{
|
|
|
27
28
|
/** 回滚操作
|
|
28
29
|
* @param data
|
|
29
30
|
*/
|
|
30
|
-
protected onRollback(data: Data):
|
|
31
|
+
protected onRollback(data: Data): Data;
|
|
31
32
|
/** 撤回回滚
|
|
32
33
|
* @param data
|
|
33
34
|
* @returns
|
|
34
35
|
*/
|
|
35
|
-
protected onRevokeRollback(data: Data):
|
|
36
|
+
protected onRevokeRollback(data: Data): Data;
|
|
36
37
|
}
|
|
37
38
|
export {};
|
|
@@ -52,10 +52,10 @@ export declare class RenderManager extends Component<{
|
|
|
52
52
|
* @param lines
|
|
53
53
|
*/
|
|
54
54
|
removeLines(lines: LineSegment<LineUserData>[]): void;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
55
|
+
/** 创建几何体
|
|
56
|
+
* @param rectangle
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
createGeometry(map: Record<string, number[]>, count: number): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
|
|
59
59
|
lineAdsorption: import('vue').Ref<boolean, boolean>;
|
|
60
60
|
pointAdsorption: import('vue').Ref<boolean, boolean>;
|
|
61
61
|
/** 获取鼠标当前点, 吸附后的点
|
|
@@ -75,10 +75,6 @@ export declare class RenderManager extends Component<{
|
|
|
75
75
|
private lineDashedText1;
|
|
76
76
|
private lineDashedText2;
|
|
77
77
|
setAuxiliaryLineVisible(b: boolean): void;
|
|
78
|
-
/** 创建几何体
|
|
79
|
-
* @param rectangle
|
|
80
|
-
*/
|
|
81
|
-
createGeometry(map: Record<string, number[]>, count: number): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
|
|
82
78
|
/**
|
|
83
79
|
* 转为json
|
|
84
80
|
*/
|
|
@@ -88,6 +84,10 @@ export declare class RenderManager extends Component<{
|
|
|
88
84
|
* 同步到dxf
|
|
89
85
|
*/
|
|
90
86
|
synchronizeDxf(): void;
|
|
87
|
+
/**
|
|
88
|
+
* 绘制
|
|
89
|
+
*/
|
|
90
|
+
draw(synchronize?: boolean): void;
|
|
91
91
|
get renderer(): Renderer;
|
|
92
92
|
get dxf(): Dxf;
|
|
93
93
|
get variable(): Variable;
|
package/src/index.css
CHANGED
package/src/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "three";
|
|
2
|
-
import {
|
|
2
|
+
import { q, r, s, t, v, w, x, y, z } from "./build.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
q as ModelDataPlugin,
|
|
5
|
+
r as buildJson,
|
|
6
|
+
s as createEditor,
|
|
7
|
+
t as dxfSystem,
|
|
8
|
+
v as getFileAll,
|
|
9
|
+
w as getGlobalDxfSystem,
|
|
10
|
+
x as getModels,
|
|
11
|
+
y as hasCircle,
|
|
12
|
+
z as utils
|
|
13
13
|
};
|
package/src/index3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, C as Component, P as PointSpatialHash, Q as Quadtree, B as Box2, a as Point, L as LineDashed, c as cloneUserData,
|
|
1
|
+
import { g as getDefaultExportFromCjs, C as Component, P as PointSpatialHash, Q as Quadtree, B as Box2, a as Point, L as LineDashed, c as cloneUserData, b as Pipeline, W as WallGroupManager, d as WallInsertObject, e as LineSegmentUtils, V as Variable, f as LineSegment, h as createQuadtree, u as uuid, m as mToMm, i as Lines, H as HeightQuery, j as drawText, k as mergeChains, l as mmTom, n as LinePipeline, R as Rectangle, D as DEFAULT_WALL_WIDTH, o as WhiteModel, T as ThreeVJia, S as SelectLocalFile, M as MiniCircles, p as CommandManager } from "./build.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { InstancedBufferGeometry, Float32BufferAttribute, InstancedInterleavedBuffer, InterleavedBufferAttribute, WireframeGeometry, Box3, Sphere, Vector3, ShaderMaterial, ShaderLib, UniformsUtils, Vector2, UniformsLib, Mesh, Vector4, Line3, Matrix4, MathUtils, Group } from "three";
|
|
4
4
|
import "clipper-lib";
|
|
@@ -11013,7 +11013,6 @@ message.closeAllByPlacement = closeAllByPlacement;
|
|
|
11013
11013
|
message._context = null;
|
|
11014
11014
|
const ElMessage = withInstallFunction(message, "$message");
|
|
11015
11015
|
const textureUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAKdUlEQVR4AeydbZrUKBRGq2YjOjvpWYntStSVjK5EdzLOSsr7arBLOkkBAcLHmacwlQQInMsZUvdP/3Xhv+oEbrfbk5XYz1P1gfLAC4KwCCCwQwBBduBwCwIIwhqAwA4BBNmBwy0IFBQEuBDonwCC9B9DZlCQAIIUhEvX/RNAkP5jyAwKEkCQgnDpun8CfQrSP3dm0AkBBOkkUAzzHAIIcg53ntoJAQTpJFAM8xwCCHIOd57aCQEE8QLFKQTuCSDIPQ2+Q8AjgCAeEE4hcE8AQe5p8B0CHgEE8YBwCoF7AghyT6Psd3rvkACCdBg0hlyPAILUY82TOiSAIB0GjSHXI4Ag9VjzpA4JIEiHQXs9ZK6UIoAgpcjS7xAEEGSIMDKJUgQQpBRZ+h2CAIIMEUYmUYoAgpQiO0q/k88DQSZfAEx/nwCC7PPh7uQEEGTyBcD09wkgyD4f7k5OAEEmXwBnTr+HZyNID1FijKcRQBAP/e12e2vl2cqHUsUe+c5K7OddqfG4fmMHNEN9BPGifL1ev9ulN1Y+FizP1nfsR21Kjun/2AHNUB9BVqJsknyyy1qMdpji89nm/HmKmUZOEkE2gNmCkSTaTTZqDHP5m831/TCz+TWRbP8iyA5KWzh/2+2RJfluc/zH5shngwCCbIC5u6wFNKIkmhM7x12g174iyBqVu2v2f1gtpBFft97b3L7dTZWvKwQQZAWKf8kWkn7Aqvi3ej1HjsDIIUggKJNEu8gImS0yVoExV7XXgugqZZXAIoleuVbvd3CRjFVkkB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xyxACOomBcJv9M8/CQnAaQ7Ddz2hyUag0kl+loTQQFiuIR47U6mt6hITkdINmR5rgMCpN5Hk/Sq+bTI63pAJh8W5WvvOhj/1a/Vv+5Xq9hITktILlxmPMAhR82AxTmKSPAAgQ5WhAxmIPlKndZm84hITk9INPWYk6cw0IjixJZMhQMn25QUJ9p/Xpvmz3hIBEgr7QacyawMCSZRhYc7AWYDEQePmUovNi3qKzpioZE6cXzKw82+yxFgKzwiDkVWBiGfbTtDAxrHI3DazdKYKAMIhoRwsy4ZiC6D59WSHh3yTXQnESA3Llu3Y45GGD4Vuk3NHbsanczh8ngAA8NGoBINPBHiWu4nsS9GQSyBgb2iWjkYUW5Xt40zipFfannm9c+uKB6JBEgD9TfesqcPgUHeGjQRB0SDfxR4hquJ3HvECA80tD0cg+JAHnkQZ2rroB3SARI9SagAt5SoDAkf71V3pbzAmSLWrq2mgIFIfla0kgBUlJN5XVIgXWQvFkEvwNcLIoIkDf11gUtFSgESTGTBUgxKZVRKQUKQMLj3yLmCJAiMiqT0goUgKSISQKkiIzKpIYCByAp9g5JgNTwrPIspsAOSPg2jU9zttuwcIcAWRBFh3wpsAESPv8p+m2aAPHVFmTNKwokSPjW7bXoQOTgO7hXcth3WIDs0013dVDAIAEOIAAUPnTkw06+b7NT16KRI1dPgGQltA6hwPV65YNQEh908mFnsQn5kgACZEkVHZMCSYFSgKTstJICYykgQMbyp2pTWAEBUlhQZTeWAgJkLH+qNoUVECCFBVV2YykQAJCxBFdtYikgQGL5S9Y2VkCANBZcxcVSQIDE8pesbayAuWiilwAAAD9JREFUAGksuIqLpcC5AYnlK1nbQQEB0kF0FRlHAQESx1eytIMCAqSD6CoyjgICJI6vZGkHBQRIJdGV7RgK/AMAAP//4C6KhwAAAAZJREFUAwD4/NzNgTbrjAAAAABJRU5ErkJggg==";
|
|
11017
11016
|
class Debouncing {
|
|
11018
11017
|
timeoutId = null;
|
|
11019
11018
|
delay;
|
|
@@ -11038,7 +11037,6 @@ class Debouncing {
|
|
|
11038
11037
|
}
|
|
11039
11038
|
const loader = new THREE.TextureLoader();
|
|
11040
11039
|
const texture = loader.load(textureUrl);
|
|
11041
|
-
const searchTexture = loader.load(searchTextureUrl);
|
|
11042
11040
|
class RenderManager extends Component {
|
|
11043
11041
|
static name = "RenderManager";
|
|
11044
11042
|
container = new THREE.Group();
|
|
@@ -11135,77 +11133,15 @@ class RenderManager extends Component {
|
|
|
11135
11133
|
for (let i = 0; i < lines.length; i++) this.removeLine(lines[i], false);
|
|
11136
11134
|
this.draw();
|
|
11137
11135
|
}
|
|
11138
|
-
/**
|
|
11139
|
-
*
|
|
11136
|
+
/** 创建几何体
|
|
11137
|
+
* @param rectangle
|
|
11140
11138
|
*/
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
if (line2.userData.isBayWindow) {
|
|
11146
|
-
line2.points.forEach((p) => bayWindowPoint.push(p.x, p.y, 0));
|
|
11147
|
-
return;
|
|
11148
|
-
}
|
|
11149
|
-
line2.points.forEach((p) => {
|
|
11150
|
-
if (line2.userData.isDoor) doorPosition.push(p.x, p.y, 0);
|
|
11151
|
-
else position.push(p.x, p.y, 0);
|
|
11152
|
-
});
|
|
11153
|
-
if (line2.userData.isDoor && line2.userData.doorAutomaticFind) findDoorPoint.push(line2.center);
|
|
11154
|
-
if (line2.userData.isWindow && line2.userData.drawWindow) {
|
|
11155
|
-
line2.userData.drawWindow.forEach(({ width, p }) => {
|
|
11156
|
-
const center = Point.from(p), direction = line2.direction(), start = center.clone().add(direction.clone().multiplyScalar(width * 0.5)), end = center.clone().add(direction.clone().multiplyScalar(-width * 0.5));
|
|
11157
|
-
windowPosition.push(start.x, start.y, 1e-3);
|
|
11158
|
-
windowPosition.push(end.x, end.y, 1e-3);
|
|
11159
|
-
});
|
|
11160
|
-
}
|
|
11161
|
-
if (line2.userData.isVerticalReferenceLine) {
|
|
11162
|
-
const pos = line2.center;
|
|
11163
|
-
this.verticalReferenceLineFlag.position.set(pos.x, pos.y, 0);
|
|
11164
|
-
this.container.add(this.verticalReferenceLineFlag);
|
|
11165
|
-
}
|
|
11166
|
-
if (line2.userData.isPassageEntrance) {
|
|
11167
|
-
line2.userData.passageEntrance?.forEach((item) => {
|
|
11168
|
-
const direction = line2.direction();
|
|
11169
|
-
const peLine = Point.from(item.p).expandAsLine(direction, item.width).translate(-item.width * 0.5, direction);
|
|
11170
|
-
peLine.points.forEach((p) => passageEntrancePosition.push(p.x, p.y, 0));
|
|
11171
|
-
});
|
|
11172
|
-
}
|
|
11139
|
+
createGeometry(map, count) {
|
|
11140
|
+
const geometry = new THREE.BufferGeometry();
|
|
11141
|
+
Object.keys(map).forEach((k) => {
|
|
11142
|
+
geometry.setAttribute(k, new THREE.BufferAttribute(new Float32Array(map[k]), map[k].length / count));
|
|
11173
11143
|
});
|
|
11174
|
-
|
|
11175
|
-
position
|
|
11176
|
-
}, position.length / 3, {
|
|
11177
|
-
color: 5745151
|
|
11178
|
-
}, this.container);
|
|
11179
|
-
doorPosition.length && this.renderer.createLineSegments({
|
|
11180
|
-
position: doorPosition
|
|
11181
|
-
}, doorPosition.length / 3, {
|
|
11182
|
-
color: 16776960
|
|
11183
|
-
}, this.container);
|
|
11184
|
-
passageEntrancePosition.length && this.renderer.createLineSegments({
|
|
11185
|
-
position: passageEntrancePosition
|
|
11186
|
-
}, passageEntrancePosition.length / 3, {
|
|
11187
|
-
color: 16750592
|
|
11188
|
-
}, this.container);
|
|
11189
|
-
windowPosition.length && this.renderer.createLineSegments({
|
|
11190
|
-
position: windowPosition
|
|
11191
|
-
}, windowPosition.length / 3, {
|
|
11192
|
-
color: 16711935
|
|
11193
|
-
}, this.container);
|
|
11194
|
-
if (bayWindowPoint.length) {
|
|
11195
|
-
const obj3D = this.renderer.createLineSegments({
|
|
11196
|
-
position: bayWindowPoint
|
|
11197
|
-
}, bayWindowPoint.length / 3, {}, this.container);
|
|
11198
|
-
obj3D.material = new THREE.LineDashedMaterial({
|
|
11199
|
-
color: 4235007,
|
|
11200
|
-
dashSize: 0.05,
|
|
11201
|
-
gapSize: 0.05,
|
|
11202
|
-
opacity: 0.5,
|
|
11203
|
-
transparent: true
|
|
11204
|
-
});
|
|
11205
|
-
obj3D.computeLineDistances();
|
|
11206
|
-
}
|
|
11207
|
-
this.renderer.createCircle(findDoorPoint, { map: searchTexture, size: 0.4, sizeAttenuation: true, color: 16777215 }, this.container);
|
|
11208
|
-
synchronize && this.synchronizeDxf();
|
|
11144
|
+
return geometry;
|
|
11209
11145
|
}
|
|
11210
11146
|
lineAdsorption = ref(true);
|
|
11211
11147
|
pointAdsorption = ref(true);
|
|
@@ -11307,16 +11243,6 @@ class RenderManager extends Component {
|
|
|
11307
11243
|
}
|
|
11308
11244
|
this.lineDashed1.visible = this.lineDashed2.visible = this.lineDashedText1.visible = this.lineDashedText2.visible = b;
|
|
11309
11245
|
}
|
|
11310
|
-
/** 创建几何体
|
|
11311
|
-
* @param rectangle
|
|
11312
|
-
*/
|
|
11313
|
-
createGeometry(map, count) {
|
|
11314
|
-
const geometry = new THREE.BufferGeometry();
|
|
11315
|
-
Object.keys(map).forEach((k) => {
|
|
11316
|
-
geometry.setAttribute("position", new THREE.BufferAttribute(new Float32Array(map[k]), map[k].length / count));
|
|
11317
|
-
});
|
|
11318
|
-
return geometry;
|
|
11319
|
-
}
|
|
11320
11246
|
/**
|
|
11321
11247
|
* 转为json
|
|
11322
11248
|
*/
|
|
@@ -11363,6 +11289,14 @@ class RenderManager extends Component {
|
|
|
11363
11289
|
dxf2.set(json, dxf2.options);
|
|
11364
11290
|
});
|
|
11365
11291
|
}
|
|
11292
|
+
/**
|
|
11293
|
+
* 绘制
|
|
11294
|
+
*/
|
|
11295
|
+
draw(synchronize = true) {
|
|
11296
|
+
this.container.clear();
|
|
11297
|
+
new Drawer(this.lines).draw(this.container);
|
|
11298
|
+
synchronize && this.synchronizeDxf();
|
|
11299
|
+
}
|
|
11366
11300
|
get renderer() {
|
|
11367
11301
|
return this.parent?.findComponentByName("Renderer");
|
|
11368
11302
|
}
|
|
@@ -11382,6 +11316,189 @@ class RenderManager extends Component {
|
|
|
11382
11316
|
return this.parent?.findComponentByName("DxfLineModel");
|
|
11383
11317
|
}
|
|
11384
11318
|
}
|
|
11319
|
+
class Drawer extends Pipeline {
|
|
11320
|
+
wallGroupManager;
|
|
11321
|
+
constructor(lines) {
|
|
11322
|
+
super();
|
|
11323
|
+
this.wallGroupManager = WallGroupManager.fromByLines(lines);
|
|
11324
|
+
this.use({ type: "wall", handle: this.wall.bind(this) });
|
|
11325
|
+
this.use({ type: "doubleWall", handle: this.doubleWall.bind(this) });
|
|
11326
|
+
this.use({ type: "door", handle: this.door.bind(this) });
|
|
11327
|
+
this.use({ type: "balconyRailing", handle: this.balconyRailing.bind(this) });
|
|
11328
|
+
this.use({ type: "window", handle: this.wall.bind(this) });
|
|
11329
|
+
this.use({ type: "hole", handle: this.hole.bind(this) });
|
|
11330
|
+
this.use({ type: "bayWindow", handle: this.bayWindow.bind(this) });
|
|
11331
|
+
}
|
|
11332
|
+
/** 单线墙壁
|
|
11333
|
+
* @param ctx
|
|
11334
|
+
*/
|
|
11335
|
+
wall(ctx) {
|
|
11336
|
+
const color = new THREE.Color(5745151);
|
|
11337
|
+
const holeLines = ctx.data.flatMap((line2) => {
|
|
11338
|
+
const holeLines2 = [];
|
|
11339
|
+
WallInsertObject.forEachInsertObjectData(line2, (data, key) => {
|
|
11340
|
+
data.forEach((item) => {
|
|
11341
|
+
let type = key == "drawWindow" ? "window" : item.type;
|
|
11342
|
+
const holeLine = WallInsertObject.wallInsertObjectToLine(line2, item);
|
|
11343
|
+
holeLine.userData.type = type;
|
|
11344
|
+
holeLines2.push(holeLine);
|
|
11345
|
+
});
|
|
11346
|
+
});
|
|
11347
|
+
let lines = [line2];
|
|
11348
|
+
if (holeLines2.length) {
|
|
11349
|
+
lines = LineSegmentUtils.clippingByLines(line2, holeLines2) ?? [];
|
|
11350
|
+
}
|
|
11351
|
+
lines.forEach((line22) => {
|
|
11352
|
+
line22.points.forEach((p) => {
|
|
11353
|
+
ctx.cache.lines.push(p.x, p.y, 0);
|
|
11354
|
+
ctx.cache.lineColor.push(color.r, color.g, color.b);
|
|
11355
|
+
});
|
|
11356
|
+
});
|
|
11357
|
+
return holeLines2;
|
|
11358
|
+
});
|
|
11359
|
+
this.wallGroupManager.add({
|
|
11360
|
+
type: "hole",
|
|
11361
|
+
lines: holeLines
|
|
11362
|
+
});
|
|
11363
|
+
}
|
|
11364
|
+
/** 双线墙壁
|
|
11365
|
+
* @param ctx
|
|
11366
|
+
*/
|
|
11367
|
+
doubleWall(ctx) {
|
|
11368
|
+
this.wallGroupManager.add({
|
|
11369
|
+
type: "wall",
|
|
11370
|
+
lines: ctx.data
|
|
11371
|
+
});
|
|
11372
|
+
}
|
|
11373
|
+
/** 门
|
|
11374
|
+
* @param ctx
|
|
11375
|
+
*/
|
|
11376
|
+
door(ctx) {
|
|
11377
|
+
this.wallGroupManager.add({
|
|
11378
|
+
type: "hole",
|
|
11379
|
+
lines: ctx.data
|
|
11380
|
+
});
|
|
11381
|
+
}
|
|
11382
|
+
/** 栏杆
|
|
11383
|
+
* @param ctx
|
|
11384
|
+
*/
|
|
11385
|
+
balconyRailing(ctx) {
|
|
11386
|
+
const color = new THREE.Color(65280);
|
|
11387
|
+
ctx.data.forEach((line2) => {
|
|
11388
|
+
line2.points.forEach((p) => {
|
|
11389
|
+
ctx.cache.lines.push(p.x, p.y, 0);
|
|
11390
|
+
ctx.cache.lineColor.push(color.r, color.g, color.b);
|
|
11391
|
+
});
|
|
11392
|
+
});
|
|
11393
|
+
}
|
|
11394
|
+
/** 飘窗
|
|
11395
|
+
* @param ctx
|
|
11396
|
+
*/
|
|
11397
|
+
bayWindow(ctx) {
|
|
11398
|
+
const color = new THREE.Color(5745151);
|
|
11399
|
+
ctx.data.forEach((line2) => {
|
|
11400
|
+
if (!line2.userData.isBayWindow) return;
|
|
11401
|
+
line2.points.forEach((p) => {
|
|
11402
|
+
ctx.cache.lineDasheds.push(p.x, p.y, 0);
|
|
11403
|
+
ctx.cache.lineDashedColor.push(color.r, color.g, color.b);
|
|
11404
|
+
});
|
|
11405
|
+
});
|
|
11406
|
+
this.wallGroupManager.add({
|
|
11407
|
+
type: "wall",
|
|
11408
|
+
lines: ctx.data.filter((line2) => !line2.userData.isBayWindow)
|
|
11409
|
+
});
|
|
11410
|
+
}
|
|
11411
|
+
/** 孔洞
|
|
11412
|
+
* @param ctx
|
|
11413
|
+
*/
|
|
11414
|
+
hole(ctx) {
|
|
11415
|
+
const colors = {
|
|
11416
|
+
default: new THREE.Color(16776960),
|
|
11417
|
+
// 0xff5722
|
|
11418
|
+
window: new THREE.Color(16711935),
|
|
11419
|
+
door: new THREE.Color(16776960)
|
|
11420
|
+
};
|
|
11421
|
+
ctx.data.forEach((line2) => {
|
|
11422
|
+
const type = line2.userData.type ?? "default";
|
|
11423
|
+
const color = colors[type];
|
|
11424
|
+
line2.points.forEach((p) => {
|
|
11425
|
+
if (type === "default") {
|
|
11426
|
+
ctx.cache.lineDasheds.push(p.x, p.y, 0);
|
|
11427
|
+
ctx.cache.lineDashedColor.push(color.r, color.g, color.b);
|
|
11428
|
+
} else {
|
|
11429
|
+
ctx.cache.lines.push(p.x, p.y, 0);
|
|
11430
|
+
ctx.cache.lineColor.push(color.r, color.g, color.b);
|
|
11431
|
+
}
|
|
11432
|
+
});
|
|
11433
|
+
});
|
|
11434
|
+
}
|
|
11435
|
+
/** 创建几何体
|
|
11436
|
+
* @param rectangle
|
|
11437
|
+
*/
|
|
11438
|
+
createLineSegments(map, count, parameters) {
|
|
11439
|
+
if (Array.isArray(map)) {
|
|
11440
|
+
const position = map.flatMap((line2) => line2?.points?.flatMap((p) => [p.x, p.y, 0]));
|
|
11441
|
+
return this.createLineSegments({ position }, map.length * 2, parameters);
|
|
11442
|
+
}
|
|
11443
|
+
const geometry = new THREE.BufferGeometry();
|
|
11444
|
+
Object.keys(map).forEach((key) => {
|
|
11445
|
+
const value = map[key];
|
|
11446
|
+
if (key === "color") {
|
|
11447
|
+
let attr = new THREE.BufferAttribute(new Float32Array(value), value.length / count);
|
|
11448
|
+
geometry.setAttribute(key, attr);
|
|
11449
|
+
} else {
|
|
11450
|
+
let attr = new THREE.BufferAttribute(new Float32Array(value), value.length / count);
|
|
11451
|
+
geometry.setAttribute(key, attr);
|
|
11452
|
+
}
|
|
11453
|
+
});
|
|
11454
|
+
const lineSegmentList = new THREE.LineSegments(geometry, new THREE.LineBasicMaterial({ ...parameters }));
|
|
11455
|
+
return lineSegmentList;
|
|
11456
|
+
}
|
|
11457
|
+
/**
|
|
11458
|
+
* 绘制
|
|
11459
|
+
*/
|
|
11460
|
+
draw(parent2) {
|
|
11461
|
+
const option = {
|
|
11462
|
+
lines: [],
|
|
11463
|
+
lineColor: [],
|
|
11464
|
+
walls: [],
|
|
11465
|
+
wallColor: [],
|
|
11466
|
+
lineDasheds: [],
|
|
11467
|
+
lineDashedColor: []
|
|
11468
|
+
};
|
|
11469
|
+
this.wallGroupManager.forEach((group) => {
|
|
11470
|
+
this.run(group.type, group.lines, option);
|
|
11471
|
+
});
|
|
11472
|
+
if (option.lines.length) {
|
|
11473
|
+
const wall = this.createLineSegments({
|
|
11474
|
+
position: option.lines,
|
|
11475
|
+
color: option.lineColor
|
|
11476
|
+
}, option.lines.length / 3, {
|
|
11477
|
+
vertexColors: true,
|
|
11478
|
+
toneMapped: false,
|
|
11479
|
+
color: 16777215
|
|
11480
|
+
});
|
|
11481
|
+
parent2.add(wall);
|
|
11482
|
+
}
|
|
11483
|
+
if (option.lineDasheds.length) {
|
|
11484
|
+
const wall = this.createLineSegments({
|
|
11485
|
+
position: option.lineDasheds,
|
|
11486
|
+
color: option.lineDashedColor
|
|
11487
|
+
}, option.lineDasheds.length / 3);
|
|
11488
|
+
wall.material = new THREE.LineDashedMaterial({
|
|
11489
|
+
color: 16777215,
|
|
11490
|
+
vertexColors: true,
|
|
11491
|
+
dashSize: 0.05,
|
|
11492
|
+
gapSize: 0.05,
|
|
11493
|
+
toneMapped: false,
|
|
11494
|
+
transparent: true,
|
|
11495
|
+
opacity: 0.7
|
|
11496
|
+
});
|
|
11497
|
+
wall.computeLineDistances();
|
|
11498
|
+
parent2.add(wall);
|
|
11499
|
+
}
|
|
11500
|
+
}
|
|
11501
|
+
}
|
|
11385
11502
|
function createHtml(tagName, options) {
|
|
11386
11503
|
const { is, customElementRegistry, style, text, html, parent: parent2 } = options ?? {};
|
|
11387
11504
|
const element = document.createElement(tagName, { is, customElementRegistry });
|
|
@@ -11849,6 +11966,7 @@ class CommandFlowComponent extends Component {
|
|
|
11849
11966
|
color: 55561
|
|
11850
11967
|
});
|
|
11851
11968
|
let mode = "none";
|
|
11969
|
+
let paused = false;
|
|
11852
11970
|
const update = (line2) => {
|
|
11853
11971
|
const rectangle = line2.toRectangle(0.025, "butt");
|
|
11854
11972
|
object3D.geometry = editor.renderManager.createGeometry({
|
|
@@ -11879,6 +11997,7 @@ class CommandFlowComponent extends Component {
|
|
|
11879
11997
|
return null;
|
|
11880
11998
|
}
|
|
11881
11999
|
const ppcEventCancel = editor.addEventListener("pointerPositionChange", () => {
|
|
12000
|
+
if (paused) return;
|
|
11882
12001
|
const result = editor.renderManager.adsorption(radius);
|
|
11883
12002
|
const {
|
|
11884
12003
|
line: line2,
|
|
@@ -11941,6 +12060,12 @@ class CommandFlowComponent extends Component {
|
|
|
11941
12060
|
get ended() {
|
|
11942
12061
|
return ended;
|
|
11943
12062
|
},
|
|
12063
|
+
paused() {
|
|
12064
|
+
paused = true;
|
|
12065
|
+
},
|
|
12066
|
+
resume() {
|
|
12067
|
+
paused = false;
|
|
12068
|
+
},
|
|
11944
12069
|
next: getLines,
|
|
11945
12070
|
end,
|
|
11946
12071
|
lines(mode_) {
|
|
@@ -12385,12 +12510,19 @@ class CommandFlowComponent extends Component {
|
|
|
12385
12510
|
}
|
|
12386
12511
|
function View() {
|
|
12387
12512
|
return createVNode("div", {
|
|
12388
|
-
"class":
|
|
12513
|
+
"class": {
|
|
12514
|
+
"z-20 absolute left-0 top-0 w-full h-full flex flex-col": true,
|
|
12515
|
+
" justify-center items-center bg-[rgba(0,0,0,0.5)]": !isMobileRef.value
|
|
12516
|
+
},
|
|
12389
12517
|
"onClick": (e) => e.stopPropagation(),
|
|
12390
12518
|
"onPointerdown": (e) => e.stopPropagation()
|
|
12391
|
-
}, [createVNode("div", {
|
|
12519
|
+
}, [isMobileRef.value && createVNode("div", {
|
|
12392
12520
|
"class": "flex-1 pointer-events-none"
|
|
12393
|
-
}, null),
|
|
12521
|
+
}, null), createVNode("div", {
|
|
12522
|
+
"class": {
|
|
12523
|
+
"w-[400px] rounded-[8px] overflow-hidden": true
|
|
12524
|
+
}
|
|
12525
|
+
}, [title && createVNode("div", {
|
|
12394
12526
|
"class": "bg-white p-[10px] text-center text-[16px]"
|
|
12395
12527
|
}, [createVNode("h4", null, [title])]), createVNode(Transition, {
|
|
12396
12528
|
"name": "slide-fade"
|
|
@@ -12406,7 +12538,7 @@ class CommandFlowComponent extends Component {
|
|
|
12406
12538
|
"modelValue": width.value,
|
|
12407
12539
|
"onUpdate:modelValue": ($event) => width.value = $event
|
|
12408
12540
|
}, null)]
|
|
12409
|
-
})]);
|
|
12541
|
+
})])]);
|
|
12410
12542
|
}
|
|
12411
12543
|
function close2() {
|
|
12412
12544
|
if (ended) return;
|
|
@@ -16839,14 +16971,16 @@ class LineAlignmentGuide extends Lines {
|
|
|
16839
16971
|
const pre = i === 0 ? start : points[i - 1];
|
|
16840
16972
|
const dist = Number((point.distance(pre) * 1e3).toFixed(0));
|
|
16841
16973
|
const center = point.clone().add(pre).multiplyScalar(0.5);
|
|
16842
|
-
dist > 0
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16974
|
+
if (dist > 0) {
|
|
16975
|
+
this.createText(dist, center, {
|
|
16976
|
+
padding: "1px 0px",
|
|
16977
|
+
background: "#fff",
|
|
16978
|
+
width: "35px",
|
|
16979
|
+
color: "#000",
|
|
16980
|
+
textAlign: "center",
|
|
16981
|
+
borderRadius: "6px"
|
|
16982
|
+
});
|
|
16983
|
+
}
|
|
16850
16984
|
}
|
|
16851
16985
|
this.setPoint(
|
|
16852
16986
|
this.start,
|
|
@@ -16884,6 +17018,7 @@ class DrawHole extends CommandFlowComponent {
|
|
|
16884
17018
|
container = new THREE.Group();
|
|
16885
17019
|
static shortcutKeys = ["h"];
|
|
16886
17020
|
static commandName = "draw-hole";
|
|
17021
|
+
defaultWidth = 1;
|
|
16887
17022
|
onAddFromParent(parent2) {
|
|
16888
17023
|
super.onAddFromParent(parent2);
|
|
16889
17024
|
this.editor.container.add(this.container);
|
|
@@ -16891,22 +17026,22 @@ class DrawHole extends CommandFlowComponent {
|
|
|
16891
17026
|
shortcutKeys: this.shortcutKeys,
|
|
16892
17027
|
commandName: DrawHole.commandName,
|
|
16893
17028
|
loop: true
|
|
16894
|
-
}).add(this.createCursor("no-drop")).add(this.selectLine.bind(this), { prompt: `请选择一条线段作为空洞依附墙体, ${this.formatText("ESC")} 取消命令` });
|
|
17029
|
+
}).add(this.createCursor("no-drop")).add(this.selectLine.bind(this), { prompt: `请选择一条线段作为空洞依附墙体, ${this.formatText("TAB")} 修改孔洞默认宽度, ${this.formatText("ESC")} 取消命令` });
|
|
16895
17030
|
}
|
|
16896
17031
|
/** 选择开始点
|
|
16897
17032
|
* @param next
|
|
16898
17033
|
*/
|
|
16899
17034
|
async selectLine(next) {
|
|
16900
|
-
const holeLine = LineSegment.axisY(
|
|
17035
|
+
const holeLine = LineSegment.axisY(this.defaultWidth), wall = new Wall2D(holeLine), lineAlignmentGuide = new LineAlignmentGuide();
|
|
16901
17036
|
wall.visible = false;
|
|
16902
17037
|
lineAlignmentGuide.visible = false;
|
|
16903
17038
|
this.container.add(wall);
|
|
16904
17039
|
this.container.add(lineAlignmentGuide);
|
|
16905
17040
|
wall.position.z = 0.01;
|
|
16906
17041
|
const selector = this.createLineSelector({
|
|
16907
|
-
onMove:
|
|
17042
|
+
onMove: (line2, result) => {
|
|
16908
17043
|
wall.position.set(result.point.x, result.point.y, wall.position.z);
|
|
16909
|
-
LineSegment.axisY(
|
|
17044
|
+
LineSegment.axisY(this.defaultWidth, holeLine);
|
|
16910
17045
|
let angle2 = 0;
|
|
16911
17046
|
if (line2) {
|
|
16912
17047
|
angle2 = LineSegment.angleToYAxis(line2);
|
|
@@ -16947,6 +17082,15 @@ class DrawHole extends CommandFlowComponent {
|
|
|
16947
17082
|
this.container.remove(lineAlignmentGuide);
|
|
16948
17083
|
selector.end();
|
|
16949
17084
|
});
|
|
17085
|
+
this.awaitOnlyKeys(["tab"], { once: false }).awaitEach(async () => {
|
|
17086
|
+
selector.paused();
|
|
17087
|
+
const w = await this.openWidthEditor({
|
|
17088
|
+
defaultWidth: this.defaultWidth * 1e3,
|
|
17089
|
+
title: "请输入宽度"
|
|
17090
|
+
});
|
|
17091
|
+
this.defaultWidth = w / 1e3;
|
|
17092
|
+
selector.resume();
|
|
17093
|
+
});
|
|
16950
17094
|
}
|
|
16951
17095
|
/** 执行完成
|
|
16952
17096
|
*/
|
|
@@ -16960,6 +17104,7 @@ class DrawHole extends CommandFlowComponent {
|
|
|
16960
17104
|
onRollback(data) {
|
|
16961
17105
|
WallInsertObject.removeInsertObject(data.line, data.insertObject);
|
|
16962
17106
|
this.renderManager.draw();
|
|
17107
|
+
return data;
|
|
16963
17108
|
}
|
|
16964
17109
|
/** 撤回回滚
|
|
16965
17110
|
* @param data
|
|
@@ -16967,6 +17112,7 @@ class DrawHole extends CommandFlowComponent {
|
|
|
16967
17112
|
*/
|
|
16968
17113
|
onRevokeRollback(data) {
|
|
16969
17114
|
this.onCompleted(data);
|
|
17115
|
+
return data;
|
|
16970
17116
|
}
|
|
16971
17117
|
}
|
|
16972
17118
|
const _hoisted_1$1 = {
|