build-dxf 0.1.8 → 0.1.10
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 +3869 -4858
- 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/CorrectionDxf.d.ts +5 -111
- package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +1 -4
- package/src/utils/DxfSystem/components/Dxf.d.ts +67 -122
- 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/CAD.d.ts +1 -0
- 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;
|
|
@@ -1,73 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Box2 } from '../../Box2';
|
|
3
|
-
import { LineSegment } from '../../LineSegment';
|
|
4
|
-
import { Quadtree } from '../../Quadtree';
|
|
5
|
-
import { SetDataOption, DataItem, LineUserData, OriginalDataItem, Unit } from '../type';
|
|
6
|
-
import { CAD } from '../utils/CAD';
|
|
1
|
+
import { SetDataOption, OriginalDataItem } from '../type';
|
|
7
2
|
import { DxfSystem } from '../DxfSystem';
|
|
8
|
-
|
|
9
|
-
export declare const PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", PreProcessor>;
|
|
3
|
+
import { Dxf } from './Dxf';
|
|
10
4
|
/**
|
|
11
5
|
* 将点云结构转换为DXF格式
|
|
12
6
|
*/
|
|
13
|
-
export declare class CorrectionDxf<TEventMap extends {} = {}> extends
|
|
14
|
-
dataChange: {
|
|
15
|
-
originalData: OriginalDataItem[];
|
|
16
|
-
data: DataItem[];
|
|
17
|
-
cad: CAD;
|
|
18
|
-
};
|
|
19
|
-
cadChange: {
|
|
20
|
-
cad: CAD;
|
|
21
|
-
};
|
|
22
|
-
preprocessing: {
|
|
23
|
-
data: OriginalDataItem[];
|
|
24
|
-
setData(data: OriginalDataItem[]): void;
|
|
25
|
-
};
|
|
26
|
-
} & TEventMap> {
|
|
7
|
+
export declare class CorrectionDxf<TEventMap extends {} = {}> extends Dxf<{} & TEventMap> {
|
|
27
8
|
static name: string;
|
|
28
|
-
static readonly PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter",
|
|
29
|
-
width: number;
|
|
30
|
-
originalData: OriginalDataItem[];
|
|
31
|
-
data: DataItem[];
|
|
32
|
-
box: Box2;
|
|
33
|
-
cad: CAD | null;
|
|
34
|
-
lineSegments: LineSegment<LineUserData>[];
|
|
35
|
-
doorLineSegment: LineSegment[];
|
|
36
|
-
verticalReferenceLine?: LineSegment<LineUserData>;
|
|
37
|
-
originalZAverage: number;
|
|
38
|
-
private _preProcessorSet;
|
|
39
|
-
trajectory: Record<string, any> | null;
|
|
40
|
-
onBoundExt?: (lines: LineSegment[], trajectory: any) => void;
|
|
41
|
-
/** 原始数据组
|
|
42
|
-
*/
|
|
43
|
-
get lines(): LineSegment<LineUserData>[];
|
|
44
|
-
/**初始化
|
|
45
|
-
* @param width 墙体宽度
|
|
46
|
-
*/
|
|
47
|
-
constructor(width?: number);
|
|
48
|
-
setTrajectory(trajectory: Record<string, any> | null, onBoundExt?: (lines: LineSegment[], trajectory: any) => void): this;
|
|
9
|
+
static readonly PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", (lines: import('../..').LineSegment[], option: SetDataOption) => import('../..').LineSegment[]>;
|
|
49
10
|
onAddFromParent(parent: DxfSystem): void;
|
|
50
|
-
/** 完整线段数据
|
|
51
|
-
* @returns
|
|
52
|
-
*/
|
|
53
|
-
getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
|
|
54
|
-
/**
|
|
55
|
-
* 预处理数据
|
|
56
|
-
* @param data
|
|
57
|
-
*/
|
|
58
|
-
private preprocessing;
|
|
59
|
-
/** 添加预处理
|
|
60
|
-
* @param handler
|
|
61
|
-
*/
|
|
62
|
-
addPreProcessor(handler: PreProcessor): this;
|
|
63
|
-
/** 删除预处理
|
|
64
|
-
* @param handler
|
|
65
|
-
*/
|
|
66
|
-
removePreProcessor(handler: PreProcessor): this;
|
|
67
|
-
/** 清空预处理
|
|
68
|
-
* @returns
|
|
69
|
-
*/
|
|
70
|
-
clearPreProcessor(): this;
|
|
71
11
|
/** 设置
|
|
72
12
|
* @param data 房屋结构数据,node环境可以为路径
|
|
73
13
|
* @param width 墙体宽度
|
|
@@ -76,51 +16,5 @@ export declare class CorrectionDxf<TEventMap extends {} = {}> extends Component<
|
|
|
76
16
|
* @param option
|
|
77
17
|
* @returns
|
|
78
18
|
*/
|
|
79
|
-
set(data: OriginalDataItem[], options?: SetDataOption):
|
|
80
|
-
/**
|
|
81
|
-
* 线段数据转为原始json数据
|
|
82
|
-
*/
|
|
83
|
-
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
84
|
-
/**
|
|
85
|
-
* 下载原始json
|
|
86
|
-
* @param filename
|
|
87
|
-
*/
|
|
88
|
-
downloadOriginalData(filename: string): Promise<void>;
|
|
89
|
-
/** 获取绘制数据
|
|
90
|
-
*/
|
|
91
|
-
toDrawData(unit?: Unit): {
|
|
92
|
-
unit: Unit;
|
|
93
|
-
lines: [number, number, number, number, string][];
|
|
94
|
-
arcs: [number, number, number, number, number, string][];
|
|
95
|
-
texts: [string, number, number, string][];
|
|
96
|
-
center: {
|
|
97
|
-
x: number;
|
|
98
|
-
y: number;
|
|
99
|
-
};
|
|
100
|
-
width: number;
|
|
101
|
-
height: number;
|
|
102
|
-
scale: number;
|
|
103
|
-
} | undefined;
|
|
104
|
-
/** 获取 dxf 图片 二进制对象
|
|
105
|
-
* @param type
|
|
106
|
-
*/
|
|
107
|
-
toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
|
|
108
|
-
/** 下载 dxf 图片
|
|
109
|
-
* @param filename
|
|
110
|
-
*/
|
|
111
|
-
downloadDxfImage(filename: string, unit?: Unit, type?: string): Promise<boolean | undefined>;
|
|
112
|
-
/**
|
|
113
|
-
* 将点json结构转换为Dxf 字符串
|
|
114
|
-
*/
|
|
115
|
-
toDxfString(unit?: Unit): string | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* 将点云结构转换为 DXF 二进制对象
|
|
118
|
-
* @returns
|
|
119
|
-
*/
|
|
120
|
-
toDxfBlob(unit?: Unit): Blob | undefined;
|
|
121
|
-
/** 下载Dxf
|
|
122
|
-
* @param filename
|
|
123
|
-
*/
|
|
124
|
-
downloadDxf(filename: string, unit?: Unit): Promise<void | undefined>;
|
|
19
|
+
set(data: OriginalDataItem[], options?: SetDataOption): any;
|
|
125
20
|
}
|
|
126
|
-
export {};
|
|
@@ -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,45 +24,51 @@ 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
45
|
*/
|
|
58
|
-
constructor(width?: number
|
|
59
|
-
|
|
46
|
+
constructor(width?: number);
|
|
47
|
+
setTrajectory(trajectory: Record<string, any> | null, onBoundExt?: (lines: LineSegment[], trajectory: any) => void): this;
|
|
48
|
+
/** 完整线段数据
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
|
|
52
|
+
/**
|
|
53
|
+
* 预处理数据
|
|
60
54
|
* @param data
|
|
61
55
|
*/
|
|
62
|
-
preprocessing(data: OriginalDataItem[]): {
|
|
56
|
+
protected preprocessing(data: OriginalDataItem[], options: SetDataOption): {
|
|
63
57
|
lineSegments: LineSegment<LineUserData>[];
|
|
64
58
|
data: OriginalDataItem[];
|
|
65
59
|
};
|
|
60
|
+
/** 添加预处理
|
|
61
|
+
* @param handler
|
|
62
|
+
*/
|
|
63
|
+
addPreProcessor(handler: PreProcessor): this;
|
|
64
|
+
/** 删除预处理
|
|
65
|
+
* @param handler
|
|
66
|
+
*/
|
|
67
|
+
removePreProcessor(handler: PreProcessor): this;
|
|
68
|
+
/** 清空预处理
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
clearPreProcessor(): this;
|
|
66
72
|
/** 设置
|
|
67
73
|
* @param data 房屋结构数据,node环境可以为路径
|
|
68
74
|
* @param width 墙体宽度
|
|
@@ -71,113 +77,52 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
71
77
|
* @param option
|
|
72
78
|
* @returns
|
|
73
79
|
*/
|
|
74
|
-
set(data: OriginalDataItem[] | string,
|
|
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;
|
|
80
|
+
set(data: OriginalDataItem[] | string, options?: SetDataOption): Promise<any>;
|
|
135
81
|
/**
|
|
136
82
|
* 线段数据转为原始json数据
|
|
137
83
|
*/
|
|
138
84
|
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
139
85
|
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
86
|
+
* 下载原始json
|
|
87
|
+
* @param filename
|
|
88
|
+
*/
|
|
89
|
+
downloadOriginalData(filename: string): Promise<void>;
|
|
90
|
+
/** 获取绘制数据
|
|
91
|
+
*/
|
|
92
|
+
toDrawData(unit?: Unit): {
|
|
93
|
+
unit: Unit;
|
|
94
|
+
lines: [number, number, number, number, string][];
|
|
95
|
+
lines2: [number, number, number, number, string][];
|
|
96
|
+
arcs: [number, number, number, number, number, string][];
|
|
97
|
+
texts: [string, number, number, string][];
|
|
98
|
+
center: {
|
|
99
|
+
x: number;
|
|
100
|
+
y: number;
|
|
101
|
+
};
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
scale: number;
|
|
105
|
+
} | undefined;
|
|
106
|
+
/** 获取 dxf 图片 二进制对象
|
|
144
107
|
* @param type
|
|
145
108
|
*/
|
|
146
109
|
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
|
-
* 下载
|
|
110
|
+
/** 下载 dxf 图片
|
|
163
111
|
* @param filename
|
|
164
112
|
*/
|
|
165
|
-
|
|
113
|
+
downloadDxfImage(filename: string, unit?: Unit, type?: string): Promise<boolean | undefined>;
|
|
166
114
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @param filename
|
|
115
|
+
* 将点json结构转换为Dxf 字符串
|
|
169
116
|
*/
|
|
170
|
-
|
|
117
|
+
toDxfString(unit?: Unit): string | undefined;
|
|
171
118
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
|
|
119
|
+
* 将点云结构转换为 DXF 二进制对象
|
|
174
120
|
* @returns
|
|
175
121
|
*/
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
*
|
|
179
|
-
* @param pointsGroups
|
|
180
|
-
* @returns
|
|
122
|
+
toDxfBlob(unit?: Unit): Blob | undefined;
|
|
123
|
+
/** 下载Dxf
|
|
124
|
+
* @param filename
|
|
181
125
|
*/
|
|
182
|
-
|
|
126
|
+
downloadDxf(filename: string, unit?: Unit): Promise<void | undefined>;
|
|
183
127
|
}
|
|
128
|
+
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
|
};
|
|
@@ -7,6 +7,7 @@ type EndType = "etOpenSquare" | "etOpenButt" | "etOpenRound";
|
|
|
7
7
|
type DrawData = {
|
|
8
8
|
unit: Unit;
|
|
9
9
|
lines: [number, number, number, number, string][];
|
|
10
|
+
lines2: [number, number, number, number, string][];
|
|
10
11
|
arcs: [number, number, number, number, number, string][];
|
|
11
12
|
texts: [string, number, number, string][];
|
|
12
13
|
center: {
|