build-dxf 0.1.15 → 0.1.16

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 (58) hide show
  1. package/package.json +1 -1
  2. package/src/DomEventRegister.js +472 -0
  3. package/src/build.js +3064 -3359
  4. package/src/index.css +1 -131
  5. package/src/index.js +10 -10
  6. package/src/index2.js +2 -155
  7. package/src/index3.js +6295 -2640
  8. package/src/utils/DxfSystem/DxfSystem.d.ts +0 -3
  9. package/src/utils/DxfSystem/components/CorrectionDxf.d.ts +26 -2
  10. package/src/utils/DxfSystem/components/Dxf.d.ts +3 -2
  11. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +1 -2
  12. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +7 -2
  13. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +1 -1
  14. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +2 -3
  15. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +3 -5
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +2 -3
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +1 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +2 -3
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +1 -1
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{IntersectionConnectionLine.d.ts → TwoLineConnectionLine.d.ts} +3 -3
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{ConnectionLine.d.ts → TwoPointConnection.d.ts} +3 -3
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{VerticalCorrection.d.ts → VerticalCorr.d.ts} +2 -12
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{DeleteSelectWindow.d.ts → VerticalCorrContinue.d.ts} +10 -8
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +1 -1
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ViewAngle.d.ts +1 -1
  26. package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -1
  27. package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +1 -0
  28. package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +1 -2
  29. package/src/utils/DxfSystem/type.d.ts +2 -0
  30. package/src/utils/DxfSystem/utils/DoorFind.d.ts +36 -0
  31. package/src/utils/{modelScenario → DxfSystem/utils}/SceneAutoGenerat.d.ts +3 -1
  32. package/src/utils/DxfSystem/utils/index.d.ts +1 -5
  33. package/src/utils/LineSegment.d.ts +9 -0
  34. package/src/utils/Map.d.ts +1 -0
  35. package/src/utils/MaxiCircles.d.ts +13 -0
  36. package/src/utils/MiniCircles.d.ts +33 -0
  37. package/src/utils/Point.d.ts +1 -1
  38. package/src/utils/{PointVirtualGrid/index.d.ts → PointVirtualGrid.d.ts} +5 -5
  39. package/src/utils/Polygon.d.ts +11 -0
  40. package/src/utils/UndirectedGraph.d.ts +4 -0
  41. package/src/utils/index.d.ts +4 -2
  42. package/src/bin/Main.js +0 -269
  43. package/src/bin/mini_cycles.js +0 -15
  44. package/src/bin/mini_cycles.wasm +0 -0
  45. package/src/bin/mini_cycles.wasm.map +0 -1
  46. package/src/bin/wasm_mini_cycles.js +0 -296
  47. package/src/index4.js +0 -4261
  48. package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +0 -115
  49. package/src/utils/DxfSystem/plugin/RenderPlugin/pages/Dxf.vue.d.ts +0 -21
  50. package/src/utils/DxfSystem/utils/closedPathArea.d.ts +0 -2
  51. package/src/utils/DxfSystem/utils/findClosedPolygons.d.ts +0 -14
  52. package/src/utils/DxfSystem/utils/findLargestCircle.d.ts +0 -14
  53. package/src/utils/DxfSystem/utils/mergeSmallestCircle.d.ts +0 -14
  54. package/src/utils/DxfSystem/utils/smallestCircle.d.ts +0 -6
  55. package/src/utils/deepClone.d.ts +0 -6
  56. package/src/utils/drawLinePathToPng.d.ts +0 -7
  57. /package/src/utils/{Lines.d.ts → DxfSystem/utils/Lines.d.ts} +0 -0
  58. /package/src/utils/{LoadModel.d.ts → DxfSystem/utils/LoadModel.d.ts} +0 -0
package/src/index.css CHANGED
@@ -10,20 +10,6 @@
10
10
  --tw-border-style: solid;
11
11
  --tw-leading: initial;
12
12
  --tw-font-weight: initial;
13
- --tw-shadow: 0 0 #0000;
14
- --tw-shadow-color: initial;
15
- --tw-shadow-alpha: 100%;
16
- --tw-inset-shadow: 0 0 #0000;
17
- --tw-inset-shadow-color: initial;
18
- --tw-inset-shadow-alpha: 100%;
19
- --tw-ring-color: initial;
20
- --tw-ring-shadow: 0 0 #0000;
21
- --tw-inset-ring-color: initial;
22
- --tw-inset-ring-shadow: 0 0 #0000;
23
- --tw-ring-inset: initial;
24
- --tw-ring-offset-width: 0px;
25
- --tw-ring-offset-color: #fff;
26
- --tw-ring-offset-shadow: 0 0 #0000;
27
13
  --tw-blur: initial;
28
14
  --tw-brightness: initial;
29
15
  --tw-contrast: initial;
@@ -139,10 +125,6 @@
139
125
  z-index: 20;
140
126
  }
141
127
 
142
- .z-\[1000\] {
143
- z-index: 1000;
144
- }
145
-
146
128
  .container {
147
129
  width: 100%;
148
130
  }
@@ -253,10 +235,6 @@
253
235
  height: 100vh;
254
236
  }
255
237
 
256
- .h-fit {
257
- height: fit-content;
258
- }
259
-
260
238
  .h-full {
261
239
  height: 100%;
262
240
  }
@@ -377,10 +355,6 @@
377
355
  border-radius: 8px;
378
356
  }
379
357
 
380
- .rounded-\[10px\] {
381
- border-radius: 10px;
382
- }
383
-
384
358
  .rounded-\[50px\] {
385
359
  border-radius: 50px;
386
360
  }
@@ -432,18 +406,10 @@
432
406
  background-color: #f0f0f0;
433
407
  }
434
408
 
435
- .bg-\[rgba\(255\,255\,255\,1\)\] {
436
- background-color: #fff;
437
- }
438
-
439
409
  .bg-\[var\(--el-color-primary\)\] {
440
410
  background-color: var(--el-color-primary);
441
411
  }
442
412
 
443
- .bg-black {
444
- background-color: var(--color-black);
445
- }
446
-
447
413
  .bg-black\/15 {
448
414
  background-color: #00000026;
449
415
  }
@@ -462,10 +428,6 @@
462
428
  padding: 0 5px;
463
429
  }
464
430
 
465
- .p-\[0px_10px\] {
466
- padding: 0 10px;
467
- }
468
-
469
431
  .p-\[2px_5px\] {
470
432
  padding: 2px 5px;
471
433
  }
@@ -478,10 +440,6 @@
478
440
  padding: 5px;
479
441
  }
480
442
 
481
- .p-\[5px_20px\] {
482
- padding: 5px 20px;
483
- }
484
-
485
443
  .p-\[10px\] {
486
444
  padding: 10px;
487
445
  }
@@ -540,10 +498,6 @@
540
498
  color: #999;
541
499
  }
542
500
 
543
- .text-\[\#c9c9c9\] {
544
- color: #c9c9c9;
545
- }
546
-
547
501
  .text-\[\#ccc\] {
548
502
  color: #ccc;
549
503
  }
@@ -564,11 +518,6 @@
564
518
  opacity: .3;
565
519
  }
566
520
 
567
- .ring {
568
- --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
569
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
570
- }
571
-
572
521
  .blur {
573
522
  --tw-blur: blur(8px);
574
523
  filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
@@ -665,85 +614,6 @@
665
614
  inherits: false
666
615
  }
667
616
 
668
- @property --tw-shadow {
669
- syntax: "*";
670
- inherits: false;
671
- initial-value: 0 0 #0000;
672
- }
673
-
674
- @property --tw-shadow-color {
675
- syntax: "*";
676
- inherits: false
677
- }
678
-
679
- @property --tw-shadow-alpha {
680
- syntax: "<percentage>";
681
- inherits: false;
682
- initial-value: 100%;
683
- }
684
-
685
- @property --tw-inset-shadow {
686
- syntax: "*";
687
- inherits: false;
688
- initial-value: 0 0 #0000;
689
- }
690
-
691
- @property --tw-inset-shadow-color {
692
- syntax: "*";
693
- inherits: false
694
- }
695
-
696
- @property --tw-inset-shadow-alpha {
697
- syntax: "<percentage>";
698
- inherits: false;
699
- initial-value: 100%;
700
- }
701
-
702
- @property --tw-ring-color {
703
- syntax: "*";
704
- inherits: false
705
- }
706
-
707
- @property --tw-ring-shadow {
708
- syntax: "*";
709
- inherits: false;
710
- initial-value: 0 0 #0000;
711
- }
712
-
713
- @property --tw-inset-ring-color {
714
- syntax: "*";
715
- inherits: false
716
- }
717
-
718
- @property --tw-inset-ring-shadow {
719
- syntax: "*";
720
- inherits: false;
721
- initial-value: 0 0 #0000;
722
- }
723
-
724
- @property --tw-ring-inset {
725
- syntax: "*";
726
- inherits: false
727
- }
728
-
729
- @property --tw-ring-offset-width {
730
- syntax: "<length>";
731
- inherits: false;
732
- initial-value: 0;
733
- }
734
-
735
- @property --tw-ring-offset-color {
736
- syntax: "*";
737
- inherits: false;
738
- initial-value: #fff;
739
- }
740
-
741
- @property --tw-ring-offset-shadow {
742
- syntax: "*";
743
- inherits: false;
744
- initial-value: 0 0 #0000;
745
- }
746
-
747
617
  @property --tw-blur {
748
618
  syntax: "*";
749
619
  inherits: false
@@ -810,7 +680,7 @@
810
680
  inherits: false
811
681
  }
812
682
 
813
- [data-v-18ae0c97] {
683
+ [data-v-74cfb8d6] {
814
684
  font-family: 宋体;
815
685
  }
816
686
 
package/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import "three";
2
- import { k, D, l, h, n, f, i, j, g, m } from "./build.js";
2
+ import { D, l, j, f, m, e, h, i, g, k } from "./build.js";
3
3
  import "clipper-lib";
4
4
  export {
5
- k as Dxf,
6
- D as DxfSystem,
7
- l as ModelDataPlugin,
8
- h as buildJson,
9
- n as components,
10
- f as createEditor,
11
- i as getFileAll,
12
- j as getGlobalDxfSystem,
5
+ D as Dxf,
6
+ l as DxfSystem,
7
+ j as ModelDataPlugin,
8
+ f as buildJson,
9
+ m as components,
10
+ e as createEditor,
11
+ h as getFileAll,
12
+ i as getGlobalDxfSystem,
13
13
  g as getModels,
14
- m as utils
14
+ k as utils
15
15
  };
package/src/index2.js CHANGED
@@ -1,10 +1,9 @@
1
- import { D as DomEventRegister, a as DomContainer, R as Renderer, E as ElButton, b as ElCheckbox } from "./index4.js";
2
- import { C as Component, V as Variable, D as DxfSystem, M as ModelDataPlugin, W as WhiteModel, S as SelectLocalFile } from "./build.js";
1
+ import { D as DomEventRegister, a as DomContainer, R as Renderer } from "./DomEventRegister.js";
2
+ import { C as Component, V as Variable } from "./build.js";
3
3
  import * as THREE from "three";
4
4
  import { Group } from "three";
5
5
  import "clipper-lib";
6
6
  import "dxf-writer";
7
- import { defineComponent, ref, watch, onMounted, onUnmounted, createElementBlock, openBlock, createElementVNode, createCommentVNode, createVNode, unref, withCtx, createTextVNode, createStaticVNode } from "vue";
8
7
  class ModelDataRender extends Component {
9
8
  static name = "ModelDataRender";
10
9
  onAddFromParent(parent) {
@@ -180,157 +179,6 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
180
179
  ModelDataRender,
181
180
  Renderer
182
181
  }, Symbol.toStringTag, { value: "Module" }));
183
- const _hoisted_1 = { class: "pointer-events-none w-full flex justify-between absolute left-0 top-0 p-[10px] z-[1000] gap-[5px] select-none" };
184
- const _hoisted_2 = { class: "pointer-events-auto" };
185
- const _hoisted_3 = { class: "pointer-events-auto" };
186
- const _hoisted_4 = { class: "text-[14px] bg-[rgba(255,255,255,1)] rounded-[6px] p-[0px_10px]" };
187
- const _sfc_main = /* @__PURE__ */ defineComponent({
188
- __name: "Dxf",
189
- props: {
190
- lines: {},
191
- detailsPoint: {}
192
- },
193
- setup(__props) {
194
- THREE.Object3D.DEFAULT_UP = new THREE.Vector3(0, 0, 1);
195
- const props = __props;
196
- const elRef = ref(), originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), dxfSystem = new DxfSystem().usePlugin(ModelDataPlugin).usePlugin(RenderPlugin), desPoint = dxfSystem.findComponentByType(void 0), domContainer = dxfSystem.findComponentByType(DomContainer), whiteModel = dxfSystem.findComponentByType(WhiteModel);
197
- watch(() => props.lines, () => props.lines && setLines(props.lines));
198
- watch(() => props.detailsPoint, () => props.detailsPoint && desPoint?.set(props.detailsPoint));
199
- function setLines(lines) {
200
- if (lines) {
201
- localStorage.setItem("lines", JSON.stringify(lines));
202
- try {
203
- dxfSystem.Dxf.set(lines);
204
- dxfSystem.Dxf.lineOffset();
205
- } catch (error) {
206
- console.log(error);
207
- }
208
- }
209
- }
210
- async function selectLocalFile() {
211
- const data = await SelectLocalFile.json();
212
- if (Array.isArray(data)) {
213
- localStorage.removeItem("orbitControls");
214
- setLines(data);
215
- }
216
- }
217
- async function selectDetailsPointFile() {
218
- const data = await SelectLocalFile.json();
219
- if (Array.isArray(data)) desPoint?.set(data);
220
- }
221
- watch(originalLineVisible, () => dxfSystem.Variable.set("originalLineVisible", originalLineVisible.value));
222
- watch(dxfVisible, () => dxfSystem.Variable.set("dxfVisible", dxfVisible.value));
223
- watch(whiteModelVisible, () => dxfSystem.Variable.set("whiteModelVisible", whiteModelVisible.value));
224
- dxfSystem.Variable.addEventListener("isLook", (e) => isLook.value = e.value);
225
- dxfSystem.Variable.addEventListener("originalLineVisible", (e) => originalLineVisible.value = e.value);
226
- dxfSystem.Variable.addEventListener("dxfVisible", (e) => dxfVisible.value = e.value);
227
- dxfSystem.Variable.addEventListener("whiteModelVisible", (e) => whiteModelVisible.value = e.value);
228
- if (localStorage.getItem("lines")) {
229
- setLines(JSON.parse(localStorage.getItem("lines") ?? "{}"));
230
- } else {
231
- setLines(props.lines);
232
- }
233
- props.detailsPoint && desPoint?.set(props.detailsPoint);
234
- onMounted(() => domContainer && elRef.value?.appendChild(domContainer.domElement));
235
- onUnmounted(() => dxfSystem.destroy());
236
- const renderer = dxfSystem.findComponentByType(Renderer);
237
- renderer.orbitControls?.addEventListener("change", () => {
238
- localStorage.setItem("orbitControls", JSON.stringify({
239
- position: renderer.camera.position.toArray(),
240
- target: renderer.orbitControls?.target.toArray()
241
- }));
242
- });
243
- const d = localStorage.getItem("orbitControls");
244
- if (d) {
245
- const data = JSON.parse(d);
246
- setTimeout(() => {
247
- renderer.camera.position.set(data.position[0], data.position[1], data.position[2]);
248
- renderer.orbitControls?.target.set(data.target[0], data.target[1], data.target[2]);
249
- });
250
- }
251
- return (_ctx, _cache) => {
252
- return openBlock(), createElementBlock("div", {
253
- ref_key: "elRef",
254
- ref: elRef,
255
- style: { "height": "100%", "width": "100%", "overflow": "hidden", "position": "relative" }
256
- }, [
257
- createElementVNode("div", _hoisted_1, [
258
- createElementVNode("div", _hoisted_2, [
259
- createVNode(unref(ElButton), {
260
- size: "small",
261
- type: "primary",
262
- onClick: _cache[0] || (_cache[0] = ($event) => unref(dxfSystem).Dxf.download("test.dxf"))
263
- }, {
264
- default: withCtx(() => _cache[6] || (_cache[6] = [
265
- createTextVNode(" 下载 DXF ", -1)
266
- ])),
267
- _: 1,
268
- __: [6]
269
- }),
270
- createVNode(unref(ElButton), {
271
- size: "small",
272
- type: "primary",
273
- onClick: _cache[1] || (_cache[1] = ($event) => unref(whiteModel).downloadGltf("test.glb"))
274
- }, {
275
- default: withCtx(() => _cache[7] || (_cache[7] = [
276
- createTextVNode(" 下载 白模 ", -1)
277
- ])),
278
- _: 1,
279
- __: [7]
280
- }),
281
- createVNode(unref(ElButton), {
282
- size: "small",
283
- type: "success",
284
- onClick: selectLocalFile
285
- }, {
286
- default: withCtx(() => _cache[8] || (_cache[8] = [
287
- createTextVNode(" 选择线路文件 ", -1)
288
- ])),
289
- _: 1,
290
- __: [8]
291
- }),
292
- createVNode(unref(ElButton), {
293
- size: "small",
294
- type: "success",
295
- onClick: selectDetailsPointFile
296
- }, {
297
- default: withCtx(() => _cache[9] || (_cache[9] = [
298
- createTextVNode(" 选择详情点文件 ", -1)
299
- ])),
300
- _: 1,
301
- __: [9]
302
- })
303
- ]),
304
- isLook.value ? (openBlock(), createElementBlock("div", {
305
- key: 0,
306
- onClick: _cache[2] || (_cache[2] = ($event) => unref(dxfSystem).Variable.set("isLook", false)),
307
- class: "pointer-events-auto text-[#fff] h-fit text-[14px] rounded-[10px] bg-black p-[5px_20px] select-none cursor-pointer"
308
- }, " 点击这或按 ESC 取消 ")) : createCommentVNode("", true),
309
- createElementVNode("div", _hoisted_3, [
310
- createElementVNode("div", _hoisted_4, [
311
- createVNode(unref(ElCheckbox), {
312
- modelValue: originalLineVisible.value,
313
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => originalLineVisible.value = $event),
314
- label: "线(Q)"
315
- }, null, 8, ["modelValue"]),
316
- createVNode(unref(ElCheckbox), {
317
- modelValue: dxfVisible.value,
318
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dxfVisible.value = $event),
319
- label: "dxf(W)"
320
- }, null, 8, ["modelValue"]),
321
- createVNode(unref(ElCheckbox), {
322
- modelValue: whiteModelVisible.value,
323
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => whiteModelVisible.value = $event),
324
- label: "墙体(E)"
325
- }, null, 8, ["modelValue"])
326
- ]),
327
- _cache[10] || (_cache[10] = createStaticVNode('<div class="mt-[5px] text-[#c9c9c9] text-[10px]"><p class="text-right">详情点射线辅助线快捷键:R</p><p class="text-right">墙壁合并追加线快捷键:A</p><p class="text-right">线段序号快捷键:T</p><p class="text-right">线段端点标示快捷键:P</p><p class="text-right">线段长度(单位米)快捷键:L</p></div>', 1))
328
- ])
329
- ])
330
- ], 512);
331
- };
332
- }
333
- });
334
182
  function RenderPlugin_(dxfSystem, option = {}) {
335
183
  const {
336
184
  modelData = true,
@@ -363,7 +211,6 @@ const RenderPlugin = Object.assign(RenderPlugin_, {
363
211
  }
364
212
  });
365
213
  export {
366
- _sfc_main as Dxf3DView,
367
214
  RenderPlugin,
368
215
  index as components
369
216
  };