build-dxf 0.0.7 → 0.0.8

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,18 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
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
+ "dependencies": {
11
+ "clipper-lib": "^6.4.2",
12
+ "dxf-writer": "^1.18.4",
13
+ "three-bvh-csg": "^0.0.17",
14
+ "three-csg-ts": "^3.2.0"
15
+ },
10
16
  "author": "夏过初秋",
11
17
  "license": "ISC"
12
18
  }
package/src/index.d.ts CHANGED
@@ -164,6 +164,9 @@ declare class Dxf extends Component<{
164
164
  pointsGroups: Point[][][];
165
165
  wallsGroup: Point[][];
166
166
  doors: DataItem[];
167
+ lineSegments: LineSegment<{
168
+ isDoor: boolean;
169
+ }>[];
167
170
  originalZAverage: number;
168
171
  static EndType: {
169
172
  etOpenSquare: number;
@@ -177,7 +180,9 @@ declare class Dxf extends Component<{
177
180
  };
178
181
  /** 原始数据组
179
182
  */
180
- get lines(): Point[][];
183
+ get lines(): LineSegment<{
184
+ isDoor: boolean;
185
+ }>[];
181
186
  /**初始化
182
187
  * @param data 点云数据
183
188
  * @param width 墙体宽度
@@ -251,6 +256,7 @@ export declare class DxfSystem extends ComponentManager {
251
256
  Dxf: Dxf;
252
257
  Variable: Variable;
253
258
  wallWidth: number;
259
+ environment: "node" | "browser" | "unknown";
254
260
  /** 构造函数
255
261
  * @param wallWidth 输出墙壁厚度,该墙壁厚度不受缩放影响
256
262
  * @param scale 原始数据缩放比例
@@ -294,9 +300,12 @@ declare interface EventTypeMap {
294
300
  /**
295
301
  * 非轴对称线段
296
302
  */
297
- declare class LineSegment {
303
+ declare class LineSegment<T = Record<string, any>> {
298
304
  points: Point[];
305
+ userData?: T;
299
306
  get center(): Point;
307
+ get start(): Point;
308
+ get end(): Point;
300
309
  constructor(p1?: Point, p2?: Point);
301
310
  /**
302
311
  * 计算线段的长度
@@ -314,7 +323,7 @@ declare class LineSegment {
314
323
  * @returns 投影并裁剪后的线段
315
324
  */
316
325
  projectLineSegment(line: LineSegment): LineSegment;
317
- clone(): LineSegment;
326
+ clone(): LineSegment<Record<string, any>>;
318
327
  }
319
328
 
320
329
  declare interface OriginalDataItem {