build-dxf 0.1.34 → 0.1.35

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -1170,6 +1170,21 @@ class DomEventRegister extends Component {
1170
1170
  offsetY
1171
1171
  };
1172
1172
  }
1173
+ /** 更新鼠标
1174
+ * @param e
1175
+ */
1176
+ updatePointer(e) {
1177
+ const domContainer = this.parent?.findComponentByType(DomContainer);
1178
+ const { offsetX, offsetY } = this.computedPosition(e instanceof TouchEvent ? e.touches[0] : e, domContainer.rect);
1179
+ this.pointer.set(offsetX, offsetY);
1180
+ this.dispatchEvent({
1181
+ type: "pointerdown",
1182
+ x: offsetX,
1183
+ y: offsetY,
1184
+ pointerId: 0,
1185
+ pointerCount: 0
1186
+ });
1187
+ }
1173
1188
  /**
1174
1189
  * 初始化基础事件代理
1175
1190
  */
@@ -1222,7 +1237,6 @@ class DomEventRegister extends Component {
1222
1237
  this.pointer.set(offsetX, offsetY);
1223
1238
  map.append(e.pointerId, new Vector2(offsetX, offsetY));
1224
1239
  const movement = getMovement(e.pointerId);
1225
- console.log(offsetX, offsetY);
1226
1240
  this.dispatchEvent({
1227
1241
  type: "pointermove",
1228
1242
  x: offsetX,
package/src/build.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as THREE from "three";
2
- import { EventDispatcher as EventDispatcher$1, Group as Group$1, Vector3, Matrix3, MathUtils, Box3, Matrix4, Ray } from "three";
2
+ import { EventDispatcher as EventDispatcher$1, Vector3, Group as Group$1, Matrix3, MathUtils, Box3, Matrix4, Ray } from "three";
3
3
  import ClipperLib from "clipper-lib";
4
4
  import Drawing from "dxf-writer";
5
5
  import { Brush, Evaluator, SUBTRACTION } from "three-bvh-csg";
@@ -2243,12 +2243,6 @@ class Point {
2243
2243
  this.y = arr[1];
2244
2244
  return this;
2245
2245
  }
2246
- /**
2247
- *
2248
- */
2249
- toArray() {
2250
- return [this.x, this.y];
2251
- }
2252
2246
  /**
2253
2247
  * multiplyScalar
2254
2248
  * @param scalar
@@ -2484,6 +2478,12 @@ class Point {
2484
2478
  this.y = p2.y ?? 0;
2485
2479
  return this;
2486
2480
  }
2481
+ /**
2482
+ *
2483
+ */
2484
+ toArray() {
2485
+ return [this.x, this.y];
2486
+ }
2487
2487
  toJson(z = 0) {
2488
2488
  return {
2489
2489
  x: this.x,
@@ -2491,6 +2491,9 @@ class Point {
2491
2491
  z
2492
2492
  };
2493
2493
  }
2494
+ toVector3(z = 0) {
2495
+ return new Vector3(this.x, this.y, z);
2496
+ }
2494
2497
  static adsorb(points, tolerance = 15e-5) {
2495
2498
  const grid = new PointVirtualGrid();
2496
2499
  points.forEach((p2) => grid.insert(p2));
@@ -5209,8 +5212,7 @@ function correction$1(targettLine, lines, intersectMap, errAngle = 15) {
5209
5212
  const center = line.center;
5210
5213
  line.start.rotate(center, diff);
5211
5214
  line.end.rotate(center, diff);
5212
- if (line.userData.isDoor) doorLines.push(line);
5213
- else parallelLines.push(line);
5215
+ parallelLines.push(line);
5214
5216
  return line;
5215
5217
  }
5216
5218
  function vertical(line) {
@@ -14928,7 +14930,7 @@ const PRE_PROCESSOR = {
14928
14930
  return doorFind.getLines();
14929
14931
  },
14930
14932
  AxisAlignCorr(lines, option, verticalReferenceLine) {
14931
- verticalReferenceLine = verticalReferenceLine ?? findVerticalReference(lines);
14933
+ verticalReferenceLine = verticalReferenceLine ?? findVerticalReference(lines.filter((line) => !line.userData.isDoor));
14932
14934
  if (verticalReferenceLine) {
14933
14935
  const t2 = performance.now();
14934
14936
  const lineSegments = AxisAlignCorr.correction(lines, verticalReferenceLine, option);
@@ -15859,6 +15861,18 @@ class CommandManager extends EventDispatcher {
15859
15861
  constructor() {
15860
15862
  super();
15861
15863
  }
15864
+ /** 写入记录
15865
+ * @param name
15866
+ * @param data
15867
+ */
15868
+ addOperation(name, data) {
15869
+ const commandFlow = this.getCommandFlow(name);
15870
+ if (!commandFlow) throw new Error(`${name} 命令不存在`);
15871
+ if (commandFlow.writeOperationList) {
15872
+ this.operationList.push({ name, data });
15873
+ this.rollbackList.length = 0;
15874
+ }
15875
+ }
15862
15876
  /** 添加命令流
15863
15877
  * @param name
15864
15878
  * @returns
package/src/index.css CHANGED
@@ -125,12 +125,12 @@
125
125
  top: 10px;
126
126
  }
127
127
 
128
- .top-\[50\%\] {
129
- top: 50%;
128
+ .top-\[20px\] {
129
+ top: 20px;
130
130
  }
131
131
 
132
- .right-\[0px\] {
133
- right: 0;
132
+ .top-\[50\%\] {
133
+ top: 50%;
134
134
  }
135
135
 
136
136
  .right-\[10px\] {
@@ -161,6 +161,10 @@
161
161
  left: 20px;
162
162
  }
163
163
 
164
+ .left-\[50\%\] {
165
+ left: 50%;
166
+ }
167
+
164
168
  .z-20 {
165
169
  z-index: 20;
166
170
  }
@@ -169,6 +173,10 @@
169
173
  z-index: 100;
170
174
  }
171
175
 
176
+ .z-\[8\] {
177
+ z-index: 8;
178
+ }
179
+
172
180
  .z-\[11\] {
173
181
  z-index: 11;
174
182
  }
@@ -403,11 +411,21 @@
403
411
  flex-shrink: 1;
404
412
  }
405
413
 
414
+ .translate-x-\[-50\%\] {
415
+ --tw-translate-x: -50%;
416
+ translate: var(--tw-translate-x) var(--tw-translate-y);
417
+ }
418
+
406
419
  .translate-y-\[-50\%\] {
407
420
  --tw-translate-y: -50%;
408
421
  translate: var(--tw-translate-x) var(--tw-translate-y);
409
422
  }
410
423
 
424
+ .translate-y-\[100\%\] {
425
+ --tw-translate-y: 100%;
426
+ translate: var(--tw-translate-x) var(--tw-translate-y);
427
+ }
428
+
411
429
  .rotate-90 {
412
430
  rotate: 90deg;
413
431
  }
@@ -553,22 +571,10 @@
553
571
  border-bottom-width: 1px;
554
572
  }
555
573
 
556
- .\!border-\[var\(--primary-color\)\] {
557
- border-color: var(--primary-color) !important;
558
- }
559
-
560
- .border-\[\#00ff0a\] {
561
- border-color: #00ff0a;
562
- }
563
-
564
574
  .border-\[\#ccc\] {
565
575
  border-color: #ccc;
566
576
  }
567
577
 
568
- .border-\[\#fff\] {
569
- border-color: #fff;
570
- }
571
-
572
578
  .border-t-\[\#eee\] {
573
579
  border-top-color: #eee;
574
580
  }
@@ -585,6 +591,10 @@
585
591
  background-color: var(--primary-color) !important;
586
592
  }
587
593
 
594
+ .\!bg-transparent {
595
+ background-color: #0000 !important;
596
+ }
597
+
588
598
  .bg-\[\#717171\] {
589
599
  background-color: #717171;
590
600
  }
@@ -601,6 +611,10 @@
601
611
  background-color: #f0f0f0;
602
612
  }
603
613
 
614
+ .bg-\[rgba\(0\,0\,0\,0\.5\)\] {
615
+ background-color: #00000080;
616
+ }
617
+
604
618
  .bg-\[var\(--el-color-primary\)\] {
605
619
  background-color: var(--el-color-primary);
606
620
  }
@@ -795,6 +809,12 @@
795
809
  transition-duration: var(--tw-duration, var(--default-transition-duration));
796
810
  }
797
811
 
812
+ .transition-transform {
813
+ transition-property: transform, translate, scale, rotate;
814
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
815
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
816
+ }
817
+
798
818
  .select-none {
799
819
  -webkit-user-select: none;
800
820
  user-select: none;
@@ -1017,8 +1037,15 @@ button[data-v-bb22d14b]:active {
1017
1037
  color: #a7a7a7
1018
1038
  }
1019
1039
 
1020
- [data-v-461b52cf] {
1040
+ [data-v-3cf5db0e] {
1021
1041
  font-family: 宋体;
1042
+ }
1043
+ .button[data-v-3cf5db0e] {
1044
+ padding: 5px 10px;
1045
+ border: none;
1046
+ background: var(--primary-color);
1047
+ color: white;
1048
+ border-radius: 6px;
1022
1049
  }
1023
1050
 
1024
1051
  .editorToolContent .el-checkbox__label {