build-dxf 0.0.35 → 0.0.37
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 +1 -1
- package/src/build.d.ts +2 -1
- package/src/build.js +2579 -2369
- package/src/index.css +1 -1
- package/src/index.js +7 -6
- package/src/index3.js +717 -754
- package/src/selectLocalFile.js +903 -880
- package/src/utils/DxfSystem/DxfSystem.d.ts +18 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +4 -128
- package/src/utils/DxfSystem/index.d.ts +2 -18
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +0 -2
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +2 -7
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +2 -7
- package/src/utils/DxfSystem/plugin/Editor/index.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/pages/EditorTool.vue.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/index.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +7 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +1 -1
- package/src/utils/DxfSystem/type.d.ts +106 -0
- package/src/utils/DxfSystem/utils/AxisAlignCorr.d.ts +14 -0
- package/src/utils/DxfSystem/utils/BoundExt.d.ts +16 -0
- package/src/utils/DxfSystem/utils/index.d.ts +5 -0
- package/src/utils/DxfSystem/utils/lineDataToOriginalData.d.ts +7 -0
- package/src/utils/DxfSystem/utils/lineSegmentClipping.d.ts +7 -0
- package/src/utils/DxfSystem/utils/recomputedWindow.d.ts +7 -0
- package/src/utils/Quadtree/LineSegment.d.ts +22 -0
- package/src/utils/Quadtree/Quadtree.d.ts +8 -3
- package/src/utils/DxfSystem/components/Dxf copy.d.ts +0 -276
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { Component } from '../../ComponentManager';
|
|
2
|
-
import { Point } from '../../Quadtree/Point';
|
|
3
|
-
import { Box2 } from '../../Quadtree/Box2';
|
|
4
|
-
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
5
|
-
import { Quadtree, QuadtreeNode } from '../../Quadtree/Quadtree';
|
|
6
|
-
import * as THREE from "three";
|
|
7
|
-
type Unit = "Unitless" | "Inches" | "Feet" | "Miles" | "Millimeters" | "Centimeters" | "Meters" | "Kilometers" | "Microinches" | "Mils" | "Yards" | "Angstroms" | "Nanometers" | "Microns" | "Decimeters" | "Decameters" | "Hectometers" | "Gigameters" | "Astronomical units" | "Light years" | "Parsecs";
|
|
8
|
-
export interface OriginalDataItem {
|
|
9
|
-
start: {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
z?: number;
|
|
13
|
-
};
|
|
14
|
-
end: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
z?: number;
|
|
18
|
-
};
|
|
19
|
-
insetionArr: {
|
|
20
|
-
index: number;
|
|
21
|
-
p: {
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
z?: number;
|
|
25
|
-
};
|
|
26
|
-
}[];
|
|
27
|
-
length: number;
|
|
28
|
-
isDoor?: boolean;
|
|
29
|
-
doorDirectConnection?: boolean;
|
|
30
|
-
drawDoorData?: {
|
|
31
|
-
start: {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
z?: number;
|
|
35
|
-
};
|
|
36
|
-
n: {
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
z?: number;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
wallWidth?: number;
|
|
43
|
-
isWindow?: boolean;
|
|
44
|
-
isVerticalReferenceLine?: boolean;
|
|
45
|
-
drawWindow?: {
|
|
46
|
-
p: {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
z?: number;
|
|
50
|
-
};
|
|
51
|
-
width: number;
|
|
52
|
-
full: boolean;
|
|
53
|
-
}[];
|
|
54
|
-
}
|
|
55
|
-
export type LineUserData = {
|
|
56
|
-
doorDirectConnection?: boolean;
|
|
57
|
-
isDoor?: boolean;
|
|
58
|
-
isWindow?: boolean;
|
|
59
|
-
isVerticalReferenceLine?: boolean;
|
|
60
|
-
wallWidth?: number;
|
|
61
|
-
drawWindow?: {
|
|
62
|
-
p: THREE.Vector3;
|
|
63
|
-
width: number;
|
|
64
|
-
full: boolean;
|
|
65
|
-
}[];
|
|
66
|
-
drawDoorData?: any;
|
|
67
|
-
quadtreeNode?: QuadtreeNode;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* [开始点, 结束点, 相交点, 是否是门, 索引]
|
|
71
|
-
*/
|
|
72
|
-
export type DataItem = [Point, Point, number[], boolean, number];
|
|
73
|
-
export type DrawData = {
|
|
74
|
-
unit: Unit;
|
|
75
|
-
line: [number, number, number, number, string][];
|
|
76
|
-
arc: [number, number, number, number, number, string][];
|
|
77
|
-
dimensionLine: number[][];
|
|
78
|
-
center: {
|
|
79
|
-
x: number;
|
|
80
|
-
y: number;
|
|
81
|
-
};
|
|
82
|
-
width: number;
|
|
83
|
-
height: number;
|
|
84
|
-
scale: number;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
*/
|
|
89
|
-
export interface PointGroup {
|
|
90
|
-
points: Point[];
|
|
91
|
-
indices: number[];
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* 将点云结构转换为DXF格式
|
|
95
|
-
*/
|
|
96
|
-
export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
97
|
-
setDta: {
|
|
98
|
-
originalData: OriginalDataItem[];
|
|
99
|
-
data: DataItem[];
|
|
100
|
-
};
|
|
101
|
-
lineOffset: {
|
|
102
|
-
wallsGroup: Point[][];
|
|
103
|
-
};
|
|
104
|
-
createGroup: {
|
|
105
|
-
groups: Point[][][];
|
|
106
|
-
};
|
|
107
|
-
} & TEventMap> {
|
|
108
|
-
static name: string;
|
|
109
|
-
shortLine: number;
|
|
110
|
-
width: number;
|
|
111
|
-
scale: number;
|
|
112
|
-
originalData: OriginalDataItem[];
|
|
113
|
-
data: DataItem[];
|
|
114
|
-
originalBox: Box2;
|
|
115
|
-
box: Box2;
|
|
116
|
-
pointsGroups: Point[][][];
|
|
117
|
-
wallsGroup: Point[][];
|
|
118
|
-
doors: DataItem[];
|
|
119
|
-
doorLineSegment: LineSegment[];
|
|
120
|
-
lineSegments: LineSegment<LineUserData>[];
|
|
121
|
-
originalZAverage: number;
|
|
122
|
-
static EndType: {
|
|
123
|
-
etOpenSquare: number;
|
|
124
|
-
etOpenRound: number;
|
|
125
|
-
etOpenButt: number;
|
|
126
|
-
};
|
|
127
|
-
static JoinType: {
|
|
128
|
-
jtSquare: number;
|
|
129
|
-
jtRound: number;
|
|
130
|
-
jtMiter: number;
|
|
131
|
-
};
|
|
132
|
-
/** 原始数据组
|
|
133
|
-
*/
|
|
134
|
-
get lines(): LineSegment<LineUserData>[];
|
|
135
|
-
/**初始化
|
|
136
|
-
* @param data 点云数据
|
|
137
|
-
* @param width 墙体宽度
|
|
138
|
-
* @param scale 缩放比例
|
|
139
|
-
*/
|
|
140
|
-
constructor(width?: number, scale?: number);
|
|
141
|
-
/**
|
|
142
|
-
* 预处理数据
|
|
143
|
-
* @param data
|
|
144
|
-
*/
|
|
145
|
-
preprocessing(data: OriginalDataItem[], axisAlignmentCorrection?: boolean): {
|
|
146
|
-
lineSegments: LineSegment<LineUserData>[];
|
|
147
|
-
data: OriginalDataItem[];
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* 设置
|
|
151
|
-
* @param data
|
|
152
|
-
* @param width
|
|
153
|
-
* @param scale
|
|
154
|
-
*/
|
|
155
|
-
set(data: OriginalDataItem[] | string, width?: number, scale?: number, axisAlignmentCorrection?: boolean): Promise<any>;
|
|
156
|
-
/** 创建分组
|
|
157
|
-
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
158
|
-
* @returns
|
|
159
|
-
*/
|
|
160
|
-
private createGroups;
|
|
161
|
-
/** 计算当前墙体数据的边界框
|
|
162
|
-
* @description 根据分组数据pointsGroups,计算包围盒, pointsGroups数据为缩放后数据。
|
|
163
|
-
* @description 可通过box属性查看计算结果。
|
|
164
|
-
* @returns
|
|
165
|
-
*/
|
|
166
|
-
computedSize(): Box2;
|
|
167
|
-
/** 线路拓扑
|
|
168
|
-
* @description 处理线路拓扑,使线路有序链接,形成长路径
|
|
169
|
-
* @param lines
|
|
170
|
-
*/
|
|
171
|
-
lineTopology(lines: Point[][]): Point<Record<string, any>>[][];
|
|
172
|
-
/** 合并方向相同的线段
|
|
173
|
-
* @param lines
|
|
174
|
-
* @param errAngle
|
|
175
|
-
*/
|
|
176
|
-
private mergeSameDirectionLine;
|
|
177
|
-
/** etOpenRound 去除毛刺
|
|
178
|
-
* @description 检查连续的短线段数量,去除合并后产生的毛刺
|
|
179
|
-
*/
|
|
180
|
-
private squareRemoveBurr;
|
|
181
|
-
/**
|
|
182
|
-
* 线段矫直, 线段中心突刺
|
|
183
|
-
* @description 突变长度小于墙体宽度,该线段可能为突起线段,
|
|
184
|
-
* @description 判断后续第2线段与上一条线段是否方向相同,相同就为突刺
|
|
185
|
-
*/
|
|
186
|
-
lineSegmentStraightening(path: Point[]): Point<Record<string, any>>[];
|
|
187
|
-
/**
|
|
188
|
-
* 移除短线段
|
|
189
|
-
* @todo 根据线段两端线段长度,选取参照物_|▔▔
|
|
190
|
-
* @param path
|
|
191
|
-
*/
|
|
192
|
-
removeShortLine(path: Point[], shortLine?: number): Point<Record<string, any>>[];
|
|
193
|
-
/** 线偏移
|
|
194
|
-
* @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
|
|
195
|
-
*/
|
|
196
|
-
lineOffset(endType?: number, joinType?: number, scale?: number): Point<Record<string, any>>[][];
|
|
197
|
-
/**
|
|
198
|
-
* 将点云结构转换为Float32Array
|
|
199
|
-
*/
|
|
200
|
-
to3DArray(scale: number, z?: number): Float32Array<ArrayBuffer>;
|
|
201
|
-
/** 获取角度范围
|
|
202
|
-
* @param center
|
|
203
|
-
* @param p1
|
|
204
|
-
* @param p2
|
|
205
|
-
* @returns
|
|
206
|
-
*/
|
|
207
|
-
private getArcAngleRange;
|
|
208
|
-
/**
|
|
209
|
-
* 线段数据转为原始json数据
|
|
210
|
-
*/
|
|
211
|
-
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
212
|
-
/**
|
|
213
|
-
* 转为绘制数据
|
|
214
|
-
*/
|
|
215
|
-
toDrawDataJson(unit?: Unit): DrawData;
|
|
216
|
-
/**
|
|
217
|
-
*
|
|
218
|
-
* @param type
|
|
219
|
-
*/
|
|
220
|
-
toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
|
|
221
|
-
/**
|
|
222
|
-
* 将点json结构转换为Dxf string
|
|
223
|
-
*/
|
|
224
|
-
toDxfString(unit?: Unit): string;
|
|
225
|
-
/**
|
|
226
|
-
* 将点云结构转换为DXF格式
|
|
227
|
-
* @returns
|
|
228
|
-
*/
|
|
229
|
-
toDxfBlob(unit?: Unit): Blob;
|
|
230
|
-
/**
|
|
231
|
-
* 下载原始json
|
|
232
|
-
* @param filename
|
|
233
|
-
*/
|
|
234
|
-
downloadOriginalData(filename: string): Promise<void>;
|
|
235
|
-
/**
|
|
236
|
-
* 下载
|
|
237
|
-
* @param filename
|
|
238
|
-
*/
|
|
239
|
-
download(filename: string, unit?: Unit): Promise<void>;
|
|
240
|
-
/**
|
|
241
|
-
* 下载
|
|
242
|
-
* @param filename
|
|
243
|
-
*/
|
|
244
|
-
downloadImage(filename: string, unit?: Unit, type?: string): Promise<boolean>;
|
|
245
|
-
/**
|
|
246
|
-
* 计算原始数据的边界框
|
|
247
|
-
* @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
|
|
248
|
-
* @returns
|
|
249
|
-
*/
|
|
250
|
-
private computedOriginalSize;
|
|
251
|
-
/**
|
|
252
|
-
* 创建数据
|
|
253
|
-
* @param pointsGroups
|
|
254
|
-
* @returns
|
|
255
|
-
*/
|
|
256
|
-
static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
|
|
257
|
-
/**
|
|
258
|
-
* 轴对齐垂直修正
|
|
259
|
-
* @param lines 待调整线段组
|
|
260
|
-
* @param targettLine 轴线段
|
|
261
|
-
* @returns
|
|
262
|
-
*/
|
|
263
|
-
static axisAlignmentCorrection(lines: LineSegment[], targettLine: LineSegment): LineSegment<LineUserData>[];
|
|
264
|
-
/**
|
|
265
|
-
* @param lines
|
|
266
|
-
* @param trajectoryPositions
|
|
267
|
-
* @returns
|
|
268
|
-
*/
|
|
269
|
-
static excessLineSegments(lines: LineSegment[], trajectoryPositions: Point[]): LineSegment<Record<string, any>>[];
|
|
270
|
-
/** 边线外扩
|
|
271
|
-
* @param lines
|
|
272
|
-
* @param trajectory
|
|
273
|
-
*/
|
|
274
|
-
static boundaryExtension(lines: LineSegment<LineUserData>[], trajectory: Point[]): LineSegment<LineUserData>[];
|
|
275
|
-
}
|
|
276
|
-
export {};
|