build-dxf 0.1.36 → 0.1.37

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.36",
3
+ "version": "0.1.37",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/index.css CHANGED
@@ -1169,10 +1169,10 @@ button[data-v-f2bc3db4]:active {
1169
1169
  color: #a7a7a7
1170
1170
  }
1171
1171
 
1172
- [data-v-75418819] {
1172
+ [data-v-b369d5e1] {
1173
1173
  font-family: 宋体;
1174
1174
  }
1175
- .button[data-v-75418819] {
1175
+ .button[data-v-b369d5e1] {
1176
1176
  padding: 5px 10px;
1177
1177
  border: none;
1178
1178
  background: var(--primary-color);
package/src/index3.js CHANGED
@@ -9707,37 +9707,43 @@ class RenderManager extends Component {
9707
9707
  radius = radius ?? isMobileRef.value ? 0.08 : 0.06;
9708
9708
  quadtree = quadtree ?? this.quadtree;
9709
9709
  const editor = this.parent?.findComponentByName("Editor"), point = Point.from(editor.pointerPosition);
9710
- let result = this.lineAdsorption.value ? quadtree.queryCircle(point, radius) : [];
9711
- if (result.length) {
9712
- let projectList = result.map((res) => ({
9710
+ let result = {
9711
+ point: new THREE.Vector3(editor.pointerPosition.x, editor.pointerPosition.y, 0),
9712
+ find: false,
9713
+ line: void 0,
9714
+ mode: void 0
9715
+ };
9716
+ let queryResult = this.lineAdsorption.value ? quadtree.queryCircle(point, radius) : [];
9717
+ if (queryResult.length) {
9718
+ let projectList = queryResult.map((res) => ({
9713
9719
  point: res.line.projectPoint(point),
9714
9720
  line: res.line
9715
9721
  })).filter((item) => !!item.point);
9716
9722
  projectList.sort((a, b) => a.point.distance(point) - b.point.distance(point));
9717
9723
  if (projectList.length) {
9718
- const line2 = projectList[0].line, projectPoint = projectList[0].point, opt = {
9724
+ const line2 = projectList[0].line, projectPoint = projectList[0].point;
9725
+ result = {
9719
9726
  point: new THREE.Vector3(projectPoint.x, projectPoint.y, 0),
9720
9727
  find: true,
9721
9728
  mode: "line",
9722
9729
  line: line2
9723
9730
  };
9724
- if (!this.pointAdsorption.value) return opt;
9725
- if (line2.start.distance(point) < radius * 1.5) {
9726
- opt.point.set(line2.start.x, line2.start.y, 0);
9727
- opt.mode = "point";
9728
- } else if (line2.end.distance(point) < radius * 1.5) {
9729
- opt.point.set(line2.end.x, line2.end.y, 0);
9730
- opt.mode = "point";
9731
+ if (this.pointAdsorption.value) {
9732
+ if (line2.start.distance(point) < radius * 1.5) {
9733
+ result.point.set(line2.start.x, line2.start.y, 0);
9734
+ result.mode = "point";
9735
+ } else if (line2.end.distance(point) < radius * 1.5) {
9736
+ result.point.set(line2.end.x, line2.end.y, 0);
9737
+ result.mode = "point";
9738
+ }
9731
9739
  }
9732
- return opt;
9733
9740
  }
9734
9741
  }
9735
- return {
9736
- point: new THREE.Vector3(editor.pointerPosition.x, editor.pointerPosition.y, 0),
9737
- find: false,
9738
- line: void 0,
9739
- mode: void 0
9740
- };
9742
+ this.dispatchEvent({
9743
+ type: "adsorptionPointChange",
9744
+ ...result
9745
+ });
9746
+ return result;
9741
9747
  }
9742
9748
  /**
9743
9749
  * 辅助线吸附
@@ -11075,7 +11081,7 @@ class CommandFlowComponent extends Component {
11075
11081
  `;
11076
11082
  }
11077
11083
  });
11078
- textMesh.setText();
11084
+ textMesh.setText(opt?.text);
11079
11085
  return textMesh;
11080
11086
  }
11081
11087
  /** 创建关闭按钮
@@ -11100,7 +11106,7 @@ class CommandFlowComponent extends Component {
11100
11106
  `;
11101
11107
  }
11102
11108
  });
11103
- textMesh.setText();
11109
+ textMesh.setText(opt?.text);
11104
11110
  return textMesh;
11105
11111
  }
11106
11112
  /** 创建确认按钮
@@ -11125,7 +11131,7 @@ class CommandFlowComponent extends Component {
11125
11131
  `;
11126
11132
  }
11127
11133
  });
11128
- textMesh.setText();
11134
+ textMesh.setText(opt?.text);
11129
11135
  return textMesh;
11130
11136
  }
11131
11137
  }
@@ -12722,7 +12728,7 @@ class DrawDoorLine extends CommandFlowComponent {
12722
12728
  return data;
12723
12729
  }
12724
12730
  }
12725
- function createPage$2(drawLine) {
12731
+ function createPage$1(drawLine) {
12726
12732
  function View() {
12727
12733
  return createVNode("div", {
12728
12734
  "class": " z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",
@@ -12876,7 +12882,7 @@ class DrawLine extends CommandFlowComponent {
12876
12882
  const {
12877
12883
  destroy: destroy1,
12878
12884
  directionLock
12879
- } = createPage$2(this);
12885
+ } = createPage$1(this);
12880
12886
  const {
12881
12887
  destroy: destroy2,
12882
12888
  setPoint: setDragPoint
@@ -14138,61 +14144,48 @@ class ClippingLine extends CommandFlowComponent {
14138
14144
  onAddFromParent(parent) {
14139
14145
  super.onAddFromParent(parent);
14140
14146
  this.editor.container.add(this.container);
14141
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
14142
- commandFlow.addEventListener("finally", this.createFinally(["selectPointStart"]));
14143
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
14144
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
14145
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
14146
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
14147
+ const commandFlow = this.initCommandFlow({
14148
+ shortcutKeys: this.shortcutKeys
14149
+ });
14150
+ commandFlow.add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this));
14147
14151
  }
14148
14152
  /** 选择开始点
14149
14153
  * @param next
14150
14154
  */
14151
- selectPointStart(next) {
14152
- let currentPoint = null, circle = this.renderer.createCircle(Point.zero(), { color: 16711935 }), currentLine = null;
14153
- this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
14154
- const { point, line: line2, find } = this.editor.renderManager.adsorption();
14155
- this.dispatchEvent({ type: "pointerMove", point });
14156
- if (find) {
14157
- this.domElement.style.cursor = "none";
14158
- circle.position.copy(point);
14159
- currentLine = line2;
14160
- currentPoint = point.clone();
14161
- this.container.add(circle);
14162
- } else {
14163
- this.domElement.style.cursor = "no-drop";
14164
- currentPoint = null;
14165
- circle.removeFromParent();
14166
- }
14167
- })).add(this.eventInput.addEventListener("codeChange", () => {
14168
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
14169
- this.cancelEventRecord("selectPointStart");
14170
- next({ point: currentPoint, line: currentLine });
14155
+ async selectPointStart(next) {
14156
+ let circle = this.renderer.createCircle(Point.zero(), { color: 16711935 }, this.container);
14157
+ const pointSelector = this.createPointSelector({
14158
+ onMove(point2) {
14159
+ if (point2) {
14160
+ circle.position.set(point2?.x, point2?.y, 0);
14161
+ circle.visible = true;
14162
+ } else {
14163
+ circle.visible = false;
14164
+ }
14171
14165
  }
14172
- }));
14173
- this.addEventRecord("clear").add(() => circle.removeFromParent());
14166
+ });
14167
+ this.addEventRecord("clear").add(() => {
14168
+ circle.removeFromParent();
14169
+ pointSelector.end();
14170
+ });
14171
+ const { point, line: line2 } = await pointSelector.next("line_point") ?? {};
14172
+ if (!point) return;
14173
+ circle.visible = true;
14174
+ pointSelector.end();
14175
+ next({ point, line: line2 });
14174
14176
  }
14175
14177
  /** 选择结束点
14176
14178
  * @param next
14177
14179
  */
14178
- selectPointEnd(next, { point, line: line2 }) {
14179
- let currentPoint = null, circle = this.renderer.createCircle(Point.zero(), { color: 16711935 });
14180
- this.addEventRecord("clear").add(() => circle.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
14181
- const { point: point2, find, line: l } = this.editor.renderManager.adsorption();
14182
- this.dispatchEvent({ type: "pointerMove", point: point2 });
14183
- if (find && l === line2) {
14184
- this.domElement.style.cursor = "none";
14185
- circle.position.copy(point2);
14186
- currentPoint = point2.clone();
14187
- this.container.add(circle);
14188
- } else {
14189
- this.domElement.style.cursor = "no-drop";
14190
- currentPoint = null;
14191
- circle.removeFromParent();
14192
- }
14193
- })).add(this.eventInput.addEventListener("codeChange", () => {
14194
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) next({ line: line2, start: point, end: currentPoint });
14195
- }));
14180
+ async selectPointEnd(next, { point, line: line2 }) {
14181
+ const pointSelector = this.createPointSelector({ targetLines: [line2] });
14182
+ this.addEventRecord("clear").add(() => {
14183
+ pointSelector.end();
14184
+ });
14185
+ const { point: p1 } = await pointSelector.next("line_point") ?? {};
14186
+ if (!point) return;
14187
+ pointSelector.end();
14188
+ next({ line: line2, start: point, end: p1 });
14196
14189
  }
14197
14190
  /**
14198
14191
  * 结束处理
@@ -14200,7 +14193,7 @@ class ClippingLine extends CommandFlowComponent {
14200
14193
  * @param points
14201
14194
  */
14202
14195
  end(next, { start, end, line: line2 }) {
14203
- const lines = LineSegment.clippingByLine(line2, new LineSegment(Point.from(start), Point.from(end)), (newLine) => {
14196
+ const lines = LineSegment.clippingByLine(line2, new LineSegment(start, end), (newLine) => {
14204
14197
  recomputedWindowCenter(newLine);
14205
14198
  });
14206
14199
  next({
@@ -14210,7 +14203,7 @@ class ClippingLine extends CommandFlowComponent {
14210
14203
  }
14211
14204
  /** 执行完成
14212
14205
  */
14213
- completed(data) {
14206
+ onCompleted(data) {
14214
14207
  this.renderManager.removeLine(data.oldLine);
14215
14208
  this.renderManager.addLines(data.newLines);
14216
14209
  this.renderManager.draw();
@@ -14218,7 +14211,7 @@ class ClippingLine extends CommandFlowComponent {
14218
14211
  /** 回滚操作
14219
14212
  * @param data
14220
14213
  */
14221
- rollback(data) {
14214
+ onRollback(data) {
14222
14215
  this.renderManager.addLine(data.oldLine);
14223
14216
  this.renderManager.removeLines(data.newLines);
14224
14217
  return data;
@@ -14227,8 +14220,8 @@ class ClippingLine extends CommandFlowComponent {
14227
14220
  * @param data
14228
14221
  * @returns
14229
14222
  */
14230
- revokeRollback(data) {
14231
- this.completed(data);
14223
+ onRevokeRollback(data) {
14224
+ this.onCompleted(data);
14232
14225
  return data;
14233
14226
  }
14234
14227
  }
@@ -14506,194 +14499,6 @@ function modifyWindow(context, winLine, line2, index2) {
14506
14499
  });
14507
14500
  return promise;
14508
14501
  }
14509
- function createPage$1(context) {
14510
- function View() {
14511
- return createVNode("div", {
14512
- "class": " z-20 absolute left-0 top-[50%] translate-y-[-50%] flex flex-col p-[10px] gap-[16px]",
14513
- "onClick": (e) => e.stopPropagation(),
14514
- "onPointerdown": (e) => e.stopPropagation()
14515
- }, [createVNode("div", {
14516
- "onClick": () => directionLock.value = !directionLock.value,
14517
- "class": {
14518
- "rounded-[100px] size-[40px] bg-[#717171] flex justify-center items-center transition-colors": true,
14519
- "!bg-[var(--primary-color)]": directionLock.value
14520
- }
14521
- }, [createVNode("svg", {
14522
- "fill": "#fff",
14523
- "viewBox": "0 0 1109 1024",
14524
- "version": "1.1",
14525
- "xmlns": "http://www.w3.org/2000/svg",
14526
- "width": "26",
14527
- "height": "26"
14528
- }, [createVNode("path", {
14529
- "d": "M988.06258 639.599977l121.007826-209.599699h-92.511867a31.551955 31.551955 0 0 0-0.367999-7.439989A510.943266 510.943266 0 0 0 511.999265 0.000896c-282.303594 0-511.999264 229.67967-511.999264 511.999264s229.67967 511.999264 511.999264 511.999264a510.015267 510.015267 0 0 0 350.399496-138.703801 32.479953 32.479953 0 0 0-44.463936-47.359932 445.35936 445.35936 0 0 1-305.95156 121.103826c-246.399646 0-447.023357-200.527712-447.023358-447.007357s200.559712-447.039357 447.039358-447.039357a445.967359 445.967359 0 0 1 439.359368 365.023475h-84.367879z",
14530
- "p-id": "6529"
14531
- }, null), createVNode("path", {
14532
- "d": "M688.719011 469.456221H669.775038v-79.647885a156.223775 156.223775 0 0 0-312.447551 0v79.647885h-12.799981a29.103958 29.103958 0 0 0-29.007959 29.007958v195.663719a29.103958 29.103958 0 0 0 29.007959 29.007958h344.159505a29.087958 29.087958 0 0 0 28.975958-29.007958V498.464179a29.087958 29.087958 0 0 0-28.943958-29.007958z m-266.431617-79.647885a91.255869 91.255869 0 1 1 182.511737 0v79.647885H422.287394z"
14533
- }, null)])])]);
14534
- }
14535
- const directionLock = ref(false);
14536
- const destroy = context.createVueApp(View);
14537
- return {
14538
- directionLock,
14539
- destroy
14540
- };
14541
- }
14542
- function modifyDoor(context, line2) {
14543
- function update() {
14544
- lineMesh.setPoint(line2.start.toVector3(), line2.end.toVector3());
14545
- group.position.copy(line2.center.toJson(0));
14546
- width.value = mToMm(line2.length());
14547
- }
14548
- function end() {
14549
- if (ended.value) return;
14550
- ended.value = true;
14551
- context.renderManager.addLine(oldLine);
14552
- context.renderManager.draw();
14553
- group.clear();
14554
- group.removeFromParent();
14555
- lineMesh.removeFromParent();
14556
- destroy();
14557
- }
14558
- const {
14559
- promise,
14560
- resolve
14561
- } = createPromise(), lineMesh = new (isMobileRef.value ? Lines : Lines2)([line2.start.toVector3(), line2.end.toVector3()], 16776960, {
14562
- linewidth: 4
14563
- }), group = new THREE.Group(), {
14564
- destroy,
14565
- directionLock
14566
- } = createPage$1(context), lines = [], width = ref(0), dragging = ref(false), ended = ref(false), oldLine = line2;
14567
- line2 = line2.clone();
14568
- let baseLine = null;
14569
- context.renderManager.removeLine(oldLine);
14570
- lineMesh.position.z = 5e-3;
14571
- context.container.add(lineMesh);
14572
- context.container.add(group);
14573
- line2.points.forEach((point, index2) => {
14574
- const {
14575
- dragPointMesh,
14576
- setPoint
14577
- } = context.createDragPoint(point, {
14578
- size: 20,
14579
- auxiliaryLine: true,
14580
- onStart() {
14581
- baseLine = line2.clone();
14582
- dragging.value = true;
14583
- },
14584
- onEnd() {
14585
- setPoint(point);
14586
- dragging.value = false;
14587
- },
14588
- onChange(p, {
14589
- line: sl
14590
- }) {
14591
- if (directionLock.value && baseLine) context.pointLineConstraint(p, baseLine, index2 === 0 ? baseLine.points[1] : baseLine.points[0]);
14592
- point.copy(p);
14593
- if (sl && sl.parallel(line2, 10) && line2.length() > 0.2) lines[index2] = sl;
14594
- update();
14595
- }
14596
- });
14597
- const btn = context.createEditButton({
14598
- text: `L: ${mToMm(line2.length())}mm`,
14599
- parent: dragPointMesh,
14600
- style: {
14601
- marginLeft: "20px",
14602
- transform: "translateY(-50%)"
14603
- },
14604
- position: Point.zero(),
14605
- freedom: true,
14606
- async onClick() {
14607
- const {
14608
- promise: promise2,
14609
- close: close2
14610
- } = context.openWidthEditor({
14611
- defaultWidth: width.value,
14612
- showCancel: true,
14613
- minWidth: 200
14614
- });
14615
- context.addCommandEndHandle(close2);
14616
- const w = mmTom(await promise2), otherPoint = line2.getAnotherPoint(point), dir = point.direction(otherPoint);
14617
- point.copy(otherPoint).add(dir.multiplyScalar(w));
14618
- setPoint(point);
14619
- update();
14620
- }
14621
- });
14622
- watch(width, () => {
14623
- btn.setText(width.value + "mm");
14624
- });
14625
- watch(dragging, () => {
14626
- btn.visible = !dragging.value;
14627
- });
14628
- watch(ended, () => {
14629
- btn.removeFromParent();
14630
- dragPointMesh.removeFromParent();
14631
- });
14632
- });
14633
- line2.points.forEach((point, i) => {
14634
- const list1 = context.renderManager.quadtree.queryPoint(point).filter((item) => item.line !== line2);
14635
- if (list1.length === 1) lines[i] = list1[0].line;
14636
- else lines[i] = null;
14637
- });
14638
- context.addCommandEndHandle(end);
14639
- update();
14640
- context.showConfirm.value = true;
14641
- context.awaitOnlyKeys(["enter"]).then(() => {
14642
- end();
14643
- const list = [{
14644
- line: oldLine,
14645
- old: {
14646
- start: oldLine.start.toJson(0),
14647
- end: oldLine.end.toJson(0)
14648
- },
14649
- new: {
14650
- start: line2.start.toJson(0),
14651
- end: line2.end.toJson(0)
14652
- }
14653
- }];
14654
- lines.forEach((line22, i) => {
14655
- if (!line22) return;
14656
- if (line22 && line22.parallel(line2, 10)) {
14657
- const pLine = line22.projectLineSegment(line2);
14658
- if (!pLine || pLine.length() < 1e-3) {
14659
- const line_ = line22.clone();
14660
- if (line22.start.distance(line2.points[i]) < line22.end.distance(line2.points[i])) line_.start.copy(line2.points[i]);
14661
- else line_.end.copy(line2.points[i]);
14662
- list.push({
14663
- line: line22,
14664
- old: {
14665
- start: line22.start.toJson(0),
14666
- end: line22.end.toJson(0)
14667
- },
14668
- new: {
14669
- start: line_.start.toJson(0),
14670
- end: line_.end.toJson(0)
14671
- }
14672
- });
14673
- return;
14674
- }
14675
- const results = LineSegment.clippingByLine(line22, pLine);
14676
- if (!results.length) return;
14677
- list.push({
14678
- line: line22,
14679
- old: {
14680
- start: line22.start.toJson(0),
14681
- end: line22.end.toJson(0)
14682
- },
14683
- new: {
14684
- start: results[0].start.toJson(0),
14685
- end: results[0].end.toJson(0)
14686
- }
14687
- });
14688
- }
14689
- });
14690
- resolve({
14691
- type: "door",
14692
- list
14693
- });
14694
- });
14695
- return promise;
14696
- }
14697
14502
  function createPage(context, opt) {
14698
14503
  function View() {
14699
14504
  return createVNode("div", {
@@ -14742,7 +14547,7 @@ function createPage(context, opt) {
14742
14547
  }, null)])]), createVNode("div", {
14743
14548
  "onClick": opt.onResetClick,
14744
14549
  "class": {
14745
- "rounded-[100px] size-[32px] bg-[#717171] flex justify-center items-center transition-colors": true,
14550
+ "rounded-[6px] size-[32px] bg-[#717171] flex justify-center items-center transition-colors": true,
14746
14551
  "!bg-[var(--primary-color)] button": true
14747
14552
  }
14748
14553
  }, [createVNode("svg", {
@@ -14755,26 +14560,7 @@ function createPage(context, opt) {
14755
14560
  "height": "20"
14756
14561
  }, [createVNode("path", {
14757
14562
  "d": "M502.714987 58.258904l-126.531056-54.617723a52.797131 52.797131 0 0 0-41.873587 96.855428A447.865322 447.865322 0 0 0 392.02307 946.707184a61.535967 61.535967 0 0 0 13.83649 1.820591 52.797131 52.797131 0 0 0 13.65443-103.773672 342.453118 342.453118 0 0 1-31.678278-651.771485l-8.374718 19.480321a52.615072 52.615072 0 0 0 27.855039 69.182448 51.522718 51.522718 0 0 0 20.572675 4.369418A52.797131 52.797131 0 0 0 476.498481 254.882703L530.205907 127.441352a52.979191 52.979191 0 0 0-27.49092-69.182448zM962.960326 509.765407A448.775617 448.775617 0 0 0 643.992829 68.090094a52.797131 52.797131 0 1 0-30.403866 101.042786A342.635177 342.635177 0 0 1 674.578753 801.059925a52.615072 52.615072 0 0 0-92.30395-50.612422l-71.913335 117.246043a52.433013 52.433013 0 0 0 17.295612 72.82363l117.063985 72.823629a52.797131 52.797131 0 1 0 54.617722-89.755123l-16.021198-10.013249A448.593558 448.593558 0 0 0 962.960326 509.765407z"
14758
- }, null)])]), recordCount.value ? createVNode("div", {
14759
- "onClick": opt.onRevokeClick,
14760
- "class": {
14761
- "rounded-[100px] size-[32px] bg-[#717171] flex justify-center items-center transition-colors": true,
14762
- "!bg-[var(--primary-color)] button": true
14763
- }
14764
- }, [createVNode("svg", {
14765
- "fill": "#fff",
14766
- "viewBox": "0 0 1024 1024",
14767
- "version": "1.1",
14768
- "xmlns": "http://www.w3.org/2000/svg",
14769
- "p-id": "44557",
14770
- "width": "20",
14771
- "height": "20"
14772
- }, [createVNode("path", {
14773
- "d": "M64 347.552L320 128v448z",
14774
- "p-id": "44558"
14775
- }, null), createVNode("path", {
14776
- "d": "M265.472 896V784h377.824a200 200 0 1 0 0-400H240V272h403.296c172.32 0 312 139.68 312 312s-139.68 312-312 312H265.472z"
14777
- }, null)])]) : ""]);
14563
+ }, null)])])]);
14778
14564
  }
14779
14565
  const directionLock = ref(false);
14780
14566
  const follow = ref(true);
@@ -14807,6 +14593,7 @@ async function modifyLine(context, line2) {
14807
14593
  value: newValue
14808
14594
  }];
14809
14595
  point.copy(newPoint);
14596
+ width.value = mToMm(line2.length());
14810
14597
  if (follow.value) list.forEach((item) => {
14811
14598
  if (item.point === point) item.list.forEach((item2) => {
14812
14599
  records.push({
@@ -14857,14 +14644,13 @@ async function modifyLine(context, line2) {
14857
14644
  setPoint(line2.end, oldLine.end.clone());
14858
14645
  list[0].setDragPos(line2.start);
14859
14646
  list[1].setDragPos(line2.end);
14860
- },
14861
- onRevokeClick: revoke
14647
+ }
14862
14648
  }), {
14863
14649
  promise,
14864
14650
  resolve
14865
- } = createPromise(), oldLine = line2, group = new Group(), linesMesh = new Lines([], 65280), linesMesh2 = new LineDashed([], 5745151), recordsList = [], dragging = ref(false), ended = ref(false), ControlZ = context.awaitOnlyKeys(["Control", "Z"], {
14651
+ } = createPromise(), oldLine = line2, group = new Group(), linesMesh = new Lines([], 65280), linesMesh2 = new LineDashed([], 5745151), width = ref(mToMm(line2.length())), dragging = ref(false), ended = ref(false), ControlZ = context.awaitOnlyKeys(["Control", "Z"], {
14866
14652
  once: false
14867
- });
14653
+ }), recordsList = [];
14868
14654
  context.renderManager.removeLine(line2);
14869
14655
  group.add(linesMesh);
14870
14656
  group.add(linesMesh2);
@@ -14879,8 +14665,7 @@ async function modifyLine(context, line2) {
14879
14665
  const list2 = context.renderManager.pointVirtualGrid.queryPoint(point).map((item) => ({
14880
14666
  line: item.userData,
14881
14667
  point: item.point
14882
- }));
14883
- const olds = list2.map((item) => ({
14668
+ })), olds = list2.map((item) => ({
14884
14669
  line: item.line,
14885
14670
  start: item.line.start.toJson(),
14886
14671
  end: item.line.end.toJson()
@@ -14888,7 +14673,8 @@ async function modifyLine(context, line2) {
14888
14673
  list2.forEach((item) => context.renderManager.removeLine(item.line));
14889
14674
  const {
14890
14675
  setPoint: setDragPos,
14891
- destroy: destroy2
14676
+ destroy: destroy2,
14677
+ dragPointMesh
14892
14678
  } = context.createDragPoint(point, {
14893
14679
  size: 20,
14894
14680
  auxiliaryLine: true,
@@ -14896,16 +14682,50 @@ async function modifyLine(context, line2) {
14896
14682
  baseLine = line2.clone();
14897
14683
  dragging.value = true;
14898
14684
  writeIndex = recordsList.length;
14685
+ textMesh.visible = true;
14686
+ textMesh.setText(width.value + "mm");
14687
+ textMesh.setPosition(line2.center);
14899
14688
  },
14900
14689
  onEnd() {
14901
14690
  setDragPos(point);
14902
14691
  dragging.value = false;
14692
+ textMesh.visible = false;
14903
14693
  },
14904
14694
  onChange(p) {
14905
14695
  if (directionLock.value && baseLine) context.pointLineConstraint(p, baseLine, index2 === 0 ? baseLine.points[1] : baseLine.points[0]);
14906
14696
  setPoint(point, p);
14697
+ textMesh.setText(width.value + "mm");
14698
+ textMesh.setPosition(line2.center);
14699
+ }
14700
+ }), textMesh = context.createButton({
14701
+ text: ""
14702
+ }), btn = context.createEditButton({
14703
+ text: width.value + "mm",
14704
+ parent: dragPointMesh,
14705
+ style: {
14706
+ marginLeft: "20px",
14707
+ transform: "translateY(-50%)"
14708
+ },
14709
+ position: Point.zero(),
14710
+ freedom: true,
14711
+ async onClick() {
14712
+ const {
14713
+ promise: promise2,
14714
+ close: close2
14715
+ } = context.openWidthEditor({
14716
+ defaultWidth: width.value,
14717
+ showCancel: true,
14718
+ minWidth: 200
14719
+ });
14720
+ context.addCommandEndHandle(close2);
14721
+ const w = mmTom(await promise2), otherPoint = line2.getAnotherPoint(point), dir = point.direction(otherPoint);
14722
+ setPoint(point, otherPoint.clone().add(dir.multiplyScalar(w)));
14723
+ setDragPos(point);
14907
14724
  }
14908
14725
  });
14726
+ textMesh.visible = false;
14727
+ watch(width, () => btn.setText(width.value + "mm"));
14728
+ watch(dragging, () => btn.visible = !dragging.value);
14909
14729
  watch(ended, () => destroy2());
14910
14730
  return {
14911
14731
  point,
@@ -14997,7 +14817,7 @@ class PointDrag extends CommandFlowComponent {
14997
14817
  lineSelector.end();
14998
14818
  if (!line2) return;
14999
14819
  if (line2.userData.isWinLine) next(await modifyWindow(this, line2, line2.currentData.line, line2.currentData.index));
15000
- else if (line2.userData.isDoor) next(await modifyDoor(this, line2));
14820
+ else if (line2.userData.isDoor) next(await modifyLine(this, line2));
15001
14821
  else next(await modifyLine(this, line2));
15002
14822
  }
15003
14823
  async verify(next, data) {
@@ -15020,6 +14840,7 @@ class PointDrag extends CommandFlowComponent {
15020
14840
  data.list.forEach(({ line: line2, new: newData }) => {
15021
14841
  line2.start.copy(newData.start);
15022
14842
  line2.end.copy(newData.end);
14843
+ recomputedWindow(line2);
15023
14844
  });
15024
14845
  }
15025
14846
  this.renderManager.draw();
@@ -15037,6 +14858,7 @@ class PointDrag extends CommandFlowComponent {
15037
14858
  data.list.forEach(({ line: line2, old: newData }) => {
15038
14859
  line2.start.copy(newData.start);
15039
14860
  line2.end.copy(newData.end);
14861
+ recomputedWindow(line2);
15040
14862
  });
15041
14863
  }
15042
14864
  this.renderManager.draw();
@@ -15301,17 +15123,21 @@ const _hoisted_12 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[
15301
15123
  const _hoisted_13 = ["onClick", "title"];
15302
15124
  const _hoisted_14 = ["src"];
15303
15125
  const _hoisted_15 = {
15304
- key: 0,
15305
- class: "items-end box-border pointer-events-none p-[0_5px] w-full absolute left-[0px] bottom-[calc(100%+5px)] flex gap-[5px]"
15306
- };
15307
- const _hoisted_16 = { class: "text-[#fff] rounded-[6px] p-[5px] text-nowrap" };
15308
- const _hoisted_17 = { class: "text-[14px] flex flex-row flex-wrap gap-[10px]" };
15309
- const _hoisted_18 = ["onClick"];
15310
- const _hoisted_19 = { class: "flex justify-center items-center size-[30px] bg-[#f0f0f0] rounded-[2px]" };
15311
- const _hoisted_20 = ["src"];
15312
- const _hoisted_21 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
15313
- const _hoisted_22 = ["onClick", "title"];
15314
- const _hoisted_23 = ["src"];
15126
+ style: { "--el-color-primary": "var(--primary-color)" },
15127
+ class: "absolute left-0 bottom-[calc(100%+5px)] p-[0_5px] flex flex-row items-center justify-between gap-[0px] mt-[10px] text-[10px]"
15128
+ };
15129
+ const _hoisted_16 = { class: "text-[14px] flex flex-row flex-wrap gap-[10px]" };
15130
+ const _hoisted_17 = ["onClick"];
15131
+ const _hoisted_18 = { class: "flex justify-center items-center size-[30px] bg-[#f0f0f0] rounded-[2px]" };
15132
+ const _hoisted_19 = ["src"];
15133
+ const _hoisted_20 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
15134
+ const _hoisted_21 = ["onClick", "title"];
15135
+ const _hoisted_22 = ["src"];
15136
+ const _hoisted_23 = {
15137
+ key: 1,
15138
+ class: "items-end box-border pointer-events-none p-[0_5px] w-full absolute left-[0px] top-0 flex gap-[5px]"
15139
+ };
15140
+ const _hoisted_24 = { class: "text-[#fff] rounded-[6px] p-[5px] text-nowrap" };
15315
15141
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15316
15142
  __name: "EditorToolContent",
15317
15143
  props: {
@@ -15429,6 +15255,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15429
15255
  command: MergeLine.commandName,
15430
15256
  name: "合并",
15431
15257
  src: images["../assets/images/mergeLine.svg"].default,
15258
+ show: computed(() => !isMobileRef.value),
15432
15259
  disabled: computed(() => selectLineCount.value >= 2),
15433
15260
  shortcut: MergeLine.shortcutKeys.join(" + ")
15434
15261
  },
@@ -15436,6 +15263,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15436
15263
  command: TwoPointConnection.commandName,
15437
15264
  name: "两点连接",
15438
15265
  disabled: computed(() => selectLineCount.value === 2),
15266
+ show: computed(() => !isMobileRef.value),
15439
15267
  src: images["../assets/images/connection.svg"].default,
15440
15268
  shortcut: TwoPointConnection.shortcutKeys.join(" + ")
15441
15269
  },
@@ -15443,6 +15271,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15443
15271
  command: TwoLineConnectionLine.commandName,
15444
15272
  name: "两线连接",
15445
15273
  disabled: computed(() => selectLineCount.value === 2),
15274
+ show: computed(() => !isMobileRef.value),
15446
15275
  src: images["../assets/images/intersectionConnection.svg"].default,
15447
15276
  shortcut: TwoLineConnectionLine.shortcutKeys.join(" + ")
15448
15277
  },
@@ -15472,6 +15301,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15472
15301
  command: ViewAngle.commandName,
15473
15302
  name: "角度显示",
15474
15303
  disabled: computed(() => selectLineCount.value === 2 && defaultComponent.selectLines[0].sameEndpoint(defaultComponent.selectLines[1])),
15304
+ show: computed(() => !isMobileRef.value),
15475
15305
  src: images["../assets/images/angle.svg"].default,
15476
15306
  shortcut: ViewAngle.shortcutKeys.join(" + ")
15477
15307
  },
@@ -15593,7 +15423,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15593
15423
  title: "取消命令(Esc)",
15594
15424
  class: "active:scale-[0.7] transition-all flex items-center justify-center",
15595
15425
  onClick: _cache[0] || (_cache[0] = (e) => (unref(editor).cancelCommand(), e.stopPropagation()))
15596
- }, _cache[14] || (_cache[14] = [
15426
+ }, _cache[17] || (_cache[17] = [
15597
15427
  createElementVNode("svg", {
15598
15428
  fill: "#fff",
15599
15429
  width: "16",
@@ -15611,7 +15441,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15611
15441
  onClick: commandConfirm,
15612
15442
  title: "确认命令(Enter)",
15613
15443
  class: "active:scale-[0.7] transition-all flex items-center justify-center"
15614
- }, _cache[15] || (_cache[15] = [
15444
+ }, _cache[18] || (_cache[18] = [
15615
15445
  createElementVNode("svg", {
15616
15446
  fill: "#fff",
15617
15447
  width: "16",
@@ -15634,22 +15464,22 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15634
15464
  modelValue: dxfVisible.value,
15635
15465
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dxfVisible.value = $event)
15636
15466
  }, {
15637
- default: withCtx(() => _cache[16] || (_cache[16] = [
15467
+ default: withCtx(() => _cache[19] || (_cache[19] = [
15638
15468
  createTextVNode("Dxf", -1)
15639
15469
  ])),
15640
15470
  _: 1,
15641
- __: [16]
15471
+ __: [19]
15642
15472
  }, 8, ["modelValue"]),
15643
15473
  createVNode(unref(ElCheckbox), {
15644
15474
  size: "small",
15645
15475
  modelValue: unref(editor).renderManager.lineAdsorption.value,
15646
15476
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(editor).renderManager.lineAdsorption.value = $event)
15647
15477
  }, {
15648
- default: withCtx(() => _cache[17] || (_cache[17] = [
15478
+ default: withCtx(() => _cache[20] || (_cache[20] = [
15649
15479
  createTextVNode("线吸附", -1)
15650
15480
  ])),
15651
15481
  _: 1,
15652
- __: [17]
15482
+ __: [20]
15653
15483
  }, 8, ["modelValue"]),
15654
15484
  createVNode(unref(ElCheckbox), {
15655
15485
  disabled: !unref(editor).renderManager.lineAdsorption.value,
@@ -15657,11 +15487,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15657
15487
  modelValue: unref(editor).renderManager.pointAdsorption.value,
15658
15488
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(editor).renderManager.pointAdsorption.value = $event)
15659
15489
  }, {
15660
- default: withCtx(() => _cache[18] || (_cache[18] = [
15490
+ default: withCtx(() => _cache[21] || (_cache[21] = [
15661
15491
  createTextVNode("点吸附", -1)
15662
15492
  ])),
15663
15493
  _: 1,
15664
- __: [18]
15494
+ __: [21]
15665
15495
  }, 8, ["disabled", "modelValue"])
15666
15496
  ]),
15667
15497
  _ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_11, [
@@ -15671,11 +15501,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15671
15501
  type: "success",
15672
15502
  onClick: selectLocalFile
15673
15503
  }, {
15674
- default: withCtx(() => _cache[19] || (_cache[19] = [
15504
+ default: withCtx(() => _cache[22] || (_cache[22] = [
15675
15505
  createTextVNode(" 选择文件 ", -1)
15676
15506
  ])),
15677
15507
  _: 1,
15678
- __: [19]
15508
+ __: [22]
15679
15509
  }),
15680
15510
  createVNode(unref(ElButton), {
15681
15511
  style: { "padding": "5px", "font-size": "10px" },
@@ -15683,11 +15513,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15683
15513
  type: "primary",
15684
15514
  onClick: _cache[4] || (_cache[4] = ($event) => unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))
15685
15515
  }, {
15686
- default: withCtx(() => _cache[20] || (_cache[20] = [
15516
+ default: withCtx(() => _cache[23] || (_cache[23] = [
15687
15517
  createTextVNode(" 下载Json ", -1)
15688
15518
  ])),
15689
15519
  _: 1,
15690
- __: [20]
15520
+ __: [23]
15691
15521
  }),
15692
15522
  createVNode(unref(ElButton), {
15693
15523
  style: { "padding": "5px", "font-size": "10px" },
@@ -15695,11 +15525,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15695
15525
  type: "primary",
15696
15526
  onClick: _cache[5] || (_cache[5] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxf("test.dxf"))
15697
15527
  }, {
15698
- default: withCtx(() => _cache[21] || (_cache[21] = [
15528
+ default: withCtx(() => _cache[24] || (_cache[24] = [
15699
15529
  createTextVNode(" 下载DXF ", -1)
15700
15530
  ])),
15701
15531
  _: 1,
15702
- __: [21]
15532
+ __: [24]
15703
15533
  }),
15704
15534
  createVNode(unref(ElButton), {
15705
15535
  style: { "padding": "5px", "font-size": "10px" },
@@ -15707,11 +15537,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15707
15537
  type: "primary",
15708
15538
  onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxfImage("dxf.jpg"))
15709
15539
  }, {
15710
- default: withCtx(() => _cache[22] || (_cache[22] = [
15540
+ default: withCtx(() => _cache[25] || (_cache[25] = [
15711
15541
  createTextVNode(" 下载JPG ", -1)
15712
15542
  ])),
15713
15543
  _: 1,
15714
- __: [22]
15544
+ __: [25]
15715
15545
  }),
15716
15546
  createVNode(unref(ElButton), {
15717
15547
  style: { "padding": "5px", "font-size": "10px" },
@@ -15719,11 +15549,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15719
15549
  type: "primary",
15720
15550
  onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
15721
15551
  }, {
15722
- default: withCtx(() => _cache[23] || (_cache[23] = [
15552
+ default: withCtx(() => _cache[26] || (_cache[26] = [
15723
15553
  createTextVNode(" 下载白膜 ", -1)
15724
15554
  ])),
15725
15555
  _: 1,
15726
- __: [23]
15556
+ __: [26]
15727
15557
  }),
15728
15558
  createVNode(unref(ElButton), {
15729
15559
  style: { "padding": "5px", "font-size": "10px" },
@@ -15731,11 +15561,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15731
15561
  type: "primary",
15732
15562
  onClick: _cache[8] || (_cache[8] = ($event) => unref(threeVJia).download())
15733
15563
  }, {
15734
- default: withCtx(() => _cache[24] || (_cache[24] = [
15564
+ default: withCtx(() => _cache[27] || (_cache[27] = [
15735
15565
  createTextVNode(" 下载三维家JSON ", -1)
15736
15566
  ])),
15737
15567
  _: 1,
15738
- __: [24]
15568
+ __: [27]
15739
15569
  }),
15740
15570
  createVNode(unref(ElDropdown), {
15741
15571
  class: "ml-[5px]",
@@ -15755,11 +15585,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15755
15585
  size: "small",
15756
15586
  type: "primary"
15757
15587
  }, {
15758
- default: withCtx(() => _cache[25] || (_cache[25] = [
15588
+ default: withCtx(() => _cache[28] || (_cache[28] = [
15759
15589
  createTextVNode(" z值调整 ", -1)
15760
15590
  ])),
15761
15591
  _: 1,
15762
- __: [25]
15592
+ __: [28]
15763
15593
  })
15764
15594
  ]),
15765
15595
  _: 1
@@ -15798,13 +15628,46 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15798
15628
  ])) : (openBlock(), createElementBlock("div", {
15799
15629
  key: 1,
15800
15630
  class: normalizeClass([{ "translate-y-[100%]": isMainCommand.value }, "z-[8] absolute left-0 bottom-0 transition-transform w-[100%] bg-white p-[5px] box-border text-[14px]"]),
15801
- onMousedown: _cache[10] || (_cache[10] = (e) => e.stopPropagation()),
15802
- onPointerdown: _cache[11] || (_cache[11] = (e) => e.stopPropagation())
15631
+ onMousedown: _cache[13] || (_cache[13] = (e) => e.stopPropagation()),
15632
+ onPointerdown: _cache[14] || (_cache[14] = (e) => e.stopPropagation())
15803
15633
  }, [
15804
- isMainCommand.value && currentMainCommand.value ? (openBlock(), createElementBlock("div", _hoisted_15, [
15805
- createElementVNode("div", _hoisted_16, toDisplayString(currentMainCommand.value.name), 1)
15806
- ])) : createCommentVNode("", true),
15807
- createElementVNode("ul", _hoisted_17, [
15634
+ createElementVNode("div", _hoisted_15, [
15635
+ createVNode(unref(ElCheckbox), {
15636
+ size: "small",
15637
+ modelValue: dxfVisible.value,
15638
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => dxfVisible.value = $event)
15639
+ }, {
15640
+ default: withCtx(() => _cache[29] || (_cache[29] = [
15641
+ createTextVNode("Dxf", -1)
15642
+ ])),
15643
+ _: 1,
15644
+ __: [29]
15645
+ }, 8, ["modelValue"]),
15646
+ createVNode(unref(ElCheckbox), {
15647
+ size: "small",
15648
+ modelValue: unref(editor).renderManager.lineAdsorption.value,
15649
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => unref(editor).renderManager.lineAdsorption.value = $event)
15650
+ }, {
15651
+ default: withCtx(() => _cache[30] || (_cache[30] = [
15652
+ createTextVNode("线吸附", -1)
15653
+ ])),
15654
+ _: 1,
15655
+ __: [30]
15656
+ }, 8, ["modelValue"]),
15657
+ createVNode(unref(ElCheckbox), {
15658
+ disabled: !unref(editor).renderManager.lineAdsorption.value,
15659
+ size: "small",
15660
+ modelValue: unref(editor).renderManager.pointAdsorption.value,
15661
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => unref(editor).renderManager.pointAdsorption.value = $event)
15662
+ }, {
15663
+ default: withCtx(() => _cache[31] || (_cache[31] = [
15664
+ createTextVNode("点吸附", -1)
15665
+ ])),
15666
+ _: 1,
15667
+ __: [31]
15668
+ }, 8, ["disabled", "modelValue"])
15669
+ ]),
15670
+ createElementVNode("ul", _hoisted_16, [
15808
15671
  (openBlock(), createElementBlock(Fragment, null, renderList(commandList, (item) => {
15809
15672
  return openBlock(), createElementBlock(Fragment, {
15810
15673
  key: item.command
@@ -15814,19 +15677,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15814
15677
  onClick: ($event) => startCurrentCommandItem(item),
15815
15678
  class: normalizeClass([{ "!bg-[var(--primary-color)] ": currentCommand.value === item.command }, "gap-[10px] relative hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
15816
15679
  }, [
15817
- createElementVNode("div", _hoisted_19, [
15680
+ createElementVNode("div", _hoisted_18, [
15818
15681
  createElementVNode("img", {
15819
15682
  class: "size-[20px]",
15820
15683
  src: item.src,
15821
15684
  alt: "",
15822
15685
  srcset: ""
15823
- }, null, 8, _hoisted_20)
15686
+ }, null, 8, _hoisted_19)
15824
15687
  ])
15825
- ], 10, _hoisted_18)) : createCommentVNode("", true)
15688
+ ], 10, _hoisted_17)) : createCommentVNode("", true)
15826
15689
  ], 64);
15827
15690
  }), 64))
15828
15691
  ]),
15829
- createElementVNode("div", _hoisted_21, [
15692
+ createElementVNode("div", _hoisted_20, [
15830
15693
  createVNode(TransitionGroup, null, {
15831
15694
  default: withCtx(() => [
15832
15695
  (openBlock(), createElementBlock(Fragment, null, renderList(otherCommandList, (item) => {
@@ -15842,8 +15705,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15842
15705
  createElementVNode("img", {
15843
15706
  class: "size-[20px]",
15844
15707
  src: item.src
15845
- }, null, 8, _hoisted_23)
15846
- ], 10, _hoisted_22), [
15708
+ }, null, 8, _hoisted_22)
15709
+ ], 10, _hoisted_21), [
15847
15710
  [vShow, !(item.show?.value === false)]
15848
15711
  ]);
15849
15712
  }), 64))
@@ -15857,13 +15720,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15857
15720
  }, [
15858
15721
  isMainCommand.value ? (openBlock(), createElementBlock("div", {
15859
15722
  key: 0,
15860
- onMousemove: _cache[13] || (_cache[13] = (e) => e.stopPropagation()),
15723
+ onMousemove: _cache[16] || (_cache[16] = (e) => e.stopPropagation()),
15861
15724
  class: "cursor-pointer z-[8] box-border bg-[rgba(0,0,0,0.5)] rounded-[6px] p-[5px] absolute left-[50%] translate-x-[-50%] top-[20px] flex gap-[5px] items-center"
15862
15725
  }, [
15863
15726
  createElementVNode("button", {
15864
- onClick: _cache[12] || (_cache[12] = (e) => (unref(editor).cancelCommand(), e.stopPropagation())),
15727
+ onClick: _cache[15] || (_cache[15] = (e) => (unref(editor).cancelCommand(), e.stopPropagation())),
15865
15728
  class: "!bg-transparent button cursor-pointer"
15866
- }, _cache[26] || (_cache[26] = [
15729
+ }, _cache[32] || (_cache[32] = [
15867
15730
  createElementVNode("svg", {
15868
15731
  fill: "#fff",
15869
15732
  viewBox: "0 0 1024 1024",
@@ -15879,7 +15742,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15879
15742
  key: 0,
15880
15743
  onClick: commandConfirm,
15881
15744
  class: "button !bg-transparent cursor-pointer"
15882
- }, _cache[27] || (_cache[27] = [
15745
+ }, _cache[33] || (_cache[33] = [
15883
15746
  createElementVNode("svg", {
15884
15747
  fill: "#28c932",
15885
15748
  viewBox: "0 0 1026 1024",
@@ -15891,13 +15754,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
15891
15754
  createElementVNode("path", { d: "M79.288 400c19.2 0 38.4 9.6 54.4 25.6l240 249.6c12.8 16 19.2 16 35.2 0 147.2-153.6 294.4-304 441.6-457.6 16-16 32-35.2 48-51.2 28.8-28.8 70.4-32 99.2-6.4 32 25.6 38.4 73.6 9.6 105.6-32 38.4-67.2 73.6-102.4 108.8-150.4 156.8-300.8 313.6-454.4 470.4-38.4 38.4-80 41.6-115.2 6.4-105.6-108.8-211.2-217.6-313.6-326.4-22.4-25.6-28.8-54.4-12.8-83.2 12.8-25.6 35.2-41.6 70.4-41.6z" })
15892
15755
  ], -1)
15893
15756
  ]))) : createCommentVNode("", true)
15894
- ], 32)) : createCommentVNode("", true)
15757
+ ], 32)) : createCommentVNode("", true),
15758
+ isMainCommand.value && currentMainCommand.value ? (openBlock(), createElementBlock("div", _hoisted_23, [
15759
+ createElementVNode("div", _hoisted_24, toDisplayString(currentMainCommand.value.name), 1)
15760
+ ])) : createCommentVNode("", true)
15895
15761
  ], 8, ["to"]))
15896
15762
  ], 64);
15897
15763
  };
15898
15764
  }
15899
15765
  });
15900
- const EditorToolContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-75418819"]]);
15766
+ const EditorToolContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b369d5e1"]]);
15901
15767
  class StorageHelper {
15902
15768
  static get(key, defaultValue = void 0) {
15903
15769
  const value = localStorage.getItem(key);
@@ -1,6 +1,8 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { LineSegment } from '../../../../../LineSegment';
3
3
  import { ComponentManager } from '../../../../../ComponentManager';
4
+ import { Point } from '../../../../../Point';
5
+ import { LineUserData } from '../../../../type';
4
6
  import * as THREE from "three";
5
7
  export declare class ClippingLine extends CommandFlowComponent<{
6
8
  pointerMove: {
@@ -15,14 +17,14 @@ export declare class ClippingLine extends CommandFlowComponent<{
15
17
  /** 选择开始点
16
18
  * @param next
17
19
  */
18
- selectPointStart(next: any): void;
20
+ selectPointStart(next: any): Promise<void>;
19
21
  /** 选择结束点
20
22
  * @param next
21
23
  */
22
24
  selectPointEnd(next: any, { point, line }: {
23
- point: THREE.Vector3;
25
+ point: Point;
24
26
  line: LineSegment;
25
- }): void;
27
+ }): Promise<void>;
26
28
  /**
27
29
  * 结束处理
28
30
  * @param next
@@ -31,14 +33,20 @@ export declare class ClippingLine extends CommandFlowComponent<{
31
33
  private end;
32
34
  /** 执行完成
33
35
  */
34
- completed(data: any): void;
36
+ protected onCompleted(data: any): void;
35
37
  /** 回滚操作
36
38
  * @param data
37
39
  */
38
- private rollback;
40
+ protected onRollback(data: any): any;
39
41
  /** 撤回回滚
40
42
  * @param data
41
43
  * @returns
42
44
  */
43
- private revokeRollback;
45
+ protected onRevokeRollback(data: {
46
+ doorDataItem: any;
47
+ line: LineSegment<LineUserData>;
48
+ }): {
49
+ doorDataItem: any;
50
+ line: LineSegment<LineUserData>;
51
+ };
44
52
  }
@@ -20,7 +20,9 @@ export type AdsorptionResult = {
20
20
  line: undefined;
21
21
  mode: undefined;
22
22
  };
23
- export declare class RenderManager extends Component<{}> {
23
+ export declare class RenderManager extends Component<{
24
+ adsorptionPointChange: AdsorptionResult;
25
+ }> {
24
26
  static name: string;
25
27
  container: THREE.Group<THREE.Object3DEventMap>;
26
28
  lines: LineSegment<LineUserData>[];