build-dxf 0.0.20-1 → 0.0.20-10

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 (25) hide show
  1. package/package.json +1 -1
  2. package/src/build.js +28 -19
  3. package/src/index.css +56 -20
  4. package/src/index2.js +2 -14
  5. package/src/index3.js +1021 -345
  6. package/src/selectLocalFile.js +10 -9
  7. package/src/utils/CommandManager/CommandFlow.d.ts +16 -0
  8. package/src/utils/CommandManager/CommandManager.d.ts +23 -0
  9. package/src/utils/DxfSystem/components/Dxf.d.ts +1 -0
  10. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +4 -1
  11. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +33 -0
  12. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +0 -20
  13. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +28 -0
  14. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +33 -0
  15. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +19 -3
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +20 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +33 -0
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +32 -0
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +14 -1
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +30 -0
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +63 -0
  23. package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -0
  24. package/src/utils/Quadtree/LineSegment.d.ts +1 -0
  25. package/src/utils/Quadtree/Point.d.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.0.20-1",
3
+ "version": "0.0.20-10",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -365,10 +365,11 @@ class Point {
365
365
  this.x = p.x ?? 0;
366
366
  this.y = p.y ?? 0;
367
367
  }
368
- toJson() {
368
+ toJson(z = 0) {
369
369
  return {
370
370
  x: this.x,
371
- y: this.y
371
+ y: this.y,
372
+ z
372
373
  };
373
374
  }
374
375
  static from(arr) {
@@ -852,6 +853,10 @@ class LineSegment {
852
853
  constructor(p1 = new Point(), p2 = new Point()) {
853
854
  this.points = [p1, p2];
854
855
  }
856
+ set(p1, p2) {
857
+ this.start.copy(p1);
858
+ this.end.copy(p2);
859
+ }
855
860
  /** 膨胀
856
861
  * @description 向线段的两个端点分别膨胀 width
857
862
  * @param width
@@ -1475,7 +1480,7 @@ class Dxf extends Component {
1475
1480
  filterLines.push(line2);
1476
1481
  } else filterLines.push(line);
1477
1482
  }
1478
- return filterLines.length > 2 ? linesToPath(this.mergeSameDirectionLine(filterLines)) : [];
1483
+ return filterLines.length > 3 ? linesToPath(this.mergeSameDirectionLine(filterLines)) : [];
1479
1484
  }
1480
1485
  /**
1481
1486
  * 移除短线段
@@ -1485,7 +1490,7 @@ class Dxf extends Component {
1485
1490
  removeShortLine(path, shortLine = this.shortLine) {
1486
1491
  const lines = pathToLines(path), filterLines = [], PI_1 = Math.PI / 180;
1487
1492
  for (let i = 0; i < lines.length; i++) {
1488
- const line = lines[i], len = line.length();
1493
+ const line = lines[i], len = line.length(), currentIndex = i;
1489
1494
  if (len > shortLine || filterLines.length === 0) {
1490
1495
  filterLines.push(line);
1491
1496
  continue;
@@ -1499,24 +1504,29 @@ class Dxf extends Component {
1499
1504
  } else break;
1500
1505
  }
1501
1506
  if (!nextline) continue;
1502
- const intersectPoint = preLine.getIntersection(nextline);
1503
- if (intersectPoint) {
1504
- const p0 = preLine.points[1].clone(), p1 = nextline.points[0].clone();
1505
- preLine.points[1].copy(intersectPoint);
1506
- nextline.points[0].copy(intersectPoint);
1507
- if (preLine.length() < this.width) {
1508
- preLine.points[1].copy(p0);
1509
- nextline.points[0].copy(p0);
1510
- } else if (nextline.length() < this.width) {
1511
- preLine.points[1].copy(p1);
1512
- nextline.points[0].copy(p1);
1507
+ const targetLine = lines[i - 1];
1508
+ if (preLine.length() > targetLine.length()) {
1509
+ const intersectPoint = preLine.getIntersection(nextline);
1510
+ if (intersectPoint) {
1511
+ const p0 = preLine.points[1].clone(), p1 = nextline.points[0].clone();
1512
+ preLine.points[1].copy(intersectPoint);
1513
+ nextline.points[0].copy(intersectPoint);
1514
+ if (preLine.length() < this.width) {
1515
+ preLine.points[1].copy(p0);
1516
+ nextline.points[0].copy(p0);
1517
+ } else if (nextline.length() < this.width) {
1518
+ preLine.points[1].copy(p1);
1519
+ nextline.points[0].copy(p1);
1520
+ }
1521
+ } else {
1522
+ preLine.points[1].copy(nextline.points[0]);
1513
1523
  }
1524
+ filterLines.push(nextline);
1514
1525
  } else {
1515
- preLine.points[1].copy(nextline.points[0]);
1526
+ i = currentIndex;
1516
1527
  }
1517
- filterLines.push(nextline);
1518
1528
  }
1519
- return filterLines.length > 2 ? linesToPath(filterLines) : [];
1529
+ return filterLines.length > 3 ? linesToPath(filterLines) : [];
1520
1530
  }
1521
1531
  /** 线偏移
1522
1532
  * @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
@@ -2284,7 +2294,6 @@ class DoorsAnalysis {
2284
2294
  console.warn(`门的线段顺序${item[4]} 没有drawDoorData属性`);
2285
2295
  }
2286
2296
  });
2287
- console.log("门点位数量:", doorPoints.length);
2288
2297
  return doorPoints;
2289
2298
  }
2290
2299
  /**
package/src/index.css CHANGED
@@ -104,12 +104,12 @@
104
104
  z-index: 11;
105
105
  }
106
106
 
107
- .z-\[1000\] {
108
- z-index: 1000;
107
+ .z-\[20\] {
108
+ z-index: 20;
109
109
  }
110
110
 
111
- .z-\[10000\] {
112
- z-index: 10000;
111
+ .z-\[1000\] {
112
+ z-index: 1000;
113
113
  }
114
114
 
115
115
  .container {
@@ -214,10 +214,6 @@
214
214
  height: 20px;
215
215
  }
216
216
 
217
- .h-\[20px\] {
218
- height: 20px;
219
- }
220
-
221
217
  .h-\[100vh\] {
222
218
  height: 100vh;
223
219
  }
@@ -238,34 +234,42 @@
238
234
  width: 200px;
239
235
  }
240
236
 
237
+ .w-fit {
238
+ width: fit-content;
239
+ }
240
+
241
241
  .w-full {
242
242
  width: 100%;
243
243
  }
244
244
 
245
- .max-w-\[100px\] {
246
- max-width: 100px;
245
+ .max-w-\[150px\] {
246
+ max-width: 150px;
247
247
  }
248
248
 
249
- .max-w-\[260px\] {
250
- max-width: 260px;
249
+ .max-w-\[180px\] {
250
+ max-width: 180px;
251
251
  }
252
252
 
253
- .min-w-\[140px\] {
254
- min-width: 140px;
253
+ .max-w-\[200px\] {
254
+ max-width: 200px;
255
255
  }
256
256
 
257
- .min-w-\[150px\] {
258
- min-width: 150px;
257
+ .max-w-\[260px\] {
258
+ max-width: 260px;
259
259
  }
260
260
 
261
- .flex-1 {
262
- flex: 1;
261
+ .min-w-\[150px\] {
262
+ min-width: 150px;
263
263
  }
264
264
 
265
265
  .rotate-90 {
266
266
  rotate: 90deg;
267
267
  }
268
268
 
269
+ .\!cursor-no-drop {
270
+ cursor: no-drop !important;
271
+ }
272
+
269
273
  .cursor-pointer {
270
274
  cursor: pointer;
271
275
  }
@@ -318,6 +322,10 @@
318
322
  border-radius: 2px;
319
323
  }
320
324
 
325
+ .rounded-\[4px\] {
326
+ border-radius: 4px;
327
+ }
328
+
321
329
  .rounded-\[6px\] {
322
330
  border-radius: 6px;
323
331
  }
@@ -338,7 +346,7 @@
338
346
  border-radius: var(--radius-lg);
339
347
  }
340
348
 
341
- .border {
349
+ .border, .border-1 {
342
350
  border-style: var(--tw-border-style);
343
351
  border-width: 1px;
344
352
  }
@@ -353,6 +361,10 @@
353
361
  border-bottom-width: 1px;
354
362
  }
355
363
 
364
+ .border-\[\#ccc\] {
365
+ border-color: #ccc;
366
+ }
367
+
356
368
  .border-t-\[\#eee\] {
357
369
  border-top-color: #eee;
358
370
  }
@@ -369,6 +381,10 @@
369
381
  background-color: var(--primary-color) !important;
370
382
  }
371
383
 
384
+ .bg-\[\#ccc\] {
385
+ background-color: #ccc;
386
+ }
387
+
372
388
  .bg-\[\#f0f0f0\] {
373
389
  background-color: #f0f0f0;
374
390
  }
@@ -407,6 +423,10 @@
407
423
  padding: 0 10px;
408
424
  }
409
425
 
426
+ .p-\[2px\] {
427
+ padding: 2px;
428
+ }
429
+
410
430
  .p-\[2px_5px\] {
411
431
  padding: 2px 5px;
412
432
  }
@@ -465,6 +485,14 @@
465
485
  font-weight: var(--font-weight-bold);
466
486
  }
467
487
 
488
+ .text-nowrap {
489
+ text-wrap: nowrap;
490
+ }
491
+
492
+ .text-wrap {
493
+ text-wrap: wrap;
494
+ }
495
+
468
496
  .text-\[\#333\] {
469
497
  color: #333;
470
498
  }
@@ -489,6 +517,10 @@
489
517
  color: var(--color-primary);
490
518
  }
491
519
 
520
+ .opacity-30 {
521
+ opacity: .3;
522
+ }
523
+
492
524
  .blur {
493
525
  --tw-blur: blur(8px);
494
526
  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, );
@@ -522,6 +554,10 @@
522
554
  }
523
555
  }
524
556
 
557
+ .active\:\!scale-\[1\]:active {
558
+ scale: 1 !important;
559
+ }
560
+
525
561
  .active\:scale-\[0\.7\]:active {
526
562
  scale: .7;
527
563
  }
@@ -612,7 +648,7 @@
612
648
  inherits: false
613
649
  }
614
650
 
615
- [data-v-a5aa9d5a] {
651
+ [data-v-953dfd98] {
616
652
  font-family: 宋体;
617
653
  }
618
654
 
package/src/index2.js CHANGED
@@ -289,7 +289,6 @@ class OriginalLineRender extends Component {
289
289
  const dxf = this.Dxf;
290
290
  const center = dxf.originalBox.center;
291
291
  this.Renderer?.orbitControls?.target.set(center.x, center.y, 0);
292
- this.Renderer?.camera?.position.set(center.x, center.y, 0).add(new THREE.Vector3(1, 1, 1).multiplyScalar(10));
293
292
  const lineAnalysis = parent.findComponentByName("LineAnalysis");
294
293
  const array = lineAnalysis.appendLineSegmentList.flatMap((line) => line.points.flatMap((p) => [p.x, p.y, dxf.originalZAverage]));
295
294
  this.appendLineMode.geometry = new THREE.BufferGeometry().setAttribute("position", new THREE.BufferAttribute(new Float32Array(array), 3, true));
@@ -465,7 +464,7 @@ class EventInput extends Component {
465
464
  * @returns
466
465
  */
467
466
  isKeyDown(key) {
468
- return this.keyList.has(key) || this.mouseList.has(key);
467
+ return this.keyList.has(key.toLocaleLowerCase()) || this.mouseList.has(key.toLocaleLowerCase());
469
468
  }
470
469
  /**
471
470
  * 是否按下按键组
@@ -644,17 +643,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
644
643
  ])),
645
644
  _: 1,
646
645
  __: [9]
647
- }),
648
- createVNode(unref(ElButton), {
649
- size: "small",
650
- type: "success",
651
- onClick: selectDetailsPointFile
652
- }, {
653
- default: withCtx(() => _cache[10] || (_cache[10] = [
654
- createTextVNode(" 编辑模式 ", -1)
655
- ])),
656
- _: 1,
657
- __: [10]
658
646
  })
659
647
  ]),
660
648
  isLook.value ? (openBlock(), createElementBlock("div", {
@@ -680,7 +668,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
680
668
  label: "墙体(E)"
681
669
  }, null, 8, ["modelValue"])
682
670
  ]),
683
- _cache[11] || (_cache[11] = 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))
671
+ _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))
684
672
  ])
685
673
  ])
686
674
  ], 512);