build-dxf 0.0.11 → 0.0.12

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/README.md CHANGED
@@ -7,10 +7,7 @@ npm i build-dxf
7
7
 
8
8
  # node 使用示例
9
9
  ```typescript
10
-
11
- import { DxfSystem } from "build-dxf"
12
- import { ModelDataPlugin, components } from "build-dxf/ModelDataPlugin"
13
-
10
+ import { DxfSystem, ModelDataPlugin, components } from "build-dxf"
14
11
  /**
15
12
  * json 文件格式为{ start: {x: number, y: number}, end: {x: number, y: number } , insetionArr: {index: number}[] }[]
16
13
  */
@@ -27,14 +24,35 @@ const detailsPoint = dxfSystem.findComponentByType(components.DetailsPoint)
27
24
 
28
25
  // 监听详情点数据处理完成
29
26
  detailsPoint.addEventListener("handleSuccess", () => {
30
- console.log("handleSuccess", detailsPoint.desPoints)
31
- })
32
-
33
- dxfSystem.Dxf.set(path).then(async ()=> {
34
- dxfSystem.Dxf.lineOffset()
27
+ // 下载dxf文件
35
28
  dxfSystem.Dxf.download("01.dxf")
29
+ // 下载白模,obj格式
36
30
  whiteModel.download("001.obj")
31
+
32
+ // desPoints 为射线点集合,根据需要使用
33
+ console.log("handleSuccess", detailsPoint.desPoints)
37
34
  })
38
35
 
36
+ dxfSystem.Dxf.set(path).then(()=> dxfSystem.Dxf.lineOffset())
39
37
  detailsPoint.set("./json/dp8.json")
38
+
39
+ ```
40
+
41
+
42
+ # 浏览器 使用示例
43
+ ```html
44
+ <template>
45
+ <div class="w-[100vw] h-[100vh]">
46
+ <Dxf3DView :lines="(data as any)" :details-point="dp8" />
47
+ </div>
48
+ </template>
49
+
50
+ <style scoped></style>
51
+
52
+ <script setup lang="ts">
53
+ import { Dxf3DView } from "build-dxf/RenderPlugin"
54
+ import "build-dxf/index.css"
55
+ import data from "../data/d4.json"
56
+ import dp8 from "../data/dp8.json"
57
+ </script>
40
58
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -10,12 +10,12 @@
10
10
  "exports": {
11
11
  ".": {
12
12
  "import": {
13
- "types": "./src/index.d.ts",
13
+ "types": "./src/build.d.ts",
14
14
  "default": "./src/index.js",
15
15
  "style": "./src/index.css"
16
16
  },
17
17
  "require": {
18
- "types": "./src/index.d.ts",
18
+ "types": "./src/build.d.ts",
19
19
  "default": "./src/index.js"
20
20
  }
21
21
  },
package/src/build.js CHANGED
@@ -1549,7 +1549,6 @@ class LineAnalysis extends Component {
1549
1549
  onAddFromParent(parent) {
1550
1550
  this.Dxf = parent.findComponentByType(Dxf);
1551
1551
  this.Variable = this.parent?.findComponentByType(Variable);
1552
- console.log(this.Dxf);
1553
1552
  this.Dxf.addEventListener("setDta", this.lineAnalysis.bind(this));
1554
1553
  this.Dxf.addEventListener("lineOffset", this.duplicatePointFiltering.bind(this));
1555
1554
  }