build-dxf 0.1.17 → 0.1.19

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.17",
3
+ "version": "0.1.19",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/src/build.js CHANGED
@@ -1491,7 +1491,7 @@ class LineSegment {
1491
1491
  const p3 = line.start;
1492
1492
  const p4 = line.end;
1493
1493
  const denom = (p1.x - p2.x) * (p3.y - p4.y) - (p1.y - p2.y) * (p3.x - p4.x);
1494
- if (Math.abs(denom) < 1e-9) {
1494
+ if (Math.abs(denom) < 1e-10) {
1495
1495
  return null;
1496
1496
  }
1497
1497
  const t = ((p1.x - p3.x) * (p3.y - p4.y) - (p1.y - p3.y) * (p3.x - p4.x)) / denom;
@@ -2107,6 +2107,34 @@ class LineSegment {
2107
2107
  return true;
2108
2108
  });
2109
2109
  }
2110
+ static createModifyManager() {
2111
+ const modifyMap = new MapEnhance();
2112
+ function setPoint(line, point2, value) {
2113
+ if (!modifyMap.has(line)) modifyMap.set(line, new ArrayMap());
2114
+ const arrayMap = modifyMap.get(line);
2115
+ arrayMap.append(point2, value);
2116
+ }
2117
+ function modify2() {
2118
+ modifyMap.forEach((arrayMap, line) => {
2119
+ arrayMap.forEach((list, point2) => {
2120
+ const otherPoint = line.getAnotherPoint(point2);
2121
+ list.push(point2);
2122
+ list.sort((p1, p2) => p2.distance(otherPoint, true) - p1.distance(otherPoint, true));
2123
+ if (list[0] === point2) point2.copy(list[1]);
2124
+ else point2.copy(list[0]);
2125
+ });
2126
+ });
2127
+ modifyMap.clear();
2128
+ }
2129
+ return {
2130
+ get setPoint() {
2131
+ return setPoint;
2132
+ },
2133
+ get modify() {
2134
+ return modify2;
2135
+ }
2136
+ };
2137
+ }
2110
2138
  }
2111
2139
  class Point {
2112
2140
  x;
@@ -5618,7 +5646,7 @@ class BoundExt {
5618
5646
  exteriorLines.forEach((line) => correction(line, wallWidth, appendLines, grid, quadtree));
5619
5647
  lines.push(...appendLines.filter((line) => line.length() > 1e-9));
5620
5648
  recomputedWindow(...lines);
5621
- lines = lines.filter((line) => line.length() > 1e-3);
5649
+ lines = lines.filter((line) => line.length() > 0.01);
5622
5650
  findCallBack && findCallBack(exteriorLines, trajectoryPoints);
5623
5651
  return {
5624
5652
  lines,
@@ -6063,34 +6091,36 @@ class Scenario {
6063
6091
  return false;
6064
6092
  });
6065
6093
  const Mesh = this.drawTheModel(E, 0, Number(i), wallHeight);
6066
- Mesh.material.envMap = texture;
6067
- Mesh.material.needsUpdate = true;
6068
- const doubleLinesWindow = doubleWinDrawLine(a[i]);
6069
- if (doubleLinesWindow) {
6070
- let houMesh = null;
6071
- for (const x in doubleLinesWindow) {
6072
- if (doubleLinesWindow.length === 1) {
6073
- const edges = new THREE.EdgesGeometry(this.windowTreatment(doubleLinesWindow[x], Mesh, wallHeight).geometry);
6074
- new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6075
- this.installWindows(doubleLinesWindow[x], x);
6076
- this.group.add(this.windowTreatment(doubleLinesWindow[x], Mesh, wallHeight));
6077
- } else if (houMesh) {
6078
- if (Number(x) === doubleLinesWindow.length - 1) {
6079
- const edges = new THREE.EdgesGeometry(this.windowTreatment(doubleLinesWindow[x], houMesh, wallHeight).geometry);
6094
+ if (Mesh) {
6095
+ Mesh.material.envMap = texture;
6096
+ Mesh.material.needsUpdate = true;
6097
+ const doubleLinesWindow = doubleWinDrawLine(a[i]);
6098
+ if (doubleLinesWindow && doubleLinesWindow.length != 0) {
6099
+ let houMesh = null;
6100
+ for (const x in doubleLinesWindow) {
6101
+ if (doubleLinesWindow.length === 1) {
6102
+ const edges = new THREE.EdgesGeometry(this.windowTreatment(doubleLinesWindow[x], Mesh, wallHeight).geometry);
6080
6103
  new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6081
6104
  this.installWindows(doubleLinesWindow[x], x);
6082
- this.group.add(this.windowTreatment(doubleLinesWindow[x], houMesh, wallHeight));
6105
+ this.group.add(this.windowTreatment(doubleLinesWindow[x], Mesh, wallHeight));
6106
+ } else if (houMesh) {
6107
+ if (Number(x) === doubleLinesWindow.length - 1) {
6108
+ const edges = new THREE.EdgesGeometry(this.windowTreatment(doubleLinesWindow[x], houMesh, wallHeight).geometry);
6109
+ new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6110
+ this.installWindows(doubleLinesWindow[x], x);
6111
+ this.group.add(this.windowTreatment(doubleLinesWindow[x], houMesh, wallHeight));
6112
+ } else {
6113
+ this.installWindows(doubleLinesWindow[x], x);
6114
+ houMesh = this.windowTreatment(doubleLinesWindow[x], houMesh, wallHeight);
6115
+ }
6083
6116
  } else {
6084
6117
  this.installWindows(doubleLinesWindow[x], x);
6085
- houMesh = this.windowTreatment(doubleLinesWindow[x], houMesh, wallHeight);
6118
+ houMesh = this.windowTreatment(doubleLinesWindow[x], Mesh, wallHeight);
6086
6119
  }
6087
- } else {
6088
- this.installWindows(doubleLinesWindow[x], x);
6089
- houMesh = this.windowTreatment(doubleLinesWindow[x], Mesh, wallHeight);
6090
6120
  }
6121
+ } else {
6122
+ this.group.add(Mesh);
6091
6123
  }
6092
- } else {
6093
- this.group.add(Mesh);
6094
6124
  }
6095
6125
  }
6096
6126
  }
@@ -6104,28 +6134,33 @@ class Scenario {
6104
6134
  // 可以不是矩形
6105
6135
  new THREE.Vector3(data[3].x, data[3].y, this.height ? this.height : 0)
6106
6136
  ];
6107
- const geometry = this.createParallelepipedFromBase(basePoints, wallHeight);
6108
- const material = new THREE.MeshStandardMaterial({
6109
- color: this.color,
6110
- side: THREE.DoubleSide
6111
- // roughness: this.numdu,
6112
- // metalness: 0.0,
6113
- // envMapRotation: new THREE.Euler(0, 0, 0),
6114
- // polygonOffset: true,
6115
- // polygonOffsetFactor: 10,
6116
- // polygonOffsetUnits: 10,
6117
- });
6118
- const cube = new THREE.Mesh(geometry, material);
6119
- const edges = new THREE.EdgesGeometry(geometry);
6120
- new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6121
- if (num === 0) {
6122
- cube.name = `双线墙_${index2}`;
6123
- cube.userData.category = "doubleWall";
6137
+ const spacing = basePoints[0].distanceTo(basePoints[3]);
6138
+ if (spacing < 5e-3) {
6139
+ return null;
6124
6140
  } else {
6125
- cube.name = `单线墙_${index2}`;
6126
- cube.userData.category = "wall";
6141
+ const geometry = this.createParallelepipedFromBase(basePoints, wallHeight);
6142
+ const material = new THREE.MeshStandardMaterial({
6143
+ color: this.color,
6144
+ side: THREE.DoubleSide
6145
+ // roughness: this.numdu,
6146
+ // metalness: 0.0,
6147
+ // envMapRotation: new THREE.Euler(0, 0, 0),
6148
+ // polygonOffset: true,
6149
+ // polygonOffsetFactor: 10,
6150
+ // polygonOffsetUnits: 10,
6151
+ });
6152
+ const cube = new THREE.Mesh(geometry, material);
6153
+ const edges = new THREE.EdgesGeometry(geometry);
6154
+ new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6155
+ if (num === 0) {
6156
+ cube.name = `双线墙_${index2}`;
6157
+ cube.userData.category = "doubleWall";
6158
+ } else {
6159
+ cube.name = `单线墙_${index2}`;
6160
+ cube.userData.category = "wall";
6161
+ }
6162
+ return cube;
6127
6163
  }
6128
- return cube;
6129
6164
  }
6130
6165
  // 执行偏移
6131
6166
  executionOffset(data, index2, wallHeight) {
@@ -6622,39 +6657,41 @@ class Scenario {
6622
6657
  }
6623
6658
  const wallHeight = listS[x].wallHeight;
6624
6659
  let Mesh = this.executionOffset(a, Number(x) / 2, wallHeight);
6625
- if (winDraw && winDraw.length > 0) {
6626
- let houMesh = null;
6627
- for (const x2 in winDraw) {
6628
- if (winDraw.length === 1) {
6629
- const edges = new THREE.EdgesGeometry(this.windowTreatment(winDraw[x2], Mesh, wallHeight).geometry);
6630
- new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6631
- this.installWindows(winDraw[x2], x2);
6632
- let mesh = this.windowTreatment(winDraw[x2], Mesh, wallHeight);
6633
- mesh.name = `单线墙_${Number(x2) / 2}`;
6634
- mesh.userData.category = "wall";
6635
- this.group.add(mesh);
6636
- } else if (houMesh) {
6637
- if (Number(x2) === winDraw.length - 1) {
6638
- const edges = new THREE.EdgesGeometry(this.windowTreatment(winDraw[x2], houMesh, wallHeight).geometry);
6639
- this.installWindows(winDraw[x2], x2);
6660
+ if (Mesh) {
6661
+ if (winDraw && winDraw.length > 0) {
6662
+ let houMesh = null;
6663
+ for (const x2 in winDraw) {
6664
+ if (winDraw.length === 1) {
6665
+ const edges = new THREE.EdgesGeometry(this.windowTreatment(winDraw[x2], Mesh, wallHeight).geometry);
6640
6666
  new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6641
- let mesh = this.windowTreatment(winDraw[x2], houMesh, wallHeight);
6667
+ this.installWindows(winDraw[x2], x2);
6668
+ let mesh = this.windowTreatment(winDraw[x2], Mesh, wallHeight);
6642
6669
  mesh.name = `单线墙_${Number(x2) / 2}`;
6643
6670
  mesh.userData.category = "wall";
6644
6671
  this.group.add(mesh);
6672
+ } else if (houMesh) {
6673
+ if (Number(x2) === winDraw.length - 1) {
6674
+ const edges = new THREE.EdgesGeometry(this.windowTreatment(winDraw[x2], houMesh, wallHeight).geometry);
6675
+ this.installWindows(winDraw[x2], x2);
6676
+ new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0 }));
6677
+ let mesh = this.windowTreatment(winDraw[x2], houMesh, wallHeight);
6678
+ mesh.name = `单线墙_${Number(x2) / 2}`;
6679
+ mesh.userData.category = "wall";
6680
+ this.group.add(mesh);
6681
+ } else {
6682
+ this.installWindows(winDraw[x2], x2);
6683
+ houMesh = this.windowTreatment(winDraw[x2], houMesh, wallHeight);
6684
+ }
6645
6685
  } else {
6646
6686
  this.installWindows(winDraw[x2], x2);
6647
- houMesh = this.windowTreatment(winDraw[x2], houMesh, wallHeight);
6687
+ houMesh = this.windowTreatment(winDraw[x2], Mesh, wallHeight);
6648
6688
  }
6649
- } else {
6650
- this.installWindows(winDraw[x2], x2);
6651
- houMesh = this.windowTreatment(winDraw[x2], Mesh, wallHeight);
6652
6689
  }
6690
+ } else {
6691
+ Mesh.name = `单线墙_${Number(x) / 2}`;
6692
+ Mesh.userData.category = "wall";
6693
+ this.group.add(Mesh);
6653
6694
  }
6654
- } else {
6655
- Mesh.name = `单线墙_${Number(x) / 2}`;
6656
- Mesh.userData.category = "wall";
6657
- this.group.add(Mesh);
6658
6695
  }
6659
6696
  }
6660
6697
  }
@@ -13807,6 +13844,9 @@ class SceneAutoGenerat {
13807
13844
  await this.buildPlane(this.lines);
13808
13845
  await this.buildWall();
13809
13846
  globalScenario.scene.add(this.scene);
13847
+ globalScenario.scene.traverse((child) => {
13848
+ child.updateWorldMatrix(false, false);
13849
+ });
13810
13850
  }
13811
13851
  buildPlane(lines) {
13812
13852
  lines = lineSegmentClipping(lines, 0);
@@ -13886,7 +13926,8 @@ class SceneAutoGenerat {
13886
13926
  await Promise.all(this.itemList.map(async (item) => await this.getModel(item)));
13887
13927
  }
13888
13928
  static itemParse(item) {
13889
- const contour = Point.fromByList(item.contour), rectangle = new Polygon(Qa(contour.map((p) => [p.x, p.y])).map((p) => Point.from(p)));
13929
+ if (!Array.isArray(item.contour) || !item.contour.length) return null;
13930
+ const contour = Point.fromByList(item.contour ?? []), rectangle = new Polygon(Qa(contour.map((p) => [p.x, p.y])).map((p) => Point.from(p)));
13890
13931
  rectangle.pop();
13891
13932
  const z = item.box.min.z, height = Math.abs(item.box.max.z - z), max = rectangle.getMaxLengthInfo(), min = rectangle.getMinLengthInfo(), direction = max.start.y < max.end.y ? max.start.direction(max.end) : max.end.direction(max.start), shape = new THREE.Shape();
13892
13933
  rectangle.forEach((p, i) => {
@@ -13940,7 +13981,7 @@ class HeightQuery {
13940
13981
  newLine.endShrink(len * 0.2);
13941
13982
  inLinePoints.push([center.x, center.y], [newLine.start.x, newLine.start.y], [newLine.end.x, newLine.end.y]);
13942
13983
  const contoursData = this.whichContourContainsPoint(inLinePoints, rootTopContourInfo);
13943
- contoursData.sort((a, b) => a.averagePz - b.averagePz);
13984
+ contoursData.sort((a, b) => b.averagePz - a.averagePz);
13944
13985
  const height = contoursData[0]?.averagePz ?? DEFAULT_WALL_HEIGHT;
13945
13986
  return height;
13946
13987
  }
@@ -13958,6 +13999,7 @@ class HeightQuery {
13958
13999
  points.filter((p) => {
13959
14000
  point.set(p[0], p[1]);
13960
14001
  new Array(...new Set(quadtree?.queryCircle(point, 0.4).map((item) => item.line.currentData.contourIndex))).forEach((index2) => {
14002
+ if (index2 === maxContourIndex) return;
13961
14003
  contoursData.push({ i: index2, averagePz: contours[index2].averagePz });
13962
14004
  });
13963
14005
  });
@@ -14198,8 +14240,8 @@ const PRE_PROCESSOR = {
14198
14240
  }
14199
14241
  lineSegments.forEach((line) => {
14200
14242
  if (!("height" in line.userData)) {
14201
- if (line.userData.rooftopPz) line.userData.height = Math.abs(line.userData.rooftopPz - (option.originalZ ?? 0));
14202
- else if (option?.publicInfo?.rootTopContourInfo) line.userData.height = HeightQuery.query(line, option.publicInfo.rootTopContourInfo);
14243
+ if (!line.userData.rooftopPz && option?.publicInfo?.rootTopContourInfo) line.userData.rooftopPz = HeightQuery.query(line, option.publicInfo.rootTopContourInfo);
14244
+ if ("rooftopPz" in line.userData) line.userData.height = Math.abs(line.userData.rooftopPz - (option.originalZ ?? 0));
14203
14245
  }
14204
14246
  });
14205
14247
  return lineSegments;
@@ -14683,7 +14725,6 @@ class WhiteModel extends Component {
14683
14725
  whiteModelGroup = new THREE.Group();
14684
14726
  // dxf数据白模边缘线
14685
14727
  whiteModelLineGroup = new THREE.Group();
14686
- material = new THREE.MeshStandardMaterial({ color: 16777215, transparent: true, opacity: 0.8, side: THREE.DoubleSide });
14687
14728
  itemList = [];
14688
14729
  promise;
14689
14730
  /** 设置物品列表
@@ -14729,13 +14770,7 @@ class WhiteModel extends Component {
14729
14770
  toOBJ() {
14730
14771
  return new Promise(async (resolve) => {
14731
14772
  await this.promise;
14732
- this.material.opacity = 1;
14733
- this.material.needsUpdate = true;
14734
- setTimeout(() => {
14735
- resolve(exporter.parse(this.whiteModelGroup));
14736
- this.material.opacity = 0.8;
14737
- this.material.transparent = true;
14738
- }, 20);
14773
+ resolve(exporter.parse(this.whiteModelGroup));
14739
14774
  });
14740
14775
  }
14741
14776
  /**
@@ -14747,19 +14782,13 @@ class WhiteModel extends Component {
14747
14782
  if (!glbExporter) glbExporter = new gltf.GLTFExporter();
14748
14783
  return new Promise(async (resolve) => {
14749
14784
  await this.promise;
14750
- this.material.opacity = 1;
14751
- this.material.needsUpdate = true;
14752
- setTimeout(async () => {
14753
- glbExporter.parse(this.whiteModelGroup.children, (gltf2) => {
14754
- resolve(gltf2);
14755
- this.material.opacity = 0.8;
14756
- this.material.transparent = true;
14757
- }, () => {
14758
- resolve(void 0);
14759
- }, {
14760
- binary
14761
- });
14762
- }, 20);
14785
+ glbExporter.parse(this.whiteModelGroup.children, (gltf2) => {
14786
+ resolve(gltf2);
14787
+ }, () => {
14788
+ resolve(void 0);
14789
+ }, {
14790
+ binary
14791
+ });
14763
14792
  });
14764
14793
  }
14765
14794
  /**
@@ -15391,6 +15420,7 @@ export {
15391
15420
  Box2 as B,
15392
15421
  Component as C,
15393
15422
  Dxf as D,
15423
+ HeightQuery as H,
15394
15424
  LineSegment as L,
15395
15425
  PointVirtualGrid as P,
15396
15426
  Quadtree as Q,
package/src/index.css CHANGED
@@ -680,7 +680,7 @@
680
680
  inherits: false
681
681
  }
682
682
 
683
- [data-v-74cfb8d6] {
683
+ [data-v-adaee1e3] {
684
684
  font-family: 宋体;
685
685
  }
686
686
 
package/src/index3.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Component, P as PointVirtualGrid, Q as Quadtree, B as Box2, a as Point, c as cloneUserData, L as LineSegment, b as Lines, u as uuid, r as recomputedWindow, A as AxisAlignCorr, W as WhiteModel, T as ThreeVJia, V as Variable, S as SelectLocalFile, d as CommandManager } from "./build.js";
1
+ import { C as Component, P as PointVirtualGrid, Q as Quadtree, B as Box2, a as Point, c as cloneUserData, L as LineSegment, b as Lines, H as HeightQuery, u as uuid, r as recomputedWindow, A as AxisAlignCorr, W as WhiteModel, T as ThreeVJia, V as Variable, S as SelectLocalFile, d as CommandManager } from "./build.js";
2
2
  import * as THREE from "three";
3
3
  import "clipper-lib";
4
4
  import "dxf-writer";
@@ -9607,7 +9607,7 @@ class RenderManager extends Component {
9607
9607
  this.updatedMode = "self";
9608
9608
  const dxf2 = this.dxf;
9609
9609
  const json = this.toJson();
9610
- dxf2.set(json);
9610
+ dxf2.set(json, dxf2.options);
9611
9611
  });
9612
9612
  }
9613
9613
  get renderer() {
@@ -9971,6 +9971,11 @@ class Default extends CommandFlowComponent {
9971
9971
  } else {
9972
9972
  const rectangle = wiLine.expandToRectangle(0.025, "bothSides");
9973
9973
  object3D.geometry = editor.renderManager.createGeometry({ position: rectangle.createGeometry() }, 6);
9974
+ const center = wiLine.center;
9975
+ let info = "";
9976
+ textObj3D.element.innerText = info + parseInt(wiLine.length() * 1e3 + "") + " mm";
9977
+ textObj3D.position.set(center.x, center.y, 0);
9978
+ textObj3D.visible = true;
9974
9979
  }
9975
9980
  this.container.add(object3D);
9976
9981
  } else {
@@ -10269,6 +10274,12 @@ class DrawLine extends CommandFlowComponent {
10269
10274
  for (let i = 0; i < points.length; i += 2) {
10270
10275
  lines.push(new LineSegment(Point.from(points[i]), Point.from(points[i + 1])));
10271
10276
  }
10277
+ lines.forEach((line2) => {
10278
+ if (this.renderManager.dxf.options.publicInfo?.rootTopContourInfo) {
10279
+ const rooftopPz = HeightQuery.query(line2, this.renderManager.dxf.options.publicInfo?.rootTopContourInfo);
10280
+ line2.userData.rooftopPz = rooftopPz;
10281
+ }
10282
+ });
10272
10283
  next(lines);
10273
10284
  }
10274
10285
  /** 执行完成
@@ -11761,7 +11772,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11761
11772
  onMousedown: dragMoveHelper,
11762
11773
  class: normalizeClass([{ "border-b-[#eee] border-b-1": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
11763
11774
  }, [
11764
- _cache[12] || (_cache[12] = createStaticVNode('<div class="flex flex-row" data-v-74cfb8d6><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-74cfb8d6><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-74cfb8d6><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-74cfb8d6></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-74cfb8d6>绘制工具</h5></div>', 1)),
11775
+ _cache[12] || (_cache[12] = createStaticVNode('<div class="flex flex-row" data-v-adaee1e3><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-adaee1e3><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-adaee1e3><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-adaee1e3></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-adaee1e3>绘制工具</h5></div>', 1)),
11765
11776
  createElementVNode("div", {
11766
11777
  onMousedown: _cache[0] || (_cache[0] = (e) => e.stopPropagation()),
11767
11778
  onClick: _cache[1] || (_cache[1] = ($event) => toolBarExpand.value = !toolBarExpand.value),
@@ -11875,7 +11886,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11875
11886
  style: { "padding": "5px", "font-size": "10px" },
11876
11887
  size: "small",
11877
11888
  type: "primary",
11878
- onClick: _cache[4] || (_cache[4] = ($event) => unref(dxfSystem).Dxf.downloadOriginalData("json.json"))
11889
+ onClick: _cache[4] || (_cache[4] = ($event) => unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))
11879
11890
  }, {
11880
11891
  default: withCtx(() => _cache[17] || (_cache[17] = [
11881
11892
  createTextVNode(" 下载Json ", -1)
@@ -12000,7 +12011,7 @@ const _export_sfc = (sfc, props) => {
12000
12011
  }
12001
12012
  return target;
12002
12013
  };
12003
- const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-74cfb8d6"]]);
12014
+ const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-adaee1e3"]]);
12004
12015
  class Editor extends Component {
12005
12016
  static name = "Editor";
12006
12017
  container = new THREE.Group();
@@ -0,0 +1 @@
1
+ export {};
@@ -80,9 +80,9 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
80
80
  */
81
81
  lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
82
82
  /**
83
- * 下载原始json
84
- * @param filename
85
- */
83
+ * 下载原始json
84
+ * @param filename
85
+ */
86
86
  downloadOriginalData(filename: string): Promise<void>;
87
87
  /** 获取绘制数据
88
88
  */
@@ -12,7 +12,6 @@ export declare class WhiteModel extends Component<{
12
12
  Variable: Variable | null;
13
13
  whiteModelGroup: THREE.Group<THREE.Object3DEventMap>;
14
14
  whiteModelLineGroup: THREE.Group<THREE.Object3DEventMap>;
15
- material: THREE.MeshStandardMaterial;
16
15
  itemList: any[];
17
16
  promise?: Promise<THREE.Group>;
18
17
  /** 设置物品列表
@@ -35,5 +35,5 @@ export declare class SceneAutoGenerat {
35
35
  end: THREE.Vector3;
36
36
  length: number;
37
37
  }[];
38
- };
38
+ } | null;
39
39
  }
@@ -1,30 +1,48 @@
1
- type ValueType = "number" | "boolean" | "vec2" | "vec3" | "vec4" | "mat3x3" | "mat4x4";
1
+ type ValueType = "f32" | "vec2" | "vec3" | "vec4" | "mat3x3" | "mat4x4";
2
2
  type OptionType = {
3
3
  workgroup_size?: [number, number, number];
4
- structName?: string;
5
- dataName?: string;
4
+ workgroupCount: [number, number?, number?];
6
5
  globalInvocationIdName?: string;
6
+ workgroupIndexName?: string;
7
+ synchronize?: string[];
8
+ };
9
+ type BufferType = {
10
+ buffer: number[];
11
+ stride: number;
12
+ layout: {
13
+ name: string;
14
+ type: ValueType;
15
+ offset: number;
16
+ size: number;
17
+ }[];
18
+ count: number;
7
19
  };
8
20
  export declare class GpuComputed {
9
21
  constructor();
10
22
  getDevice(): Promise<{
11
23
  adapter: GPUAdapter | null;
12
24
  device: GPUDevice;
13
- groupLayout: GPUBindGroupLayout;
14
25
  }>;
15
- createPipleline(code: string, buffer: Float32Array<ArrayBuffer>): Promise<void>;
16
- buildBuffer(data: Record<string, any>[], keys?: string[], types?: ValueType[]): {
17
- buffer: number[];
18
- stride: number;
19
- layout: {
26
+ createPipleline(code: string, buffers: Record<string, BufferType>): Promise<{
27
+ pipeline: GPUComputePipeline;
28
+ group: GPUBindGroup;
29
+ device: GPUDevice;
30
+ bufferInfoList: {
20
31
  name: string;
21
- type: ValueType;
22
- offset: number;
23
- size: number;
32
+ buffer: GPUBuffer;
33
+ float32Array: Float32Array<ArrayBuffer>;
34
+ groupLayoutItem: GPUBindGroupLayoutEntry;
35
+ groupItem: {
36
+ binding: number;
37
+ resource: {
38
+ buffer: GPUBuffer;
39
+ };
40
+ };
24
41
  }[];
25
- count: number;
26
- };
42
+ }>;
43
+ private buildBuffer;
44
+ capitalize(str: string): string;
27
45
  private buildCode;
28
- computed(data: any[], code: string, option?: OptionType): Promise<void>;
46
+ computed(code: string, data: Record<string, any[]>, option: OptionType): Promise<number[][]>;
29
47
  }
30
48
  export {};
@@ -307,4 +307,8 @@ export declare class LineSegment<T = Record<string, any>> {
307
307
  * @param clippingLine
308
308
  */
309
309
  static clippingByLine(target: LineSegment, clippingLine: LineSegment, callBack?: (newLine: LineSegment, line: LineSegment) => void): LineSegment<Record<string, any>>[];
310
+ static createModifyManager(): {
311
+ readonly setPoint: (line: LineSegment, point: Point, value: Point) => void;
312
+ readonly modify: () => void;
313
+ };
310
314
  }
@@ -39,8 +39,8 @@ export default class Scenario {
39
39
  constructor(scene: THREE.Scene, camera: THREE.PerspectiveCamera, renderer: THREE.WebGLRenderer, controls: OrbitControls);
40
40
  drawGraphics(lines: LineSegment[], z: number, trajectoryJson: any): Promise<any>;
41
41
  splitProcessData(lines: LineSegment[], texture: THREE.DataTexture): void;
42
- drawTheModel(data: any, num: number, index: number, wallHeight: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
43
- executionOffset(data: any, index: number, wallHeight: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | undefined;
42
+ drawTheModel(data: any, num: number, index: number, wallHeight: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
43
+ executionOffset(data: any, index: number, wallHeight: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null | undefined;
44
44
  windowTreatment(dblWin: any, mesh: any, wallHeight: number): Brush;
45
45
  TheHandlingOfTheDoor1(data: LineSegment<LineUserData>): THREE.Vector3[];
46
46
  TheHandlingOfTheDoor(data: LineSegment<LineUserData>[]): void;