build-dxf 0.0.20-12 → 0.0.20-13

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.0.20-12",
3
+ "version": "0.0.20-13",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/index3.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as m from "three";
2
- import { i as dt, n as lt, r as $e, t as He, c as Le, d as ct, e as mt, f as _e, g as B, _ as qe, u as ht, h as me, j as Pe, w as ut, k as pt, l as vt, p as ft, m as gt, o as yt, T as Ie, q as Se, s as wt, v as bt, x as Ne, y as Ee, z as Ce, A as xt, B as Ct, L as he, D as Mt, b as Oe, E as pe, S as Et } from "./selectLocalFile.js";
2
+ import { i as dt, n as lt, r as qe, t as $e, c as Le, d as ct, e as mt, f as De, g as B, _ as He, u as ht, h as me, j as Pe, w as ut, k as pt, l as vt, p as ft, m as gt, o as yt, T as Ie, q as Se, s as wt, v as bt, x as Ne, y as Ee, z as Ce, A as xt, B as Ct, L as he, D as Mt, b as Oe, E as pe, S as Et } from "./selectLocalFile.js";
3
3
  import { C as ye, L as ne, P as A, B as We, E as Ue, b as Re, Q as ze, W as Lt } from "./build.js";
4
4
  import "clipper-lib";
5
5
  import "dxf-writer";
6
6
  import "three/addons/controls/OrbitControls.js";
7
- import { watch as V, ref as E, defineComponent as oe, computed as _, createElementBlock as S, openBlock as M, normalizeClass as O, unref as v, renderSlot as fe, createVNode as z, Transition as ge, withCtx as F, withDirectives as Qe, createElementVNode as x, normalizeStyle as De, createTextVNode as le, toDisplayString as J, vShow as Ye, shallowReactive as _t, onMounted as Ze, createBlock as de, createCommentVNode as $, resolveDynamicComponent as Dt, Fragment as ce, withModifiers as kt, nextTick as ve, isVNode as Xe, render as Be, toRaw as Pt, onUnmounted as It, renderList as Me, createStaticVNode as St, TransitionGroup as Nt, createApp as Ot } from "vue";
7
+ import { watch as V, ref as E, defineComponent as oe, computed as D, createElementBlock as S, openBlock as M, normalizeClass as O, unref as v, renderSlot as fe, createVNode as z, Transition as ge, withCtx as F, withDirectives as Qe, createElementVNode as x, normalizeStyle as _e, createTextVNode as le, toDisplayString as J, vShow as Ye, shallowReactive as Dt, onMounted as Ze, createBlock as de, createCommentVNode as q, resolveDynamicComponent as _t, Fragment as ce, withModifiers as kt, nextTick as ve, isVNode as Xe, render as Be, toRaw as Pt, onUnmounted as It, renderList as Me, createStaticVNode as St, TransitionGroup as Nt, createApp as Ot } from "vue";
8
8
  function Je(r) {
9
9
  var e;
10
- const t = $e(r);
10
+ const t = qe(r);
11
11
  return (e = t?.$el) != null ? e : t;
12
12
  }
13
13
  const et = Le ? window : void 0;
@@ -18,12 +18,12 @@ function Rt(...r) {
18
18
  Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
19
19
  const s = [], a = () => {
20
20
  s.forEach((c) => c()), s.length = 0;
21
- }, i = (c, h, w, f) => (c.addEventListener(h, w, f), () => c.removeEventListener(h, w, f)), d = V(() => [Je(e), $e(o)], ([c, h]) => {
22
- a(), c && s.push(...t.flatMap((w) => n.map((f) => i(c, w, f, h))));
21
+ }, i = (c, h, f, g) => (c.addEventListener(h, f, g), () => c.removeEventListener(h, f, g)), d = V(() => [Je(e), qe(o)], ([c, h]) => {
22
+ a(), c && s.push(...t.flatMap((f) => n.map((g) => i(c, f, g, h))));
23
23
  }, { immediate: !0, flush: "post" }), l = () => {
24
24
  d(), a();
25
25
  };
26
- return He(l), l;
26
+ return $e(l), l;
27
27
  }
28
28
  function zt(r, e = !1) {
29
29
  const t = E(), n = () => t.value = !!r();
@@ -50,7 +50,7 @@ function Tt(r, e, t = {}) {
50
50
  }, { immediate: !0, flush: "post" }), c = () => {
51
51
  d(), l();
52
52
  };
53
- return He(c), {
53
+ return $e(c), {
54
54
  isSupported: i,
55
55
  stop: c
56
56
  };
@@ -67,7 +67,7 @@ var Vt = Object.defineProperty, Ae = Object.getOwnPropertySymbols, At = Object.p
67
67
  jt.call(e, t) && je(r, t, e[t]);
68
68
  return r;
69
69
  };
70
- const $t = {
70
+ const qt = {
71
71
  easeInSine: [0.12, 0, 0.39, 0],
72
72
  easeOutSine: [0.61, 1, 0.88, 1],
73
73
  easeInOutSine: [0.37, 0, 0.63, 1],
@@ -95,10 +95,10 @@ const $t = {
95
95
  };
96
96
  Gt({
97
97
  linear: mt
98
- }, $t);
99
- const Ht = (r) => r, qt = {
98
+ }, qt);
99
+ const $t = (r) => r, Ht = {
100
100
  esc: "Escape"
101
- }, Wt = _e({
101
+ }, Wt = De({
102
102
  value: {
103
103
  type: [String, Number],
104
104
  default: ""
@@ -135,7 +135,7 @@ const Ht = (r) => r, qt = {
135
135
  ...Ut,
136
136
  props: Wt,
137
137
  setup(r, { expose: e }) {
138
- const t = r, n = ht("badge"), o = _(() => t.isDot ? "" : me(t.value) && me(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = _(() => {
138
+ const t = r, n = ht("badge"), o = D(() => t.isDot ? "" : me(t.value) && me(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = D(() => {
139
139
  var a, i, d, l, c;
140
140
  return [
141
141
  {
@@ -166,7 +166,7 @@ const Ht = (r) => r, qt = {
166
166
  v(n).is("hide-zero", !a.showZero && t.value === 0),
167
167
  a.badgeClass
168
168
  ]),
169
- style: De(v(s))
169
+ style: _e(v(s))
170
170
  }, [
171
171
  fe(a.$slots, "content", { value: v(o) }, () => [
172
172
  le(J(v(o)), 1)
@@ -180,8 +180,8 @@ const Ht = (r) => r, qt = {
180
180
  ], 2));
181
181
  }
182
182
  });
183
- var Yt = /* @__PURE__ */ qe(Qt, [["__file", "badge.vue"]]);
184
- const Zt = ut(Yt), Xt = _e({
183
+ var Yt = /* @__PURE__ */ He(Qt, [["__file", "badge.vue"]]);
184
+ const Zt = ut(Yt), Xt = De({
185
185
  a11y: {
186
186
  type: Boolean,
187
187
  default: !0
@@ -236,7 +236,7 @@ const tt = [
236
236
  "info",
237
237
  "warning",
238
238
  "error"
239
- ], I = Ht({
239
+ ], I = $t({
240
240
  customClass: "",
241
241
  dangerouslyUseHTMLString: !1,
242
242
  duration: 3e3,
@@ -252,7 +252,7 @@ const tt = [
252
252
  grouping: !1,
253
253
  repeatNum: 1,
254
254
  appendTo: Le ? document.body : void 0
255
- }), Jt = _e({
255
+ }), Jt = De({
256
256
  customClass: {
257
257
  type: String,
258
258
  default: I.customClass
@@ -316,7 +316,7 @@ const tt = [
316
316
  }
317
317
  }), en = {
318
318
  destroy: () => !0
319
- }, K = _t([]), tn = (r) => {
319
+ }, K = Dt([]), tn = (r) => {
320
320
  const e = K.findIndex((o) => o.id === r), t = K[e];
321
321
  let n;
322
322
  return e > 0 && (n = K[e - 1]), { current: t, prev: n };
@@ -330,94 +330,94 @@ const tt = [
330
330
  props: Jt,
331
331
  emits: en,
332
332
  setup(r, { expose: e, emit: t }) {
333
- const n = r, { Close: o } = wt, s = E(!1), { ns: a, zIndex: i } = yt("message"), { currentZIndex: d, nextZIndex: l } = i, c = E(), h = E(!1), w = E(0);
334
- let f;
335
- const C = _(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), b = _(() => {
336
- const y = n.type;
337
- return { [a.bm("icon", y)]: y && Ie[y] };
338
- }), P = _(() => n.icon || Ie[n.type] || ""), D = _(() => nn(n.id)), j = _(() => on(n.id, n.offset) + D.value), se = _(() => w.value + j.value), ue = _(() => ({
333
+ const n = r, { Close: o } = wt, s = E(!1), { ns: a, zIndex: i } = yt("message"), { currentZIndex: d, nextZIndex: l } = i, c = E(), h = E(!1), f = E(0);
334
+ let g;
335
+ const C = D(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), b = D(() => {
336
+ const w = n.type;
337
+ return { [a.bm("icon", w)]: w && Ie[w] };
338
+ }), P = D(() => n.icon || Ie[n.type] || ""), _ = D(() => nn(n.id)), j = D(() => on(n.id, n.offset) + _.value), se = D(() => f.value + j.value), ue = D(() => ({
339
339
  top: `${j.value}px`,
340
340
  zIndex: d.value
341
341
  }));
342
342
  function X() {
343
- n.duration !== 0 && ({ stop: f } = bt(() => {
343
+ n.duration !== 0 && ({ stop: g } = bt(() => {
344
344
  L();
345
345
  }, n.duration));
346
346
  }
347
347
  function R() {
348
- f?.();
348
+ g?.();
349
349
  }
350
350
  function L() {
351
351
  h.value = !1, ve(() => {
352
- var y;
353
- s.value || ((y = n.onClose) == null || y.call(n), t("destroy"));
352
+ var w;
353
+ s.value || ((w = n.onClose) == null || w.call(n), t("destroy"));
354
354
  });
355
355
  }
356
- function H({ code: y }) {
357
- y === qt.esc && L();
356
+ function $({ code: w }) {
357
+ w === Ht.esc && L();
358
358
  }
359
359
  return Ze(() => {
360
360
  X(), l(), h.value = !0;
361
361
  }), V(() => n.repeatNum, () => {
362
362
  R(), X();
363
- }), Rt(document, "keydown", H), Tt(c, () => {
364
- w.value = c.value.getBoundingClientRect().height;
363
+ }), Rt(document, "keydown", $), Tt(c, () => {
364
+ f.value = c.value.getBoundingClientRect().height;
365
365
  }), e({
366
366
  visible: h,
367
367
  bottom: se,
368
368
  close: L
369
- }), (y, we) => (M(), de(ge, {
369
+ }), (w, we) => (M(), de(ge, {
370
370
  name: v(a).b("fade"),
371
371
  onBeforeEnter: (ae) => s.value = !0,
372
- onBeforeLeave: y.onClose,
373
- onAfterLeave: (ae) => y.$emit("destroy"),
372
+ onBeforeLeave: w.onClose,
373
+ onAfterLeave: (ae) => w.$emit("destroy"),
374
374
  persisted: ""
375
375
  }, {
376
376
  default: F(() => [
377
377
  Qe(x("div", {
378
- id: y.id,
378
+ id: w.id,
379
379
  ref_key: "messageRef",
380
380
  ref: c,
381
381
  class: O([
382
382
  v(a).b(),
383
- { [v(a).m(y.type)]: y.type },
384
- v(a).is("closable", y.showClose),
385
- v(a).is("plain", y.plain),
386
- y.customClass
383
+ { [v(a).m(w.type)]: w.type },
384
+ v(a).is("closable", w.showClose),
385
+ v(a).is("plain", w.plain),
386
+ w.customClass
387
387
  ]),
388
- style: De(v(ue)),
388
+ style: _e(v(ue)),
389
389
  role: "alert",
390
390
  onMouseenter: R,
391
391
  onMouseleave: X
392
392
  }, [
393
- y.repeatNum > 1 ? (M(), de(v(Zt), {
393
+ w.repeatNum > 1 ? (M(), de(v(Zt), {
394
394
  key: 0,
395
- value: y.repeatNum,
395
+ value: w.repeatNum,
396
396
  type: v(C),
397
397
  class: O(v(a).e("badge"))
398
- }, null, 8, ["value", "type", "class"])) : $("v-if", !0),
398
+ }, null, 8, ["value", "type", "class"])) : q("v-if", !0),
399
399
  v(P) ? (M(), de(v(Se), {
400
400
  key: 1,
401
401
  class: O([v(a).e("icon"), v(b)])
402
402
  }, {
403
403
  default: F(() => [
404
- (M(), de(Dt(v(P))))
404
+ (M(), de(_t(v(P))))
405
405
  ]),
406
406
  _: 1
407
- }, 8, ["class"])) : $("v-if", !0),
408
- fe(y.$slots, "default", {}, () => [
409
- y.dangerouslyUseHTMLString ? (M(), S(ce, { key: 1 }, [
410
- $(" Caution here, message could've been compromised, never use user's input as message "),
407
+ }, 8, ["class"])) : q("v-if", !0),
408
+ fe(w.$slots, "default", {}, () => [
409
+ w.dangerouslyUseHTMLString ? (M(), S(ce, { key: 1 }, [
410
+ q(" Caution here, message could've been compromised, never use user's input as message "),
411
411
  x("p", {
412
412
  class: O(v(a).e("content")),
413
- innerHTML: y.message
413
+ innerHTML: w.message
414
414
  }, null, 10, ["innerHTML"])
415
415
  ], 2112)) : (M(), S("p", {
416
416
  key: 0,
417
417
  class: O(v(a).e("content"))
418
- }, J(y.message), 3))
418
+ }, J(w.message), 3))
419
419
  ]),
420
- y.showClose ? (M(), de(v(Se), {
420
+ w.showClose ? (M(), de(v(Se), {
421
421
  key: 2,
422
422
  class: O(v(a).e("closeBtn")),
423
423
  onClick: kt(L, ["stop"])
@@ -426,7 +426,7 @@ const tt = [
426
426
  z(v(o))
427
427
  ]),
428
428
  _: 1
429
- }, 8, ["class", "onClick"])) : $("v-if", !0)
429
+ }, 8, ["class", "onClick"])) : q("v-if", !0)
430
430
  ], 46, ["id"]), [
431
431
  [Ye, h.value]
432
432
  ])
@@ -435,7 +435,7 @@ const tt = [
435
435
  }, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]));
436
436
  }
437
437
  });
438
- var rn = /* @__PURE__ */ qe(an, [["__file", "message.vue"]]);
438
+ var rn = /* @__PURE__ */ He(an, [["__file", "message.vue"]]);
439
439
  let dn = 1;
440
440
  const nt = (r) => {
441
441
  const e = !r || Ne(r) || Xe(r) || Ee(r) ? { message: r } : r, t = {
@@ -633,8 +633,8 @@ class hn extends T {
633
633
  this.addEventRecord(
634
634
  "clear",
635
635
  t.addEventListener("pointerPositionChange", () => {
636
- const { point: w, find: f } = t.renderManager.adsorption();
637
- if (this.dispatchEvent({ type: "pointerMove", point: w }), f ? (a.position.set(w.x, w.y, 0), this.container.add(a), i.style.cursor = "none") : (a.removeFromParent(), i.style.cursor = "crosshair"), h.copy(w), !!(n && o)) {
636
+ const { point: f, find: g } = t.renderManager.adsorption();
637
+ if (this.dispatchEvent({ type: "pointerMove", point: f }), g ? (a.position.set(f.x, f.y, 0), this.container.add(a), i.style.cursor = "none") : (a.removeFromParent(), i.style.cursor = "crosshair"), h.copy(f), !!(n && o)) {
638
638
  if (t.eventInput.isKeyDown("shift")) {
639
639
  const C = Math.abs(t.pointerPosition.x - n.x), b = Math.abs(t.pointerPosition.y - n.y);
640
640
  C > b ? o.set(t.pointerPosition.x, n.y, 0) : o.set(n.x, t.pointerPosition.y, 0), c(), h.copy(o);
@@ -652,8 +652,8 @@ class hn extends T {
652
652
  o = h.clone(), s.push(n.clone(), o.clone()), n.copy(o), c();
653
653
  } else if (t.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
654
654
  if (s.length) {
655
- const { point: w } = t.renderManager.adsorption();
656
- s.pop(), o?.copy(w), n?.copy(s.pop()), c();
655
+ const { point: f } = t.renderManager.adsorption();
656
+ s.pop(), o?.copy(f), n?.copy(s.pop()), c();
657
657
  }
658
658
  } else t.eventInput.isKeyDowns(this.confirmKeys) && e(s);
659
659
  }),
@@ -749,7 +749,7 @@ class ke extends ye {
749
749
  start() {
750
750
  const e = this.editor, t = e.eventInput, n = new m.Mesh(), o = e.domContainer.domElement;
751
751
  let s = null;
752
- n.position.z = 0.01, this.selectLineObject3D.position.z = n.position.z + 0.01, n.material = new m.MeshBasicMaterial({ color: 55561 });
752
+ n.position.z = 1e-3, this.selectLineObject3D.position.z = n.position.z + 1e-3, n.material = new m.MeshBasicMaterial({ color: 55561 });
753
753
  const a = () => {
754
754
  const i = e.pointerPosition.clone(), d = e.pointerPosition.clone(), l = new m.Mesh();
755
755
  this.container.add(l), l.position.z = 0.05, l.material = new m.MeshBasicMaterial({
@@ -758,8 +758,8 @@ class ke extends ye {
758
758
  opacity: 0.5
759
759
  });
760
760
  const c = () => {
761
- const f = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), D = [
762
- f,
761
+ const g = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), _ = [
762
+ g,
763
763
  P,
764
764
  0,
765
765
  C,
@@ -768,33 +768,33 @@ class ke extends ye {
768
768
  C,
769
769
  P,
770
770
  0,
771
- f,
771
+ g,
772
772
  P,
773
773
  0,
774
- f,
774
+ g,
775
775
  b,
776
776
  0,
777
777
  C,
778
778
  b,
779
779
  0
780
780
  ];
781
- l.geometry = e.renderManager.createGeometry({ position: D }, D.length / 3);
781
+ l.geometry = e.renderManager.createGeometry({ position: _ }, _.length / 3);
782
782
  }, h = () => {
783
783
  d.copy(e.pointerPosition), c();
784
- }, w = () => {
785
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", w), l.removeFromParent();
786
- const f = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), D = new We(f, C, b, P), j = e.renderManager.quadtree.queryBox(D);
784
+ }, f = () => {
785
+ document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", f), l.removeFromParent();
786
+ const g = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), _ = new We(g, C, b, P), j = e.renderManager.quadtree.queryBox(_);
787
787
  this.removeSelectLineAll(), j.forEach((se) => this.addSelectLine(se.line)), this.updateSelectLinesGeometry();
788
788
  };
789
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", w);
789
+ document.addEventListener("mousemove", h), document.addEventListener("mouseup", f);
790
790
  };
791
791
  this.addEventRecord(
792
792
  "clear",
793
793
  // 注册鼠标指针位置变化事件
794
794
  e.addEventListener("pointerPositionChange", () => {
795
- const { line: i } = e.renderManager.adsorption(0.05);
795
+ const { line: i } = e.renderManager.adsorption(0.02);
796
796
  if (i) {
797
- const d = i.expandToRectangle(0.02, "bothSides");
797
+ const d = i.expandToRectangle(0.025, "bothSides");
798
798
  n.geometry = e.renderManager.createGeometry({ position: d.createGeometry() }, 6), this.container.add(n), o.style.cursor = "pointer", s = i;
799
799
  } else
800
800
  n.removeFromParent(), o.style.cursor = "default", s = null;
@@ -967,12 +967,12 @@ const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version=
967
967
  }, Symbol.toStringTag, { value: "Module" })), Mn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e", En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
968
968
  __proto__: null,
969
969
  default: Mn
970
- }, Symbol.toStringTag, { value: "Module" })), Ln = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e", _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
970
+ }, Symbol.toStringTag, { value: "Module" })), Ln = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e", Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
971
971
  __proto__: null,
972
972
  default: Ln
973
- }, Symbol.toStringTag, { value: "Module" })), Dn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e", kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
973
+ }, Symbol.toStringTag, { value: "Module" })), _n = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e", kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
974
974
  __proto__: null,
975
- default: Dn
975
+ default: _n
976
976
  }, Symbol.toStringTag, { value: "Module" })), Pn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e", In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
977
977
  __proto__: null,
978
978
  default: Pn
@@ -1398,18 +1398,21 @@ class ee extends T {
1398
1398
  * @param point2
1399
1399
  */
1400
1400
  getSamePointAll(e, t) {
1401
- return this.renderManager.pointVirtualGrid.queryPoint(e).map((o) => ({
1402
- point: o.point,
1403
- oldPoint: o.point.clone(),
1404
- newPoint: t,
1405
- line: o.userData
1406
- }));
1401
+ return this.renderManager.pointVirtualGrid.queryPoint(e).map((o) => {
1402
+ const s = {
1403
+ point: o.point,
1404
+ oldPoint: o.point.clone(),
1405
+ newPoint: t,
1406
+ line: o.userData
1407
+ };
1408
+ return o.point.copy(s.newPoint), s;
1409
+ });
1407
1410
  }
1408
1411
  /** 修正
1409
1412
  * @param targettLine
1410
1413
  * @param vistedList
1411
1414
  */
1412
- correction(e, t = [], n = /* @__PURE__ */ new Set()) {
1415
+ correction0(e, t = [], n = /* @__PURE__ */ new Set()) {
1413
1416
  if (n.has(e)) return;
1414
1417
  n.add(e);
1415
1418
  const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: a }) => !(a === e || a.userData.isDoor)).map((a) => a.line), s = e.direction();
@@ -1419,20 +1422,41 @@ class ee extends T {
1419
1422
  const i = a.direction(), d = s.angleBetween(i, "angle"), l = Math.abs(90 - d);
1420
1423
  if (!(l > 20 || l < 1))
1421
1424
  if (this.isTowLineSegmentConnect(e, a)) {
1422
- const c = e.start.equal(a.start) || e.start.equal(a.end) ? e.start : e.end, h = a.start.equal(e.start) || a.start.equal(e.end) ? a.end : a.start, w = new ne(
1425
+ const c = e.start.equal(a.start) || e.start.equal(a.end) ? e.start : e.end, h = a.start.equal(e.start) || a.start.equal(e.end) ? a.end : a.start, f = new ne(
1423
1426
  h.clone().add(s.clone().multiplyScalar(1)),
1424
1427
  h.clone().add(s.clone().multiplyScalar(-1))
1425
- ), f = w.projectPoint(c, !1);
1426
- f && t.push(this.getSamePointAll(h, f));
1428
+ ), g = f.projectPoint(c, !1);
1429
+ g && t.push(this.getSamePointAll(h, g));
1427
1430
  } else
1428
1431
  console.log("交点");
1429
- }), this.recursion && o.forEach((a) => this.correction(a, t, n)), t;
1432
+ }), this.recursion && o.forEach((a) => this.correction0(a, t, n)), t;
1433
+ }
1434
+ /** 修正2
1435
+ * 第一步:确定需要修复的线段
1436
+ * 第二步:查找与该线段相交的其他线段
1437
+ * 第三步:找出两端点相交的线段,其他为区间相交
1438
+ * 第四步:找出两端点相交的线段数量,大于2, 该点不能修
1439
+ * 第五步:修正
1440
+ * 第六步:修正同向线段
1441
+ * @param targettLine
1442
+ * @param vistedList
1443
+ */
1444
+ correction(e, t = [], n = /* @__PURE__ */ new Set()) {
1445
+ if (n.has(e)) return;
1446
+ n.add(e);
1447
+ const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: d }) => !(d === e || d.userData.isDoor)).map((d) => d.line);
1448
+ e.direction();
1449
+ const [s, a, i] = o.reduce((d, l) => {
1450
+ const [c, h, f] = d;
1451
+ return e.start.equal(l.start) || e.start.equal(l.end) ? c.push(l) : e.end.equal(l.start) || e.end.equal(l.end) ? h.push(l) : f.push(l), d;
1452
+ }, [[], [], []]);
1453
+ return s.length >= 2, console.log(s, a, i), t;
1430
1454
  }
1431
1455
  /** 开始
1432
1456
  * @param next
1433
1457
  */
1434
1458
  verticalCorrection(e, t) {
1435
- e(this.correction(t[0]));
1459
+ e(this.correction0(t[0]));
1436
1460
  }
1437
1461
  /** 执行完成
1438
1462
  * @param data
@@ -1464,15 +1488,15 @@ class ee extends T {
1464
1488
  return this.completed(e), e;
1465
1489
  }
1466
1490
  }
1467
- class q extends T {
1491
+ class H extends T {
1468
1492
  static name = "MergeLine";
1469
1493
  shortcutKeys = ["control", "g"];
1470
1494
  static commandName = "merge-line";
1471
1495
  onAddFromParent(e) {
1472
1496
  super.onAddFromParent(e);
1473
- const t = e.findComponentByType(ke), n = this.commandManager.addCommandFlow(q.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1474
- n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(q.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1475
- t?.selectLines.length === 2 && this.eventInput.isKeyCombination(q.commandName) && await this.commandManager.start(q.commandName, [...this.default.selectLines]);
1497
+ const t = e.findComponentByType(ke), n = this.commandManager.addCommandFlow(H.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1498
+ n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(H.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1499
+ t?.selectLines.length === 2 && this.eventInput.isKeyCombination(H.commandName) && await this.commandManager.start(H.commandName, [...this.default.selectLines]);
1476
1500
  }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1477
1501
  }
1478
1502
  /**
@@ -1751,10 +1775,10 @@ class Z extends T {
1751
1775
  return this.completed(e), e;
1752
1776
  }
1753
1777
  }
1754
- const $n = {
1778
+ const qn = {
1755
1779
  key: 0,
1756
1780
  class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
1757
- }, Hn = { class: "text-start max-w-[150px]" }, qn = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, Wn = {
1781
+ }, $n = { class: "text-start max-w-[150px]" }, Hn = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, Wn = {
1758
1782
  key: 0,
1759
1783
  class: "p-[5px] max-w-[200px]"
1760
1784
  }, Un = { class: "text-[14px] flex flex-col" }, Qn = ["onClick"], Yn = { class: "flex flex-row items-center" }, Zn = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, Xn = ["src"], Jn = { class: "text-wrap" }, eo = {
@@ -1773,35 +1797,35 @@ const $n = {
1773
1797
  permission: {}
1774
1798
  },
1775
1799
  setup(r) {
1776
- function e(g, u, p = h.value.getBoundingClientRect(), G = w.value.getBoundingClientRect()) {
1800
+ function e(y, u, p = h.value.getBoundingClientRect(), G = f.value.getBoundingClientRect()) {
1777
1801
  const re = p.width - G.width, ie = 0, xe = p.height - G.height;
1778
- g = Math.max(0, Math.min(g, re)), u = Math.max(ie, Math.min(u, xe)), R.value = { left: g, top: u };
1802
+ y = Math.max(0, Math.min(y, re)), u = Math.max(ie, Math.min(u, xe)), R.value = { left: y, top: u };
1779
1803
  }
1780
- function t(g) {
1781
- C.value === g.command || C.value !== "default" || D.commandManager.start(g.command);
1804
+ function t(y) {
1805
+ C.value === y.command || C.value !== "default" || _.commandManager.start(y.command);
1782
1806
  }
1783
- function n(g) {
1784
- if (g) {
1785
- localStorage.setItem("lines", JSON.stringify(g));
1807
+ function n(y) {
1808
+ if (y) {
1809
+ localStorage.setItem("lines", JSON.stringify(y));
1786
1810
  try {
1787
- b.Dxf.set(g), b.Dxf.lineOffset();
1811
+ b.Dxf.set(y), b.Dxf.lineOffset();
1788
1812
  } catch (u) {
1789
1813
  console.log(u);
1790
1814
  }
1791
1815
  }
1792
1816
  }
1793
1817
  async function o() {
1794
- const g = await Et.json();
1795
- Array.isArray(g) && (localStorage.removeItem("orbitControls"), n(g));
1818
+ const y = await Et.json();
1819
+ Array.isArray(y) && (localStorage.removeItem("orbitControls"), n(y));
1796
1820
  }
1797
- function s({ offsetX: g, offsetY: u }) {
1821
+ function s({ offsetX: y, offsetY: u }) {
1798
1822
  P.mouseMoveEventProxylock = !0;
1799
1823
  const p = document.body.style.cursor;
1800
1824
  document.body.style.cursor = "move";
1801
1825
  const G = (re) => {
1802
- const ie = h.value.getBoundingClientRect(), xe = w.value.getBoundingClientRect();
1826
+ const ie = h.value.getBoundingClientRect(), xe = f.value.getBoundingClientRect();
1803
1827
  e(
1804
- re.pageX - ie.left - g,
1828
+ re.pageX - ie.left - y,
1805
1829
  re.pageY - ie.top - u,
1806
1830
  ie,
1807
1831
  xe
@@ -1811,7 +1835,7 @@ const $n = {
1811
1835
  };
1812
1836
  document.body.addEventListener("mousemove", G), document.addEventListener("mouseup", be);
1813
1837
  }
1814
- const a = r, i = E(!0), d = E(!0), l = E(!0), c = E(!1), h = E(), w = E(), f = E(!0), C = E(""), b = Pt(a.dxfSystem), P = b.findComponentByType(Mt), D = b.findComponentByType(ot), j = b.findComponentByType(ke), se = b.findComponentByType(Lt), ue = E(0), X = E(0), R = E({ left: 10, top: 10 }), L = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": fn, "./assets/images/deleteSelectLine.svg": yn, "./assets/images/deleteSelectWindow.svg": bn, "./assets/images/door.svg": Cn, "./assets/images/intersectionConnection.svg": En, "./assets/images/line.svg": _n, "./assets/images/mergeLine.svg": kn, "./assets/images/revokeRollback.svg": In, "./assets/images/rollback.svg": Nn, "./assets/images/selectAll.svg": Rn, "./assets/images/selectPoint.svg": Bn, "./assets/images/verticalCorrection.svg": Kn, "./assets/images/window.svg": Vn }), H = E(!1), y = E(0), we = E(!1), ae = new ResizeObserver(() => e(R.value.left, R.value.top)), st = [
1838
+ const a = r, i = E(!0), d = E(!0), l = E(!0), c = E(!1), h = E(), f = E(), g = E(!0), C = E(""), b = Pt(a.dxfSystem), P = b.findComponentByType(Mt), _ = b.findComponentByType(ot), j = b.findComponentByType(ke), se = b.findComponentByType(Lt), ue = E(0), X = E(0), R = E({ left: 10, top: 10 }), L = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": fn, "./assets/images/deleteSelectLine.svg": yn, "./assets/images/deleteSelectWindow.svg": bn, "./assets/images/door.svg": Cn, "./assets/images/intersectionConnection.svg": En, "./assets/images/line.svg": Dn, "./assets/images/mergeLine.svg": kn, "./assets/images/revokeRollback.svg": In, "./assets/images/rollback.svg": Nn, "./assets/images/selectAll.svg": Rn, "./assets/images/selectPoint.svg": Bn, "./assets/images/verticalCorrection.svg": Kn, "./assets/images/window.svg": Vn }), $ = E(!1), w = E(0), we = E(!1), ae = new ResizeObserver(() => e(R.value.left, R.value.top)), st = [
1815
1839
  { name: "开启绘制线段命令", shortcut: "Ctrl + L" },
1816
1840
  { name: "开启绘制门线命令", shortcut: "Ctrl + M" },
1817
1841
  { name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
@@ -1871,136 +1895,136 @@ const $n = {
1871
1895
  command: "",
1872
1896
  name: "操作回滚",
1873
1897
  src: L["./assets/images/rollback.svg"].default,
1874
- show: _(() => ue.value !== 0),
1898
+ show: D(() => ue.value !== 0),
1875
1899
  shortcut: "Ctrl + Z",
1876
1900
  action() {
1877
- D.commandManager.rollback();
1901
+ _.commandManager.rollback();
1878
1902
  }
1879
1903
  },
1880
1904
  {
1881
1905
  command: "",
1882
1906
  name: "撤销操作回滚",
1883
1907
  src: L["./assets/images/revokeRollback.svg"].default,
1884
- show: _(() => X.value !== 0),
1908
+ show: D(() => X.value !== 0),
1885
1909
  shortcut: "Ctrl + Y",
1886
1910
  class: "rotateY-[180deg]",
1887
1911
  action() {
1888
- D.commandManager.revokeRollback();
1912
+ _.commandManager.revokeRollback();
1889
1913
  }
1890
1914
  },
1891
1915
  {
1892
- command: q.commandName,
1916
+ command: H.commandName,
1893
1917
  name: "合并",
1894
1918
  src: L["./assets/images/mergeLine.svg"].default,
1895
- show: _(() => y.value === 2),
1919
+ show: D(() => w.value === 2),
1896
1920
  shortcut: "Ctrl + G"
1897
1921
  },
1898
1922
  {
1899
1923
  command: U.commandName,
1900
1924
  name: "两点连接",
1901
- show: _(() => y.value === 2),
1925
+ show: D(() => w.value === 2),
1902
1926
  src: L["./assets/images/connection.svg"].default,
1903
1927
  shortcut: "Shift + L"
1904
1928
  },
1905
1929
  {
1906
1930
  command: Q.commandName,
1907
1931
  name: "延长线交点连接",
1908
- show: _(() => y.value === 2),
1932
+ show: D(() => w.value === 2),
1909
1933
  src: L["./assets/images/intersectionConnection.svg"].default,
1910
1934
  shortcut: "Ctrl + Shift + L"
1911
1935
  },
1912
1936
  {
1913
1937
  command: ee.commandName,
1914
1938
  name: "线段垂直纠正",
1915
- show: _(() => y.value === 1),
1939
+ show: D(() => w.value === 1),
1916
1940
  src: L["./assets/images/verticalCorrection.svg"].default,
1917
1941
  shortcut: "Ctrl + C 或 Ctrl + Shift + C"
1918
1942
  },
1919
1943
  {
1920
1944
  command: Z.commandName,
1921
1945
  name: "全选",
1922
- show: _(() => y.value !== D.renderManager.lines.length),
1946
+ show: D(() => w.value !== _.renderManager.lines.length),
1923
1947
  src: L["./assets/images/selectAll.svg"].default,
1924
1948
  shortcut: "Ctrl + A"
1925
1949
  },
1926
1950
  {
1927
1951
  command: Y.commandName,
1928
1952
  name: "清除窗户",
1929
- show: _(() => we.value),
1953
+ show: D(() => we.value),
1930
1954
  src: L["./assets/images/deleteSelectWindow.svg"].default,
1931
1955
  shortcut: "Q + Delete"
1932
1956
  },
1933
1957
  {
1934
1958
  command: W.commandName,
1935
1959
  name: "删除",
1936
- show: _(() => y.value > 0),
1960
+ show: D(() => w.value > 0),
1937
1961
  src: L["./assets/images/deleteSelectLine.svg"].default,
1938
1962
  shortcut: "Delete"
1939
1963
  }
1940
1964
  ];
1941
- V(R, () => localStorage.setItem("editorToolPosition", JSON.stringify(R.value))), V(H, () => localStorage.setItem("showShortcutKey", H.value + "")), V(f, () => {
1942
- localStorage.setItem("toolBarExpand", f.value + ""), f.value && ve(() => e(R.value.left, R.value.top));
1943
- }), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (g) => c.value = g.value), b.Variable.addEventListener("originalLineVisible", (g) => i.value = g.value), b.Variable.addEventListener("dxfVisible", (g) => d.value = g.value), b.Variable.addEventListener("whiteModelVisible", (g) => l.value = g.value);
1944
- const it = D.commandManager.addEventListener("started", (g) => {
1945
- C.value = g.name;
1965
+ V(R, () => localStorage.setItem("editorToolPosition", JSON.stringify(R.value))), V($, () => localStorage.setItem("showShortcutKey", $.value + "")), V(g, () => {
1966
+ localStorage.setItem("toolBarExpand", g.value + ""), g.value && ve(() => e(R.value.left, R.value.top));
1967
+ }), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (y) => c.value = y.value), b.Variable.addEventListener("originalLineVisible", (y) => i.value = y.value), b.Variable.addEventListener("dxfVisible", (y) => d.value = y.value), b.Variable.addEventListener("whiteModelVisible", (y) => l.value = y.value);
1968
+ const it = _.commandManager.addEventListener("started", (y) => {
1969
+ C.value = y.name;
1946
1970
  });
1947
- return localStorage.getItem("showShortcutKey") && (H.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (f.value = localStorage.getItem("toolBarExpand") === "true"), Ze(() => {
1948
- w.value.style.display = "none", setTimeout(() => {
1949
- if (w.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
1950
- const { left: g, top: u } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
1951
- e(g, u), ve(() => ae.observe(h.value));
1971
+ return localStorage.getItem("showShortcutKey") && ($.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (g.value = localStorage.getItem("toolBarExpand") === "true"), Ze(() => {
1972
+ f.value.style.display = "none", setTimeout(() => {
1973
+ if (f.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
1974
+ const { left: y, top: u } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
1975
+ e(y, u), ve(() => ae.observe(h.value));
1952
1976
  } else
1953
1977
  ve(() => ae.observe(h.value));
1954
1978
  }, 100), j.addEventListener("selectLineChange", () => {
1955
- y.value = j.selectLines.length, we.value = j.selectLines.some((g) => g.userData.isWindow);
1956
- }), ["rollback", "completed", "revokeRollback"].forEach((g) => {
1957
- D.commandManager.addEventListener(g, () => {
1979
+ w.value = j.selectLines.length, we.value = j.selectLines.some((y) => y.userData.isWindow);
1980
+ }), ["rollback", "completed", "revokeRollback"].forEach((y) => {
1981
+ _.commandManager.addEventListener(y, () => {
1958
1982
  setTimeout(() => {
1959
- ue.value = D.commandManager.operationList.length, X.value = D.commandManager.rollbackList.length;
1983
+ ue.value = _.commandManager.operationList.length, X.value = _.commandManager.rollbackList.length;
1960
1984
  });
1961
1985
  });
1962
1986
  });
1963
1987
  }), It(() => {
1964
1988
  P.mouseMoveEventProxylock = !1, it(), ae.disconnect();
1965
- }), (g, u) => (M(), S("div", {
1989
+ }), (y, u) => (M(), S("div", {
1966
1990
  ref_key: "elRef",
1967
1991
  ref: h,
1968
1992
  class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
1969
1993
  }, [
1970
1994
  z(ge, null, {
1971
1995
  default: F(() => [
1972
- H.value ? (M(), S("div", $n, [
1996
+ $.value ? (M(), S("div", qn, [
1973
1997
  (M(), S(ce, null, Me(st, (p) => x("div", {
1974
1998
  class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
1975
1999
  key: p.name
1976
2000
  }, [
1977
- x("p", Hn, J(p.name), 1),
1978
- x("span", qn, J(p.shortcut), 1)
2001
+ x("p", $n, J(p.name), 1),
2002
+ x("span", Hn, J(p.shortcut), 1)
1979
2003
  ])), 64))
1980
- ])) : $("", !0)
2004
+ ])) : q("", !0)
1981
2005
  ]),
1982
2006
  _: 1
1983
2007
  }),
1984
2008
  x("div", {
1985
2009
  ref_key: "toolBarRef",
1986
- ref: w,
1987
- style: De({ left: R.value.left + "px", top: R.value.top + "px" }),
1988
- class: O(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": f.value }]),
2010
+ ref: f,
2011
+ style: _e({ left: R.value.left + "px", top: R.value.top + "px" }),
2012
+ class: O(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": g.value }]),
1989
2013
  onMousedown: u[8] || (u[8] = (p) => p.stopPropagation())
1990
2014
  }, [
1991
2015
  x("div", {
1992
2016
  onMousedown: s,
1993
- class: O([{ "border-b-[#eee] border-b-1": f.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
2017
+ class: O([{ "border-b-[#eee] border-b-1": g.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
1994
2018
  }, [
1995
2019
  u[10] || (u[10] = St('<div class="flex flex-row" data-v-fb4f87a4><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-fb4f87a4><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-fb4f87a4><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-fb4f87a4></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-fb4f87a4>绘制工具</h5></div>', 1)),
1996
2020
  x("div", {
1997
2021
  onMousedown: u[0] || (u[0] = (p) => p.stopPropagation()),
1998
- onClick: u[1] || (u[1] = (p) => f.value = !f.value),
2022
+ onClick: u[1] || (u[1] = (p) => g.value = !g.value),
1999
2023
  class: "cursor-pointer flex items-center p-[0px_5px]"
2000
2024
  }, [
2001
2025
  (M(), S("svg", {
2002
2026
  fill: "#666",
2003
- class: O([{ "rotate-90": f.value }, "transition-all"]),
2027
+ class: O([{ "rotate-90": g.value }, "transition-all"]),
2004
2028
  viewBox: "0 0 1024 1024",
2005
2029
  version: "1.1",
2006
2030
  xmlns: "http://www.w3.org/2000/svg",
@@ -2011,7 +2035,7 @@ const $n = {
2011
2035
  ]), 2))
2012
2036
  ], 32)
2013
2037
  ], 34),
2014
- f.value ? (M(), S("div", Wn, [
2038
+ g.value ? (M(), S("div", Wn, [
2015
2039
  x("ul", Un, [
2016
2040
  (M(), S(ce, null, Me(at, (p) => (M(), S(ce, {
2017
2041
  key: p.command
@@ -2039,7 +2063,7 @@ const $n = {
2039
2063
  key: 0,
2040
2064
  title: "取消命令(Esc)",
2041
2065
  class: "active:scale-[0.7] transition-all",
2042
- onClick: u[2] || (u[2] = (G) => (v(D).cancelCommand(), G.stopPropagation()))
2066
+ onClick: u[2] || (u[2] = (G) => (v(_).cancelCommand(), G.stopPropagation()))
2043
2067
  }, u[11] || (u[11] = [
2044
2068
  x("svg", {
2045
2069
  fill: "#fff",
@@ -2052,15 +2076,15 @@ const $n = {
2052
2076
  x("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
2053
2077
  x("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
2054
2078
  ], -1)
2055
- ]))) : p.shortcut ? (M(), S("div", eo, J(p.shortcut), 1)) : $("", !0)
2056
- ], 10, Qn)) : $("", !0)
2079
+ ]))) : p.shortcut ? (M(), S("div", eo, J(p.shortcut), 1)) : q("", !0)
2080
+ ], 10, Qn)) : q("", !0)
2057
2081
  ], 64))), 64))
2058
2082
  ]),
2059
2083
  x("div", to, [
2060
2084
  z(v(Oe), {
2061
2085
  size: "small",
2062
- modelValue: H.value,
2063
- "onUpdate:modelValue": u[3] || (u[3] = (p) => H.value = p),
2086
+ modelValue: $.value,
2087
+ "onUpdate:modelValue": u[3] || (u[3] = (p) => $.value = p),
2064
2088
  label: "快捷键提示"
2065
2089
  }, null, 8, ["modelValue"]),
2066
2090
  z(v(Oe), {
@@ -2070,7 +2094,7 @@ const $n = {
2070
2094
  label: "dxf"
2071
2095
  }, null, 8, ["modelValue"])
2072
2096
  ]),
2073
- g.permission === "admin" ? (M(), S("div", no, [
2097
+ y.permission === "admin" ? (M(), S("div", no, [
2074
2098
  z(v(pe), {
2075
2099
  style: { padding: "5px", "font-size": "10px" },
2076
2100
  size: "small",
@@ -2119,14 +2143,14 @@ const $n = {
2119
2143
  _: 1,
2120
2144
  __: [15]
2121
2145
  })
2122
- ])) : $("", !0),
2146
+ ])) : q("", !0),
2123
2147
  z(ge, null, {
2124
2148
  default: F(() => [
2125
2149
  x("div", oo, [
2126
2150
  z(Nt, null, {
2127
2151
  default: F(() => [
2128
2152
  (M(), S(ce, null, Me(rt, (p) => x("div", {
2129
- onClick: (G) => p.show.value && C.value === "default" && (p.action ? p.action() : v(D).commandManager.start(p.command, [...v(j).selectLines])),
2153
+ onClick: (G) => p.show.value && C.value === "default" && (p.action ? p.action() : v(_).commandManager.start(p.command, [...v(j).selectLines])),
2130
2154
  title: `${p.name}(${p.shortcut})`,
2131
2155
  class: O(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
2132
2156
  "opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !p.show.value || C.value !== "default",
@@ -2146,7 +2170,7 @@ const $n = {
2146
2170
  ]),
2147
2171
  _: 1
2148
2172
  })
2149
- ])) : $("", !0)
2173
+ ])) : q("", !0)
2150
2174
  ], 38)
2151
2175
  ], 512));
2152
2176
  }
@@ -2214,20 +2238,20 @@ let ot = class extends ye {
2214
2238
  * 打开编辑器
2215
2239
  */
2216
2240
  openEdit() {
2217
- const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, i = e.camera.position.clone(), d = o?.target?.clone(), l = new m.Vector2(), c = new m.Raycaster(), h = this.coords, w = this.pointerPosition;
2241
+ const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, i = e.camera.position.clone(), d = o?.target?.clone(), l = new m.Vector2(), c = new m.Raycaster(), h = this.coords, f = this.pointerPosition;
2218
2242
  this.container.position.z = n.originalZAverage, e.scene.add(this.container), o && (s.position.set(a.x, a.y, 15), o.target.set(a.x, a.y, 0), o.enableRotate = !1);
2219
- const f = () => {
2243
+ const g = () => {
2220
2244
  e.renderer.getSize(l);
2221
2245
  const C = t.pointer.x / l.x * 2 - 1, b = -(t.pointer.y / l.y * 2 - 1);
2222
2246
  h.set(C, b), c.setFromCamera(h, e.camera.children.length ? e.camera.children[0] : e.camera);
2223
2247
  const P = c.intersectObject(this.plane);
2224
- P.length && (w.copy(P[0].point), this.dispatchEvent({
2248
+ P.length && (f.copy(P[0].point), this.dispatchEvent({
2225
2249
  type: "pointerPositionChange",
2226
- position: w
2250
+ position: f
2227
2251
  }));
2228
2252
  };
2229
- t.addEventListener("mousemove", f), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
2230
- t.removeEventListener("mousemove", f), o && (s.position.copy(i), o.enableRotate = !0, o.target.copy(d));
2253
+ t.addEventListener("mousemove", g), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
2254
+ t.removeEventListener("mousemove", g), o && (s.position.copy(i), o.enableRotate = !0, o.target.copy(d));
2231
2255
  };
2232
2256
  }
2233
2257
  /**
@@ -2275,8 +2299,8 @@ class co extends T {
2275
2299
  let { point: l, find: c } = this.editor.renderManager.adsorption(), h = "none";
2276
2300
  if (l) {
2277
2301
  if (this.dispatchEvent({ type: "pointerMove", point: l }), this.eventInput.isKeyDown("shift")) {
2278
- const w = n.projectPoint(A.from(l), !1);
2279
- l.set(w?.x ?? l.x, w?.y ?? l.y, 0), c = !0, h = "crosshair";
2302
+ const f = n.projectPoint(A.from(l), !1);
2303
+ l.set(f?.x ?? l.x, f?.y ?? l.y, 0), c = !0, h = "crosshair";
2280
2304
  }
2281
2305
  c ? (d.position.copy(l), this.container.add(d)) : (d.removeFromParent(), h = "crosshair"), a.copy(l), i.setPoint(s, a), this.domElement.style.cursor = h;
2282
2306
  }
@@ -2306,7 +2330,7 @@ class co extends T {
2306
2330
  }
2307
2331
  }
2308
2332
  function Ge(r, e = {}) {
2309
- r.addComponent(new ot(e.viewPermission)), r.addComponent(new An()), r.addComponent(new ke()), r.addComponent(new hn()), r.addComponent(new jn()), r.addComponent(new Gn()), r.addComponent(new co()), r.addComponent(new W()), r.addComponent(new q()), r.addComponent(new ee()), r.addComponent(new U()), r.addComponent(new Q()), r.addComponent(new Y()), r.addComponent(new Z());
2333
+ r.addComponent(new ot(e.viewPermission)), r.addComponent(new An()), r.addComponent(new ke()), r.addComponent(new hn()), r.addComponent(new jn()), r.addComponent(new Gn()), r.addComponent(new co()), r.addComponent(new W()), r.addComponent(new H()), r.addComponent(new ee()), r.addComponent(new U()), r.addComponent(new Q()), r.addComponent(new Y()), r.addComponent(new Z());
2310
2334
  }
2311
2335
  const yo = Object.assign(Ge, {
2312
2336
  create(r = {}) {
@@ -44,6 +44,17 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
44
44
  * @param targettLine
45
45
  * @param vistedList
46
46
  */
47
+ correction0(targettLine: LineSegment, resultList?: any[], vistedList?: Set<LineSegment>): any[] | undefined;
48
+ /** 修正2
49
+ * 第一步:确定需要修复的线段
50
+ * 第二步:查找与该线段相交的其他线段
51
+ * 第三步:找出两端点相交的线段,其他为区间相交
52
+ * 第四步:找出两端点相交的线段数量,大于2, 该点不能修
53
+ * 第五步:修正
54
+ * 第六步:修正同向线段
55
+ * @param targettLine
56
+ * @param vistedList
57
+ */
47
58
  correction(targettLine: LineSegment, resultList?: any[], vistedList?: Set<LineSegment>): any[] | undefined;
48
59
  /** 开始
49
60
  * @param next