build-dxf 0.0.7 → 0.0.9

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,12 +1,50 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
+ "exports": {
11
+ ".": {
12
+ "import": {
13
+ "types": "./src/index.d.ts",
14
+ "default": "./src/index.js"
15
+ },
16
+ "require": {
17
+ "types": "./src/index.d.ts",
18
+ "default": "./src/index.js"
19
+ }
20
+ },
21
+ "./ModelDataPlugin": {
22
+ "import": {
23
+ "types": "./src/plugins/ModelDataPlugin/index.d.ts",
24
+ "default": "./src/plugins/ModelDataPlugin/index.js"
25
+ },
26
+ "require": {
27
+ "types": "./src/plugins/ModelDataPlugin/index.d.ts",
28
+ "default": "./src/plugins/ModelDataPlugin/index.js"
29
+ }
30
+ },
31
+ "./RenderPlugin": {
32
+ "import": {
33
+ "types": "./src/plugins/RenderPlugin/index.d.ts",
34
+ "default": "./src/plugins/RenderPlugin/index.js"
35
+ },
36
+ "require": {
37
+ "types": "./src/plugins/RenderPlugin/index.d.ts",
38
+ "default": "./src/plugins/RenderPlugin/index.js"
39
+ }
40
+ }
41
+ },
42
+ "dependencies": {
43
+ "clipper-lib": "^6.4.2",
44
+ "dxf-writer": "^1.18.4",
45
+ "three-bvh-csg": "^0.0.17",
46
+ "three-csg-ts": "^3.2.0"
47
+ },
10
48
  "author": "夏过初秋",
11
49
  "license": "ISC"
12
- }
50
+ }
package/src/index.d.ts CHANGED
@@ -133,6 +133,11 @@ declare class ComponentManager<TEventMap extends {} = {}> extends EventDispatche
133
133
  * @param type
134
134
  */
135
135
  findComponentByType<T extends typeof Component>(type: T): InstanceType<T> | null;
136
+ /**
137
+ *
138
+ * @param type
139
+ */
140
+ findComponentByName(name: string): Component<{}> | null;
136
141
  }
137
142
 
138
143
  /**
@@ -164,6 +169,9 @@ declare class Dxf extends Component<{
164
169
  pointsGroups: Point[][][];
165
170
  wallsGroup: Point[][];
166
171
  doors: DataItem[];
172
+ lineSegments: LineSegment<{
173
+ isDoor: boolean;
174
+ }>[];
167
175
  originalZAverage: number;
168
176
  static EndType: {
169
177
  etOpenSquare: number;
@@ -177,7 +185,9 @@ declare class Dxf extends Component<{
177
185
  };
178
186
  /** 原始数据组
179
187
  */
180
- get lines(): Point[][];
188
+ get lines(): LineSegment<{
189
+ isDoor: boolean;
190
+ }>[];
181
191
  /**初始化
182
192
  * @param data 点云数据
183
193
  * @param width 墙体宽度
@@ -251,6 +261,7 @@ export declare class DxfSystem extends ComponentManager {
251
261
  Dxf: Dxf;
252
262
  Variable: Variable;
253
263
  wallWidth: number;
264
+ environment: "node" | "browser" | "unknown";
254
265
  /** 构造函数
255
266
  * @param wallWidth 输出墙壁厚度,该墙壁厚度不受缩放影响
256
267
  * @param scale 原始数据缩放比例
@@ -294,9 +305,12 @@ declare interface EventTypeMap {
294
305
  /**
295
306
  * 非轴对称线段
296
307
  */
297
- declare class LineSegment {
308
+ declare class LineSegment<T = Record<string, any>> {
298
309
  points: Point[];
310
+ userData?: T;
299
311
  get center(): Point;
312
+ get start(): Point;
313
+ get end(): Point;
300
314
  constructor(p1?: Point, p2?: Point);
301
315
  /**
302
316
  * 计算线段的长度
@@ -314,7 +328,7 @@ declare class LineSegment {
314
328
  * @returns 投影并裁剪后的线段
315
329
  */
316
330
  projectLineSegment(line: LineSegment): LineSegment;
317
- clone(): LineSegment;
331
+ clone(): LineSegment<Record<string, any>>;
318
332
  }
319
333
 
320
334
  declare interface OriginalDataItem {