build-dxf 0.1.8 → 0.1.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 +1 -1
- package/src/build.d.ts +1 -0
- package/src/build.js +663 -1472
- package/src/index.css +1 -1
- package/src/index.js +10 -10
- package/src/index2.js +4 -352
- package/src/index3.js +5000 -134
- package/src/{DomEventRegister.js → index4.js} +380 -247
- package/src/utils/DxfSystem/DxfSystem.d.ts +0 -3
- package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +1 -4
- package/src/utils/DxfSystem/components/Dxf.d.ts +66 -125
- package/src/utils/DxfSystem/components/DxfOld.d.ts +183 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/WhiteModel.d.ts +0 -2
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/index.d.ts +0 -1
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/index.d.ts +0 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/index.d.ts +0 -2
- package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +0 -2
- package/src/utils/DxfSystem/utils/LineGroupType.d.ts +1 -1
- package/src/utils/modelScenario/SceneAutoGenerat.d.ts +7 -1
- package/src/components/Card.vue.d.ts +0 -9
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +0 -77
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/DetailsPoint.d.ts +0 -39
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DetailsPointRender.d.ts +0 -48
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/OriginalLineRender.d.ts +0 -16
|
@@ -2,13 +2,11 @@ import { ComponentManager } from '../ComponentManager';
|
|
|
2
2
|
import { CorrectionDxf } from './components/CorrectionDxf';
|
|
3
3
|
import { DoorsAnalysisComponent } from './components/DoorsAnalysis';
|
|
4
4
|
import { Dxf } from './components/Dxf';
|
|
5
|
-
import { LineAnalysis } from './components/LineAnalysis';
|
|
6
5
|
import { ThreeVJia } from './components/ThreeVJia';
|
|
7
6
|
import { Variable } from './components/Variable';
|
|
8
7
|
export declare class DxfSystem extends ComponentManager {
|
|
9
8
|
Dxf: Dxf;
|
|
10
9
|
Variable: Variable;
|
|
11
|
-
LineAnalysis: LineAnalysis;
|
|
12
10
|
DoorsAnalysis: DoorsAnalysisComponent;
|
|
13
11
|
CorrectionDxf: CorrectionDxf;
|
|
14
12
|
wallWidth: number;
|
|
@@ -22,7 +20,6 @@ export declare class DxfSystem extends ComponentManager {
|
|
|
22
20
|
destroy(): void;
|
|
23
21
|
}
|
|
24
22
|
declare const components: {
|
|
25
|
-
LineAnalysis: typeof LineAnalysis;
|
|
26
23
|
ThreeVJia: typeof ThreeVJia;
|
|
27
24
|
Variable: typeof Variable;
|
|
28
25
|
Dxf: typeof Dxf;
|
|
@@ -4,7 +4,6 @@ import { Quadtree } from '../../Quadtree';
|
|
|
4
4
|
import { LineSegment } from '../../LineSegment';
|
|
5
5
|
import { Point } from '../../Point';
|
|
6
6
|
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
7
|
-
import { LineAnalysis } from './LineAnalysis';
|
|
8
7
|
type ProjectionAnalysisResult = {
|
|
9
8
|
source: LineSegment;
|
|
10
9
|
sourceIndex: number;
|
|
@@ -31,9 +30,8 @@ declare class DoorsAnalysis {
|
|
|
31
30
|
doorSearchNearAngle: number;
|
|
32
31
|
doorSearchDistance: number;
|
|
33
32
|
doors: LineSegment[];
|
|
34
|
-
lineAnalysis: LineAnalysis;
|
|
35
33
|
continueFind: boolean;
|
|
36
|
-
constructor(
|
|
34
|
+
constructor(dxf: Dxf, skipFindDoor: boolean);
|
|
37
35
|
private handle;
|
|
38
36
|
/** 查找
|
|
39
37
|
* @param doorPoints
|
|
@@ -107,7 +105,6 @@ export declare class DoorsAnalysisComponent extends Component<{
|
|
|
107
105
|
doorSearchDistance: number;
|
|
108
106
|
DoorsAnalysis?: DoorsAnalysis;
|
|
109
107
|
skipFindDoor: boolean;
|
|
110
|
-
needsSaveDoor: boolean;
|
|
111
108
|
doors: LineSegment[];
|
|
112
109
|
/**
|
|
113
110
|
*
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { Component } from '../../ComponentManager';
|
|
2
|
-
import { Point } from '../../Point';
|
|
3
2
|
import { Box2 } from '../../Box2';
|
|
4
3
|
import { LineSegment } from '../../LineSegment';
|
|
5
4
|
import { Quadtree } from '../../Quadtree';
|
|
6
|
-
import { SetDataOption, DataItem,
|
|
5
|
+
import { SetDataOption, DataItem, LineUserData, OriginalDataItem, Unit } from '../type';
|
|
6
|
+
import { CAD } from '../utils/CAD';
|
|
7
|
+
type PreProcessor = (lines: LineSegment[], option: SetDataOption) => LineSegment[];
|
|
8
|
+
export declare const PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", PreProcessor>;
|
|
7
9
|
/**
|
|
8
10
|
* 将点云结构转换为DXF格式
|
|
9
11
|
*/
|
|
10
12
|
export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
11
|
-
|
|
13
|
+
dataChange: {
|
|
12
14
|
originalData: OriginalDataItem[];
|
|
13
15
|
data: DataItem[];
|
|
16
|
+
cad: CAD;
|
|
14
17
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
createGroup: {
|
|
19
|
-
groups: Point[][][];
|
|
18
|
+
cadChange: {
|
|
19
|
+
cad: CAD;
|
|
20
20
|
};
|
|
21
21
|
preprocessing: {
|
|
22
22
|
data: OriginalDataItem[];
|
|
@@ -24,160 +24,101 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
24
24
|
};
|
|
25
25
|
} & TEventMap> {
|
|
26
26
|
static name: string;
|
|
27
|
-
|
|
27
|
+
static readonly PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", PreProcessor>;
|
|
28
28
|
width: number;
|
|
29
|
-
scale: number;
|
|
30
29
|
originalData: OriginalDataItem[];
|
|
31
30
|
data: DataItem[];
|
|
32
|
-
originalBox: Box2;
|
|
33
31
|
box: Box2;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
doors: DataItem[];
|
|
32
|
+
cad: CAD | null;
|
|
33
|
+
lineSegments: LineSegment<LineUserData>[];
|
|
37
34
|
doorLineSegment: LineSegment[];
|
|
38
35
|
verticalReferenceLine?: LineSegment<LineUserData>;
|
|
39
|
-
lineSegments: LineSegment<LineUserData>[];
|
|
40
36
|
originalZAverage: number;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
etOpenButt: number;
|
|
45
|
-
};
|
|
46
|
-
static JoinType: {
|
|
47
|
-
jtSquare: number;
|
|
48
|
-
jtRound: number;
|
|
49
|
-
jtMiter: number;
|
|
50
|
-
};
|
|
37
|
+
private _preProcessorSet;
|
|
38
|
+
trajectory: Record<string, any> | null;
|
|
39
|
+
onBoundExt?: (lines: LineSegment[], trajectory: any) => void;
|
|
51
40
|
/** 原始数据组
|
|
52
41
|
*/
|
|
53
42
|
get lines(): LineSegment<LineUserData>[];
|
|
54
43
|
/**初始化
|
|
55
44
|
* @param width 墙体宽度
|
|
56
|
-
* @param scale 缩放比例
|
|
57
|
-
*/
|
|
58
|
-
constructor(width?: number, scale?: number);
|
|
59
|
-
/** 预处理数据
|
|
60
|
-
* @param data
|
|
61
45
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
/** 设置
|
|
67
|
-
* @param data 房屋结构数据,node环境可以为路径
|
|
68
|
-
* @param width 墙体宽度
|
|
69
|
-
* @param scale 缩放比例
|
|
70
|
-
* @param axisAlignmentCorrection 需要执行轴对称垂直纠正
|
|
71
|
-
* @param option
|
|
72
|
-
* @returns
|
|
73
|
-
*/
|
|
74
|
-
set(data: OriginalDataItem[] | string, width?: number, scale?: number): Promise<any>;
|
|
75
|
-
/** 创建分组
|
|
76
|
-
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
77
|
-
* @returns
|
|
78
|
-
*/
|
|
79
|
-
private createGroups;
|
|
80
|
-
/** 计算当前墙体数据的边界框
|
|
81
|
-
* @description 根据分组数据pointsGroups,计算包围盒, pointsGroups数据为缩放后数据。
|
|
82
|
-
* @description 可通过box属性查看计算结果。
|
|
46
|
+
constructor(width?: number);
|
|
47
|
+
setTrajectory(trajectory: Record<string, any> | null, onBoundExt?: (lines: LineSegment[], trajectory: any) => void): this;
|
|
48
|
+
/** 完整线段数据
|
|
83
49
|
* @returns
|
|
84
50
|
*/
|
|
85
|
-
|
|
86
|
-
/** 线路拓扑
|
|
87
|
-
* @description 处理线路拓扑,使线路有序链接,形成长路径
|
|
88
|
-
* @param lines
|
|
89
|
-
*/
|
|
90
|
-
lineTopology(lines: Point[][]): Point<Record<string, any>>[][];
|
|
91
|
-
/** 合并方向相同的线段
|
|
92
|
-
* @param lines
|
|
93
|
-
* @param errAngle
|
|
94
|
-
*/
|
|
95
|
-
private mergeSameDirectionLine;
|
|
96
|
-
/** etOpenRound 去除毛刺
|
|
97
|
-
* @description 检查连续的短线段数量,去除合并后产生的毛刺
|
|
98
|
-
*/
|
|
99
|
-
private squareRemoveBurr;
|
|
100
|
-
/**
|
|
101
|
-
* 线段矫直, 线段中心突刺
|
|
102
|
-
* @description 突变长度小于墙体宽度,该线段可能为突起线段,
|
|
103
|
-
* @description 判断后续第2线段与上一条线段是否方向相同,相同就为突刺
|
|
104
|
-
*/
|
|
105
|
-
lineSegmentStraightening(path: Point[]): Point<Record<string, any>>[];
|
|
51
|
+
getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
|
|
106
52
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @
|
|
109
|
-
* @param path
|
|
53
|
+
* 预处理数据
|
|
54
|
+
* @param data
|
|
110
55
|
*/
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @
|
|
56
|
+
private preprocessing;
|
|
57
|
+
/** 添加预处理
|
|
58
|
+
* @param handler
|
|
114
59
|
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @param
|
|
60
|
+
addPreProcessor(handler: PreProcessor): this;
|
|
61
|
+
/** 删除预处理
|
|
62
|
+
* @param handler
|
|
118
63
|
*/
|
|
119
|
-
|
|
120
|
-
/**
|
|
64
|
+
removePreProcessor(handler: PreProcessor): this;
|
|
65
|
+
/** 清空预处理
|
|
121
66
|
* @returns
|
|
122
67
|
*/
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* @param
|
|
130
|
-
* @param p1
|
|
131
|
-
* @param p2
|
|
68
|
+
clearPreProcessor(): this;
|
|
69
|
+
/** 设置
|
|
70
|
+
* @param data 房屋结构数据,node环境可以为路径
|
|
71
|
+
* @param width 墙体宽度
|
|
72
|
+
* @param scale 缩放比例
|
|
73
|
+
* @param axisAlignmentCorrection 需要执行轴对称垂直纠正
|
|
74
|
+
* @param option
|
|
132
75
|
* @returns
|
|
133
76
|
*/
|
|
134
|
-
|
|
77
|
+
set(data: OriginalDataItem[] | string, options?: SetDataOption): Promise<any>;
|
|
135
78
|
/**
|
|
136
79
|
* 线段数据转为原始json数据
|
|
137
80
|
*/
|
|
138
81
|
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
139
82
|
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
83
|
+
* 下载原始json
|
|
84
|
+
* @param filename
|
|
85
|
+
*/
|
|
86
|
+
downloadOriginalData(filename: string): Promise<void>;
|
|
87
|
+
/** 获取绘制数据
|
|
88
|
+
*/
|
|
89
|
+
toDrawData(unit?: Unit): {
|
|
90
|
+
unit: Unit;
|
|
91
|
+
lines: [number, number, number, number, string][];
|
|
92
|
+
arcs: [number, number, number, number, number, string][];
|
|
93
|
+
texts: [string, number, number, string][];
|
|
94
|
+
center: {
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
};
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
scale: number;
|
|
101
|
+
} | undefined;
|
|
102
|
+
/** 获取 dxf 图片 二进制对象
|
|
144
103
|
* @param type
|
|
145
104
|
*/
|
|
146
105
|
toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
|
|
147
|
-
/**
|
|
148
|
-
* 将点json结构转换为Dxf string
|
|
149
|
-
*/
|
|
150
|
-
toDxfString(unit?: Unit): string;
|
|
151
|
-
/**
|
|
152
|
-
* 将点云结构转换为DXF格式
|
|
153
|
-
* @returns
|
|
154
|
-
*/
|
|
155
|
-
toDxfBlob(unit?: Unit): Blob;
|
|
156
|
-
/**
|
|
157
|
-
* 下载原始json
|
|
158
|
-
* @param filename
|
|
159
|
-
*/
|
|
160
|
-
downloadOriginalData(filename: string): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* 下载
|
|
106
|
+
/** 下载 dxf 图片
|
|
163
107
|
* @param filename
|
|
164
108
|
*/
|
|
165
|
-
|
|
109
|
+
downloadDxfImage(filename: string, unit?: Unit, type?: string): Promise<boolean | undefined>;
|
|
166
110
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @param filename
|
|
111
|
+
* 将点json结构转换为Dxf 字符串
|
|
169
112
|
*/
|
|
170
|
-
|
|
113
|
+
toDxfString(unit?: Unit): string | undefined;
|
|
171
114
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
|
|
115
|
+
* 将点云结构转换为 DXF 二进制对象
|
|
174
116
|
* @returns
|
|
175
117
|
*/
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
*
|
|
179
|
-
* @param pointsGroups
|
|
180
|
-
* @returns
|
|
118
|
+
toDxfBlob(unit?: Unit): Blob | undefined;
|
|
119
|
+
/** 下载Dxf
|
|
120
|
+
* @param filename
|
|
181
121
|
*/
|
|
182
|
-
|
|
122
|
+
downloadDxf(filename: string, unit?: Unit): Promise<void | undefined>;
|
|
183
123
|
}
|
|
124
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Component } from '../../ComponentManager';
|
|
2
|
+
import { Point } from '../../Point';
|
|
3
|
+
import { Box2 } from '../../Box2';
|
|
4
|
+
import { LineSegment } from '../../LineSegment';
|
|
5
|
+
import { Quadtree } from '../../Quadtree';
|
|
6
|
+
import { SetDataOption, DataItem, DrawData, LineUserData, OriginalDataItem, Unit } from '../type';
|
|
7
|
+
/**
|
|
8
|
+
* 将点云结构转换为DXF格式
|
|
9
|
+
*/
|
|
10
|
+
export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
11
|
+
setDta: {
|
|
12
|
+
originalData: OriginalDataItem[];
|
|
13
|
+
data: DataItem[];
|
|
14
|
+
};
|
|
15
|
+
lineOffset: {
|
|
16
|
+
wallsGroup: Point[][];
|
|
17
|
+
};
|
|
18
|
+
createGroup: {
|
|
19
|
+
groups: Point[][][];
|
|
20
|
+
};
|
|
21
|
+
preprocessing: {
|
|
22
|
+
data: OriginalDataItem[];
|
|
23
|
+
setData(data: OriginalDataItem[]): void;
|
|
24
|
+
};
|
|
25
|
+
} & TEventMap> {
|
|
26
|
+
static name: string;
|
|
27
|
+
shortLine: number;
|
|
28
|
+
width: number;
|
|
29
|
+
scale: number;
|
|
30
|
+
originalData: OriginalDataItem[];
|
|
31
|
+
data: DataItem[];
|
|
32
|
+
originalBox: Box2;
|
|
33
|
+
box: Box2;
|
|
34
|
+
pointsGroups: Point[][][];
|
|
35
|
+
wallsGroup: Point[][];
|
|
36
|
+
doors: DataItem[];
|
|
37
|
+
doorLineSegment: LineSegment[];
|
|
38
|
+
verticalReferenceLine?: LineSegment<LineUserData>;
|
|
39
|
+
lineSegments: LineSegment<LineUserData>[];
|
|
40
|
+
originalZAverage: number;
|
|
41
|
+
static EndType: {
|
|
42
|
+
etOpenSquare: number;
|
|
43
|
+
etOpenRound: number;
|
|
44
|
+
etOpenButt: number;
|
|
45
|
+
};
|
|
46
|
+
static JoinType: {
|
|
47
|
+
jtSquare: number;
|
|
48
|
+
jtRound: number;
|
|
49
|
+
jtMiter: number;
|
|
50
|
+
};
|
|
51
|
+
/** 原始数据组
|
|
52
|
+
*/
|
|
53
|
+
get lines(): LineSegment<LineUserData>[];
|
|
54
|
+
/**初始化
|
|
55
|
+
* @param width 墙体宽度
|
|
56
|
+
* @param scale 缩放比例
|
|
57
|
+
*/
|
|
58
|
+
constructor(width?: number, scale?: number);
|
|
59
|
+
/** 预处理数据
|
|
60
|
+
* @param data
|
|
61
|
+
*/
|
|
62
|
+
preprocessing(data: OriginalDataItem[]): {
|
|
63
|
+
lineSegments: LineSegment<LineUserData>[];
|
|
64
|
+
data: OriginalDataItem[];
|
|
65
|
+
};
|
|
66
|
+
/** 设置
|
|
67
|
+
* @param data 房屋结构数据,node环境可以为路径
|
|
68
|
+
* @param width 墙体宽度
|
|
69
|
+
* @param scale 缩放比例
|
|
70
|
+
* @param axisAlignmentCorrection 需要执行轴对称垂直纠正
|
|
71
|
+
* @param option
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
set(data: OriginalDataItem[] | string, width?: number, scale?: number): Promise<any>;
|
|
75
|
+
/** 创建分组
|
|
76
|
+
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
private createGroups;
|
|
80
|
+
/** 计算当前墙体数据的边界框
|
|
81
|
+
* @description 根据分组数据pointsGroups,计算包围盒, pointsGroups数据为缩放后数据。
|
|
82
|
+
* @description 可通过box属性查看计算结果。
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
computedSize(): Box2;
|
|
86
|
+
/** 线路拓扑
|
|
87
|
+
* @description 处理线路拓扑,使线路有序链接,形成长路径
|
|
88
|
+
* @param lines
|
|
89
|
+
*/
|
|
90
|
+
lineTopology(lines: Point[][]): Point<Record<string, any>>[][];
|
|
91
|
+
/** 合并方向相同的线段
|
|
92
|
+
* @param lines
|
|
93
|
+
* @param errAngle
|
|
94
|
+
*/
|
|
95
|
+
private mergeSameDirectionLine;
|
|
96
|
+
/** etOpenRound 去除毛刺
|
|
97
|
+
* @description 检查连续的短线段数量,去除合并后产生的毛刺
|
|
98
|
+
*/
|
|
99
|
+
private squareRemoveBurr;
|
|
100
|
+
/**
|
|
101
|
+
* 线段矫直, 线段中心突刺
|
|
102
|
+
* @description 突变长度小于墙体宽度,该线段可能为突起线段,
|
|
103
|
+
* @description 判断后续第2线段与上一条线段是否方向相同,相同就为突刺
|
|
104
|
+
*/
|
|
105
|
+
lineSegmentStraightening(path: Point[]): Point<Record<string, any>>[];
|
|
106
|
+
/**
|
|
107
|
+
* 移除短线段
|
|
108
|
+
* @todo 根据线段两端线段长度,选取参照物_|▔▔
|
|
109
|
+
* @param path
|
|
110
|
+
*/
|
|
111
|
+
removeShortLine(path: Point[], shortLine?: number): Point<Record<string, any>>[];
|
|
112
|
+
/** 线偏移
|
|
113
|
+
* @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
|
|
114
|
+
*/
|
|
115
|
+
lineOffset(endType?: number, joinType?: number, scale?: number): Point<Record<string, any>>[][];
|
|
116
|
+
/** 垂直纠正
|
|
117
|
+
* @param option
|
|
118
|
+
*/
|
|
119
|
+
axisAlignCorr(option?: SetDataOption): Promise<void>;
|
|
120
|
+
/** 完整线段数据
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
|
|
124
|
+
/**
|
|
125
|
+
* 将点云结构转换为Float32Array
|
|
126
|
+
*/
|
|
127
|
+
to3DArray(scale: number, z?: number): Float32Array<ArrayBuffer>;
|
|
128
|
+
/** 获取角度范围
|
|
129
|
+
* @param center
|
|
130
|
+
* @param p1
|
|
131
|
+
* @param p2
|
|
132
|
+
* @returns
|
|
133
|
+
*/
|
|
134
|
+
private getArcAngleRange;
|
|
135
|
+
/**
|
|
136
|
+
* 线段数据转为原始json数据
|
|
137
|
+
*/
|
|
138
|
+
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
139
|
+
/**
|
|
140
|
+
* 转为绘制数据
|
|
141
|
+
*/
|
|
142
|
+
toDrawDataJson(unit?: Unit): DrawData;
|
|
143
|
+
/**
|
|
144
|
+
* @param type
|
|
145
|
+
*/
|
|
146
|
+
toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
|
|
147
|
+
/**
|
|
148
|
+
* 将点json结构转换为Dxf string
|
|
149
|
+
*/
|
|
150
|
+
toDxfString(unit?: Unit): string;
|
|
151
|
+
/**
|
|
152
|
+
* 将点云结构转换为DXF格式
|
|
153
|
+
* @returns
|
|
154
|
+
*/
|
|
155
|
+
toDxfBlob(unit?: Unit): Blob;
|
|
156
|
+
/**
|
|
157
|
+
* 下载原始json
|
|
158
|
+
* @param filename
|
|
159
|
+
*/
|
|
160
|
+
downloadOriginalData(filename: string): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* 下载
|
|
163
|
+
* @param filename
|
|
164
|
+
*/
|
|
165
|
+
download(filename: string, unit?: Unit): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* 下载
|
|
168
|
+
* @param filename
|
|
169
|
+
*/
|
|
170
|
+
downloadImage(filename: string, unit?: Unit, type?: string): Promise<boolean>;
|
|
171
|
+
/**
|
|
172
|
+
* 计算原始数据的边界框
|
|
173
|
+
* @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
|
|
174
|
+
* @returns
|
|
175
|
+
*/
|
|
176
|
+
private computedOriginalSize;
|
|
177
|
+
/**
|
|
178
|
+
* 创建数据
|
|
179
|
+
* @param pointsGroups
|
|
180
|
+
* @returns
|
|
181
|
+
*/
|
|
182
|
+
static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
|
|
183
|
+
}
|
|
@@ -5,7 +5,6 @@ import * as THREE from "three";
|
|
|
5
5
|
export declare class WhiteModel extends Component<{
|
|
6
6
|
updateModel: {
|
|
7
7
|
whiteModelGroup: THREE.Group;
|
|
8
|
-
originalWhiteMode: THREE.Group;
|
|
9
8
|
};
|
|
10
9
|
}> {
|
|
11
10
|
static name: string;
|
|
@@ -13,7 +12,6 @@ export declare class WhiteModel extends Component<{
|
|
|
13
12
|
Variable: Variable | null;
|
|
14
13
|
whiteModelGroup: THREE.Group<THREE.Object3DEventMap>;
|
|
15
14
|
whiteModelLineGroup: THREE.Group<THREE.Object3DEventMap>;
|
|
16
|
-
originalWhiteMode: THREE.Group<THREE.Object3DEventMap>;
|
|
17
15
|
material: THREE.MeshStandardMaterial;
|
|
18
16
|
itemList: any[];
|
|
19
17
|
promise?: Promise<THREE.Group>;
|
|
@@ -3,9 +3,7 @@ import { default as Dxf3DView } from './pages/Dxf.vue';
|
|
|
3
3
|
import * as components from "./components";
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
type Option = {
|
|
6
|
-
originalLine?: boolean;
|
|
7
6
|
modelData?: boolean;
|
|
8
|
-
detailsPoint?: boolean;
|
|
9
7
|
orbitControls?: boolean;
|
|
10
8
|
camera?: THREE.Camera;
|
|
11
9
|
};
|
|
@@ -22,10 +22,16 @@ export declare class SceneAutoGenerat {
|
|
|
22
22
|
/** 构建物品模型
|
|
23
23
|
*/
|
|
24
24
|
buildItem(): Promise<void>;
|
|
25
|
-
static itemParse(item: any
|
|
25
|
+
static itemParse(item: any): {
|
|
26
26
|
box: THREE.LineSegments<THREE.EdgesGeometry<THREE.ExtrudeGeometry>, THREE.LineBasicMaterial, THREE.Object3DEventMap>;
|
|
27
27
|
center: THREE.Vector3;
|
|
28
28
|
category: any;
|
|
29
29
|
angle: number;
|
|
30
|
+
info: {
|
|
31
|
+
center: THREE.Vector3;
|
|
32
|
+
start: THREE.Vector3;
|
|
33
|
+
end: THREE.Vector3;
|
|
34
|
+
length: number;
|
|
35
|
+
}[];
|
|
30
36
|
};
|
|
31
37
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
message: string;
|
|
3
|
-
};
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
-
look: (...args: any[]) => void;
|
|
6
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
-
onLook?: ((...args: any[]) => any) | undefined;
|
|
8
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
|
-
export default _default;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Component, ComponentManager } from '../../ComponentManager';
|
|
2
|
-
import { Dxf } from './Dxf';
|
|
3
|
-
import { Variable } from './Variable';
|
|
4
|
-
import { Quadtree } from '../../Quadtree';
|
|
5
|
-
import { LineSegment } from '../../LineSegment';
|
|
6
|
-
import { Point } from '../../Point';
|
|
7
|
-
import * as THREE from "three";
|
|
8
|
-
type ProjectionAnalysisResult = {
|
|
9
|
-
source: LineSegment;
|
|
10
|
-
sourceIndex: number;
|
|
11
|
-
target: LineSegment;
|
|
12
|
-
targetIndex: number;
|
|
13
|
-
project: LineSegment;
|
|
14
|
-
project2: LineSegment;
|
|
15
|
-
};
|
|
16
|
-
export declare class LineAnalysis extends Component<{
|
|
17
|
-
analysisCompleted: {};
|
|
18
|
-
}> {
|
|
19
|
-
static name: string;
|
|
20
|
-
Dxf: Dxf | null;
|
|
21
|
-
Variable: Variable | null;
|
|
22
|
-
lineSegmentList: LineSegment<{
|
|
23
|
-
isDoor: boolean;
|
|
24
|
-
isWindow: boolean;
|
|
25
|
-
}>[];
|
|
26
|
-
container: THREE.Group<THREE.Object3DEventMap>;
|
|
27
|
-
errorAngle: number;
|
|
28
|
-
width: number;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param parent
|
|
32
|
-
*/
|
|
33
|
-
onAddFromParent(parent: ComponentManager): void;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @param p1
|
|
37
|
-
* @param p2
|
|
38
|
-
* @param width
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
expandLineSegment(p1: Point, p2: Point, width?: number): {
|
|
42
|
-
points: Point<Record<string, any>>[];
|
|
43
|
-
indices: number[];
|
|
44
|
-
rectIndices: number[];
|
|
45
|
-
};
|
|
46
|
-
appendLineSegmentList: LineSegment[];
|
|
47
|
-
/**
|
|
48
|
-
* 追加数据
|
|
49
|
-
* @param p1
|
|
50
|
-
* @param p2
|
|
51
|
-
*/
|
|
52
|
-
addData(p1: Point, p2: Point): void;
|
|
53
|
-
/** 结果分析创建矩形
|
|
54
|
-
* @param result
|
|
55
|
-
*/
|
|
56
|
-
createRectangle(result: ProjectionAnalysisResult): void;
|
|
57
|
-
quadtree?: Quadtree;
|
|
58
|
-
/**
|
|
59
|
-
* 构建线段四叉树,快速查找,
|
|
60
|
-
*/
|
|
61
|
-
buildQuadtree(): void;
|
|
62
|
-
resultList: ProjectionAnalysisResult[];
|
|
63
|
-
mergeWallLines: LineSegment[][];
|
|
64
|
-
/** 线段分析
|
|
65
|
-
* @description 判断两条线段距离是否较短且趋近平行,然后查找两条线段的重合部分的投影线,以此判断两根线是否需要合并
|
|
66
|
-
* @param data
|
|
67
|
-
*/
|
|
68
|
-
lineAnalysis(): void;
|
|
69
|
-
/** 线段投影分析
|
|
70
|
-
* @param index
|
|
71
|
-
* @param sourceLineSegment
|
|
72
|
-
* @param lineSegmentList
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
private projectionAnalysis;
|
|
76
|
-
}
|
|
77
|
-
export {};
|