build-dxf 0.1.113 → 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.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/src/api/index.d.ts +4 -1
  3. package/src/build.js +245 -173
  4. package/src/dxf-system/plugins/editor/components/CommandFlow/CFComponent.d.ts +11 -4
  5. package/src/dxf-system/plugins/editor/components/CommandFlow/{Default.d.ts → DefaultCommand.d.ts} +2 -2
  6. package/src/dxf-system/plugins/editor/components/CommandFlow/DrawHole.d.ts +38 -0
  7. package/src/dxf-system/plugins/editor/components/CommandFlow/DrawWindow.d.ts +1 -1
  8. package/src/dxf-system/plugins/editor/components/CommandFlow/PropertiesPanel.d.ts +1 -1
  9. package/src/dxf-system/plugins/editor/components/Editor.d.ts +1 -1
  10. package/src/dxf-system/plugins/editor/components/RenderManager.d.ts +9 -9
  11. package/src/dxf-system/plugins/editor/components/UIService.d.ts +2 -1
  12. package/src/dxf-system/plugins/editor/components/index.d.ts +1 -1
  13. package/src/dxf-system/plugins/editor/pages/EditorTool/EditorTool.vue.d.ts +1 -1
  14. package/src/dxf-system/plugins/editor/pages/PropertiesPanel.vue.d.ts +1 -1
  15. package/src/dxf-system/plugins/editor/utils/Wall2D.d.ts +10 -0
  16. package/src/dxf-system/utils/WallInsertObject.d.ts +6 -0
  17. package/src/dxf-system/utils/line-pipeline/builtin/door-to-hole.d.ts +1 -1
  18. package/src/dxf-system/utils/line-pipeline/builtin/double-wall-alignment.d.ts +1 -1
  19. package/src/index.css +13 -13
  20. package/src/index.js +10 -10
  21. package/src/index3.js +674 -119
  22. package/src/utils/algorithms/LineSegment.d.ts +22 -16
  23. package/src/utils/algorithms/Point.d.ts +6 -5
  24. package/src/utils/algorithms/Rectangle.d.ts +2 -2
  25. package/src/utils/three-object-3d/LineAlignmentGuide.d.ts +19 -0
  26. package/src/utils/three-object-3d/Shape2D.d.ts +61 -0
@@ -3,10 +3,11 @@ import { Editor } from '../Editor';
3
3
  import { EventInput, Renderer } from '../../../renderer/components';
4
4
  import { CommandFlow, CommandManager } from '../../../../../utils/command';
5
5
  import { AdsorptionResult, RenderManager } from '../RenderManager';
6
- import { Default } from './Default';
6
+ import { DefaultCommand } from './DefaultCommand';
7
7
  import { LineSegment } from '../../../../../utils/algorithms/LineSegment';
8
8
  import { Point } from '../../../../../utils/algorithms/Point';
9
9
  import { Properties } from 'csstype';
10
+ import { UIService } from '../UIService';
10
11
  import * as THREE from "three";
11
12
  export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Component<TEventMap & {}> {
12
13
  static interruptKeys: string[];
@@ -25,13 +26,14 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
25
26
  private _commandManager?;
26
27
  get commandManager(): CommandManager;
27
28
  private _default?;
28
- get default(): Default;
29
+ get default(): DefaultCommand;
29
30
  get commandName(): string;
30
31
  get interruptKeys(): string[];
31
32
  get shortcutKeys(): string[];
32
33
  get confirmKeys(): string[];
33
34
  container: THREE.Group<THREE.Object3DEventMap>;
34
35
  commandFlow?: CommandFlow;
36
+ uiService: UIService;
35
37
  constructor();
36
38
  /** 快捷创建命令流
37
39
  * @param opt
@@ -128,8 +130,11 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
128
130
  createLineSelector(opt?: {
129
131
  onMove: (line: LineSegment | null | undefined, result: AdsorptionResult) => void;
130
132
  eventRecordNames?: string[];
133
+ radius?: number;
131
134
  }): {
132
135
  readonly ended: boolean;
136
+ paused(): void;
137
+ resume(): void;
133
138
  next: (mode_?: "all" | "door" | "wall" | "window" | "none") => Promise<LineSegment<Record<string, any>> | null>;
134
139
  end: () => void;
135
140
  lines(mode_: "all" | "door" | "wall" | "window" | "none"): {
@@ -142,8 +147,10 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
142
147
  }>;
143
148
  [Symbol.asyncIterator](): /*elided*/ any;
144
149
  };
145
- awaitEach(mode_: "all" | "door" | "wall" | "window" | "none", callBack: (line: LineSegment | undefined) => void): Promise<{
150
+ awaitEach(mode_: "all" | "door" | "wall" | "window" | "none", callBack: (line: LineSegment | undefined, self: any) => void): Promise<{
146
151
  readonly ended: boolean;
152
+ paused(): void;
153
+ resume(): void;
147
154
  next: (mode_?: "all" | "door" | "wall" | "window" | "none") => Promise<LineSegment<Record<string, any>> | null>;
148
155
  end: () => void;
149
156
  lines(mode_: "all" | "door" | "wall" | "window" | "none"): {
@@ -156,7 +163,7 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
156
163
  }>;
157
164
  [Symbol.asyncIterator](): /*elided*/ any;
158
165
  };
159
- awaitEach(mode_: "all" | "door" | "wall" | "window" | "none", callBack: (line: LineSegment | undefined) => void): Promise</*elided*/ any>;
166
+ awaitEach(mode_: "all" | "door" | "wall" | "window" | "none", callBack: (line: LineSegment | undefined, self: any) => void): Promise</*elided*/ any>;
160
167
  }>;
161
168
  };
162
169
  /** 创建顶点选择器
@@ -1,13 +1,13 @@
1
1
  import { LineSegment } from '../../../../../utils/algorithms/LineSegment';
2
2
  import { CommandFlowComponent } from './CFComponent';
3
- import { LineUserData } from '../../../../../dxfSystem/type';
3
+ import { LineUserData } from '../../../../type';
4
4
  import * as THREE from "three";
5
5
  /**
6
6
  * 创建移动端集成页面
7
7
  * @param drawLine
8
8
  * @returns
9
9
  */
10
- export declare class Default extends CommandFlowComponent<{
10
+ export declare class DefaultCommand extends CommandFlowComponent<{
11
11
  selectLineChange: {};
12
12
  selectWinLineChange: {};
13
13
  }> {
@@ -0,0 +1,38 @@
1
+ import { CommandFlowComponent } from './CFComponent';
2
+ import { LineSegment } from '../../../../../utils/algorithms/LineSegment';
3
+ import { ComponentSystem } from '../../../../../utils/ecs';
4
+ import { InsertObject, LineUserData } from '../../../../type';
5
+ import * as THREE from "three";
6
+ interface Data {
7
+ line: LineSegment<LineUserData>;
8
+ insertObject: InsertObject;
9
+ }
10
+ export declare class DrawHole extends CommandFlowComponent<{
11
+ pointerMove: {
12
+ point: THREE.Vector3;
13
+ };
14
+ }> {
15
+ static name: string;
16
+ container: THREE.Group<THREE.Object3DEventMap>;
17
+ static shortcutKeys: string[];
18
+ static commandName: string;
19
+ defaultWidth: number;
20
+ onAddFromParent(parent: ComponentSystem): void;
21
+ /** 选择开始点
22
+ * @param next
23
+ */
24
+ selectLine(next: any): Promise<void>;
25
+ /** 执行完成
26
+ */
27
+ onCompleted(data: Data): void;
28
+ /** 回滚操作
29
+ * @param data
30
+ */
31
+ protected onRollback(data: Data): Data;
32
+ /** 撤回回滚
33
+ * @param data
34
+ * @returns
35
+ */
36
+ protected onRevokeRollback(data: Data): Data;
37
+ }
38
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { CommandFlowComponent } from './CFComponent';
2
2
  import { LineSegment } from '../../../../../utils/algorithms/LineSegment';
3
3
  import { ComponentSystem } from '../../../../../utils/ecs';
4
- import { LineUserData } from '../../../../../dxfSystem/type';
4
+ import { LineUserData } from '../../../../type';
5
5
  import * as THREE from "three";
6
6
  export declare class DrawWindow extends CommandFlowComponent<{
7
7
  pointerMove: {
@@ -10,7 +10,7 @@ export declare class PropertiesPanel extends CommandFlowComponent<{}> {
10
10
  isOpen: boolean;
11
11
  onAddFromParent(parent: ComponentSystem): void;
12
12
  getSelectLines(): {
13
- list: LineSegment<LineUserData>[];
13
+ list: LineSegment<import('../../../../type').LineUserData>[];
14
14
  winList: any[];
15
15
  };
16
16
  private constraint;
@@ -5,7 +5,7 @@ import { Renderer, DomContainer, DomEventRegister, EventInput } from '../../rend
5
5
  import { RenderManager } from './RenderManager';
6
6
  import { CommandManager } from '../../../../utils/command';
7
7
  import { App } from 'vue';
8
- import { DxfSystem } from '../../../../dxfSystem';
8
+ import { DxfSystem } from '../../..';
9
9
  import * as THREE from "three";
10
10
  export declare class Editor extends Component<{
11
11
  pointerPositionChange: {
@@ -6,8 +6,8 @@ import { PointSpatialHash } from '../../../../utils/algorithms/PointSpatialHash'
6
6
  import { Editor } from './Editor';
7
7
  import { Quadtree } from '../../../../utils/algorithms/Quadtree';
8
8
  import { DxfLineModel } from '../../model3d/components';
9
- import { LineUserData } from '../../../../dxfSystem/type';
10
- import { Dxf } from '../../../../dxfSystem/components/Dxf';
9
+ import { LineUserData, OriginalDataItem } from '../../../type';
10
+ import { Dxf } from '../../../components/Dxf';
11
11
  import * as THREE from "three";
12
12
  export type AdsorptionResult = {
13
13
  point: THREE.Vector3;
@@ -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
- draw(synchronize?: boolean): void;
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;
@@ -1 +1,2 @@
1
- export {};
1
+ export declare class UIService {
2
+ }
@@ -1,5 +1,5 @@
1
1
  export * from './RenderManager';
2
- export * from './CommandFlow/Default';
2
+ export * from './CommandFlow/DefaultCommand';
3
3
  export * from './CommandFlow/DrawDoorLine';
4
4
  export * from './CommandFlow/DrawLine';
5
5
  export * from './CommandFlow/DrawWindow';
@@ -1,4 +1,4 @@
1
- import { DxfSystem } from '../../../../../dxfSystem/DxfSystem';
1
+ import { DxfSystem } from '../../../../DxfSystem';
2
2
  type __VLS_Props = {
3
3
  dxfSystem: DxfSystem;
4
4
  permission?: "admin";
@@ -1,4 +1,4 @@
1
- import { LineUserData } from '../../../../dxfSystem/type';
1
+ import { LineUserData } from '../../../type';
2
2
  import { LineSegment } from '../../../../utils/algorithms/LineSegment';
3
3
  import { Ref } from 'vue';
4
4
  type __VLS_Props = {
@@ -0,0 +1,10 @@
1
+ import { Rectangle, LineSegment } from '../../../../utils';
2
+ import { Shape2D } from '../../../../utils/three-object-3d/Shape2D';
3
+ export declare class Wall2D extends Shape2D {
4
+ line: LineSegment;
5
+ rectangle: Rectangle;
6
+ private debouncing;
7
+ constructor(line: LineSegment);
8
+ update(): void;
9
+ dispose(): void;
10
+ }
@@ -92,6 +92,12 @@ export declare class WallInsertObject {
92
92
  */
93
93
  static addInsertObject(target: LineSegment<LineUserData>, insertObject: InsertObject, type?: InsertObjectKey): void;
94
94
  addInsertObject(target: LineSegment<LineUserData>, insertObject: InsertObject, type?: InsertObjectKey): void;
95
+ /** 移除孔洞
96
+ * @param target
97
+ * @param insertObject
98
+ */
99
+ static removeInsertObject(target: LineSegment<LineUserData>, insertObject: InsertObject): void;
100
+ removeInsertObject(target: LineSegment<LineUserData>, insertObject: InsertObject): void;
95
101
  /** 复制所有孔洞
96
102
  * @param target
97
103
  * @param source
@@ -1,4 +1,4 @@
1
- import { LineUserData, SetDataOption } from '../../../../dxfSystem/type';
1
+ import { LineUserData, SetDataOption } from '../../../type';
2
2
  import { LineSegment } from '../../../../utils/algorithms/LineSegment';
3
3
  /**
4
4
  * 轴对齐垂直修正
@@ -1,5 +1,5 @@
1
1
  import { LineSegment } from '../../../../utils/algorithms/LineSegment';
2
- import { LineUserData } from '../../../../dxfSystem/type';
2
+ import { LineUserData } from '../../../type';
3
3
  /** 双线墙对齐
4
4
  * @param lines
5
5
  * @returns
package/src/index.css CHANGED
@@ -213,6 +213,10 @@
213
213
  z-index: 8;
214
214
  }
215
215
 
216
+ .z-11 {
217
+ z-index: 11;
218
+ }
219
+
216
220
  .z-18 {
217
221
  z-index: 18;
218
222
  }
@@ -225,14 +229,6 @@
225
229
  z-index: 100;
226
230
  }
227
231
 
228
- .z-\[11\] {
229
- z-index: 11;
230
- }
231
-
232
- .z-\[20\] {
233
- z-index: 20;
234
- }
235
-
236
232
  .col-start-1 {
237
233
  grid-column-start: 1;
238
234
  }
@@ -444,6 +440,10 @@
444
440
  width: 200px;
445
441
  }
446
442
 
443
+ .w-\[400px\] {
444
+ width: 400px;
445
+ }
446
+
447
447
  .w-fit {
448
448
  width: fit-content;
449
449
  }
@@ -634,7 +634,7 @@
634
634
  border-top-width: 1px;
635
635
  }
636
636
 
637
- .border-b, .border-b-1 {
637
+ .border-b {
638
638
  border-bottom-style: var(--tw-border-style);
639
639
  border-bottom-width: 1px;
640
640
  }
@@ -1257,17 +1257,17 @@ button[data-v-b3b042a9]:active {
1257
1257
  }
1258
1258
  }
1259
1259
 
1260
- [data-v-cd7c599e] {
1260
+ [data-v-f4f386d2] {
1261
1261
  font-family: 微软雅黑;
1262
1262
  }
1263
- .number[data-v-cd7c599e] {
1263
+ .number[data-v-f4f386d2] {
1264
1264
  color: #a7a7a7
1265
1265
  }
1266
1266
 
1267
- [data-v-6ec3e5bb] {
1267
+ [data-v-b8090cfc] {
1268
1268
  font-family: 宋体;
1269
1269
  }
1270
- .button[data-v-6ec3e5bb] {
1270
+ .button[data-v-b8090cfc] {
1271
1271
  padding: 5px 10px;
1272
1272
  border: none;
1273
1273
  background: var(--primary-color);
package/src/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import "three";
2
- import { o, p, q, r, s, t, v, w, x } from "./build.js";
2
+ import { q, r, s, t, v, w, x, y, z } from "./build.js";
3
3
  export {
4
- o as ModelDataPlugin,
5
- p as buildJson,
6
- q as createEditor,
7
- r as dxfSystem,
8
- s as getFileAll,
9
- t as getGlobalDxfSystem,
10
- v as getModels,
11
- w as hasCircle,
12
- x as utils
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
  };