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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentManager } from '../ComponentManager';
|
|
2
|
+
import { AngleCorrectionDxf } from './components/AngleCorrectionDxf';
|
|
3
|
+
import { Dxf } from './components/Dxf';
|
|
4
|
+
import { Variable } from './components/Variable';
|
|
5
|
+
export declare class DxfSystem extends ComponentManager {
|
|
6
|
+
Dxf: Dxf;
|
|
7
|
+
AngleCorrectionDxf: AngleCorrectionDxf;
|
|
8
|
+
Variable: Variable;
|
|
9
|
+
wallWidth: number;
|
|
10
|
+
environment: "node" | "browser" | "unknown";
|
|
11
|
+
/** 构造函数
|
|
12
|
+
* @param wallWidth 输出墙壁厚度,该墙壁厚度不受缩放影响
|
|
13
|
+
* @param scale 原始数据缩放比例
|
|
14
|
+
*/
|
|
15
|
+
constructor(wallWidth?: number, scale?: number);
|
|
16
|
+
usePlugin(plugin: (this: DxfSystem, dxfSystem: DxfSystem) => void): this;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -2,108 +2,8 @@ import { Component } from '../../ComponentManager';
|
|
|
2
2
|
import { Point } from '../../Quadtree/Point';
|
|
3
3
|
import { Box2 } from '../../Quadtree/Box2';
|
|
4
4
|
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
5
|
-
import { Quadtree
|
|
6
|
-
import
|
|
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
|
-
type AxisAlignmentCorrectionOption = {
|
|
87
|
-
/**
|
|
88
|
-
* 主轴阈值,默认 0.3
|
|
89
|
-
*/
|
|
90
|
-
principalAxisThreshold?: number;
|
|
91
|
-
/**
|
|
92
|
-
* 交叉轴阈值,默认 0.05
|
|
93
|
-
*/
|
|
94
|
-
crossAxistThreshold?: number;
|
|
95
|
-
/**
|
|
96
|
-
* 吸附阈值,默认 0.2
|
|
97
|
-
*/
|
|
98
|
-
snapThreshold?: number;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
*/
|
|
103
|
-
export interface PointGroup {
|
|
104
|
-
points: Point[];
|
|
105
|
-
indices: number[];
|
|
106
|
-
}
|
|
5
|
+
import { Quadtree } from '../../Quadtree/Quadtree';
|
|
6
|
+
import { AxisAlignmentCorrectionOption, DataItem, DrawData, LineUserData, OriginalDataItem, Unit } from '../type';
|
|
107
7
|
/**
|
|
108
8
|
* 将点云结构转换为DXF格式
|
|
109
9
|
*/
|
|
@@ -159,7 +59,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
159
59
|
* 预处理数据
|
|
160
60
|
* @param data
|
|
161
61
|
*/
|
|
162
|
-
preprocessing(data: OriginalDataItem[],
|
|
62
|
+
preprocessing(data: OriginalDataItem[], isAxisAlignCorr?: boolean, option?: AxisAlignmentCorrectionOption): {
|
|
163
63
|
lineSegments: LineSegment<LineUserData>[];
|
|
164
64
|
data: OriginalDataItem[];
|
|
165
65
|
};
|
|
@@ -171,7 +71,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
171
71
|
* @param option
|
|
172
72
|
* @returns
|
|
173
73
|
*/
|
|
174
|
-
set(data: OriginalDataItem[] | string, width?: number, scale?: number,
|
|
74
|
+
set(data: OriginalDataItem[] | string, width?: number, scale?: number, isAxisAlignCorr?: boolean, option?: AxisAlignmentCorrectionOption): Promise<any>;
|
|
175
75
|
/** 创建分组
|
|
176
76
|
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
177
77
|
* @returns
|
|
@@ -267,34 +167,10 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
267
167
|
* @returns
|
|
268
168
|
*/
|
|
269
169
|
private computedOriginalSize;
|
|
270
|
-
/**
|
|
271
|
-
* 线段数据转为原始json数据
|
|
272
|
-
*/
|
|
273
|
-
static lineDataToOriginalData(lines: LineSegment<LineUserData>[], originalZAverage?: number, quadtree?: Quadtree): OriginalDataItem[];
|
|
274
170
|
/**
|
|
275
171
|
* 创建数据
|
|
276
172
|
* @param pointsGroups
|
|
277
173
|
* @returns
|
|
278
174
|
*/
|
|
279
175
|
static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
|
|
280
|
-
/**
|
|
281
|
-
* 轴对齐垂直修正
|
|
282
|
-
* @param lines 待调整线段组
|
|
283
|
-
* @param targettLine 轴线段
|
|
284
|
-
* @returns
|
|
285
|
-
*/
|
|
286
|
-
static axisAlignmentCorrection(lines: LineSegment[], targettLine: LineSegment, option?: AxisAlignmentCorrectionOption): LineSegment<LineUserData>[];
|
|
287
|
-
/**
|
|
288
|
-
* @param lines
|
|
289
|
-
* @param trajectoryPoints
|
|
290
|
-
* @returns
|
|
291
|
-
*/
|
|
292
|
-
static findExteriorWall(lines: LineSegment[], trajectoryPoints: Point[], minWidth?: number): LineSegment<Record<string, any>>[];
|
|
293
|
-
/** 边线外扩
|
|
294
|
-
* @param lines
|
|
295
|
-
* @param trajectoryPoints
|
|
296
|
-
*/
|
|
297
|
-
static boundaryExtension(data: OriginalDataItem[], trajectory: any, wallWidth?: number): OriginalDataItem[];
|
|
298
|
-
boundaryExtension: typeof Dxf.boundaryExtension;
|
|
299
176
|
}
|
|
300
|
-
export {};
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Dxf } from './components/Dxf';
|
|
4
|
-
import { Variable } from './components/Variable';
|
|
5
|
-
export declare class DxfSystem extends ComponentManager {
|
|
6
|
-
Dxf: Dxf;
|
|
7
|
-
AngleCorrectionDxf: AngleCorrectionDxf;
|
|
8
|
-
Variable: Variable;
|
|
9
|
-
wallWidth: number;
|
|
10
|
-
environment: "node" | "browser" | "unknown";
|
|
11
|
-
/** 构造函数
|
|
12
|
-
* @param wallWidth 输出墙壁厚度,该墙壁厚度不受缩放影响
|
|
13
|
-
* @param scale 原始数据缩放比例
|
|
14
|
-
*/
|
|
15
|
-
constructor(wallWidth?: number, scale?: number);
|
|
16
|
-
usePlugin(plugin: (this: DxfSystem, dxfSystem: DxfSystem) => void): this;
|
|
17
|
-
destroy(): void;
|
|
18
|
-
}
|
|
1
|
+
export * from './DxfSystem';
|
|
2
|
+
export * as utils from './utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
2
2
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
3
|
-
import { LineUserData } from '../../../../
|
|
3
|
+
import { LineUserData } from '../../../../type';
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
export declare class Default extends CommandFlowComponent<{
|
|
6
6
|
selectLineChange: {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
2
|
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
3
|
-
import { LineUserData } from '../../../../components/Dxf';
|
|
4
3
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
4
|
+
import { LineUserData } from '../../../../type';
|
|
5
5
|
import * as THREE from "three";
|
|
6
6
|
export declare class DrawWindow extends CommandFlowComponent<{
|
|
7
7
|
pointerMove: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
2
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
|
-
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
4
3
|
/**
|
|
5
4
|
* 合并同向线段
|
|
6
5
|
*/
|
|
@@ -13,7 +12,6 @@ export declare class MergeLine extends CommandFlowComponent<{}> {
|
|
|
13
12
|
* 进入命令约束
|
|
14
13
|
*/
|
|
15
14
|
private constraint;
|
|
16
|
-
mergeLine(line1: LineSegment, line2: LineSegment): false | LineSegment<Record<string, any>>;
|
|
17
15
|
/** 开始
|
|
18
16
|
* @param next
|
|
19
17
|
* @todo 合并所有
|
|
@@ -2,7 +2,7 @@ import { CommandFlowComponent } from './CommandFlowComponent';
|
|
|
2
2
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
3
|
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
4
4
|
import { Point } from '../../../../../Quadtree/Point';
|
|
5
|
-
import { LineUserData } from '../../../../
|
|
5
|
+
import { LineUserData } from '../../../../type';
|
|
6
6
|
import * as THREE from "three";
|
|
7
7
|
/**
|
|
8
8
|
* 垂直纠正
|
|
@@ -53,18 +53,13 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
|
|
|
53
53
|
* @returns
|
|
54
54
|
*/
|
|
55
55
|
axisAlignmentCorrection(targettLine: LineSegment): {
|
|
56
|
-
newLines: LineSegment<
|
|
56
|
+
newLines: LineSegment<any>[];
|
|
57
57
|
oldLines: LineSegment<LineUserData>[];
|
|
58
58
|
};
|
|
59
59
|
/** 开始
|
|
60
60
|
* @param next
|
|
61
61
|
*/
|
|
62
62
|
verticalCorrection(next: any, selectLines: LineSegment[]): void;
|
|
63
|
-
/**
|
|
64
|
-
* 窗户恢复
|
|
65
|
-
* @param doorLines
|
|
66
|
-
*/
|
|
67
|
-
windowRecover(doorLines: LineSegment<LineUserData>[]): void;
|
|
68
63
|
/** 执行完成
|
|
69
64
|
* @param data
|
|
70
65
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LineSegment } from '../../../../Quadtree/LineSegment';
|
|
2
2
|
import { Component } from '../../../../ComponentManager';
|
|
3
|
-
import { Dxf, LineUserData
|
|
3
|
+
import { Dxf, LineUserData } from '../../../components/Dxf';
|
|
4
4
|
import { Variable } from '../../../components/Variable';
|
|
5
5
|
import { EventInput, Renderer } from '../../RenderPlugin/components';
|
|
6
6
|
import { PointVirtualGrid } from '../../../../PointVirtualGrid';
|
|
@@ -46,12 +46,7 @@ export declare class RenderManager extends Component<{}> {
|
|
|
46
46
|
* @param point
|
|
47
47
|
* @returns
|
|
48
48
|
*/
|
|
49
|
-
adsorption(radius?: number,
|
|
50
|
-
point: THREE.Vector3;
|
|
51
|
-
find: boolean;
|
|
52
|
-
mode: string;
|
|
53
|
-
line: LineSegment<LineUserData>;
|
|
54
|
-
} | {
|
|
49
|
+
adsorption(radius?: number, _?: PointVirtualGrid<LineSegment<LineUserData>>, quadtree?: Quadtree<any>): {
|
|
55
50
|
point: THREE.Vector3;
|
|
56
51
|
find: boolean;
|
|
57
52
|
mode: string;
|
|
@@ -87,5 +87,12 @@ export declare class Renderer extends Component<{
|
|
|
87
87
|
* @param count
|
|
88
88
|
*/
|
|
89
89
|
createLineSegments(map: Record<string, number[]> | LineSegment[], count: number, parameters?: THREE.LineBasicMaterialParameters, parent?: THREE.Object3D): THREE.LineSegments;
|
|
90
|
+
/** 创建点
|
|
91
|
+
* @param point
|
|
92
|
+
* @param parameters
|
|
93
|
+
* @param parent
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
createCircle(point: Point, parameters?: THREE.PointsMaterialParameters, parent?: THREE.Object3D): THREE.Points<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.PointsMaterial, THREE.Object3DEventMap>;
|
|
90
97
|
destroy(): void;
|
|
91
98
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { QuadtreeNode } from '../Quadtree/Quadtree';
|
|
2
|
+
import { Point } from '../Quadtree/Point';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
export 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";
|
|
5
|
+
export interface OriginalDataItem {
|
|
6
|
+
start: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
z?: number;
|
|
10
|
+
};
|
|
11
|
+
end: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
z?: number;
|
|
15
|
+
};
|
|
16
|
+
insetionArr: {
|
|
17
|
+
index: number;
|
|
18
|
+
p: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
z?: number;
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
length: number;
|
|
25
|
+
isDoor?: boolean;
|
|
26
|
+
doorDirectConnection?: boolean;
|
|
27
|
+
drawDoorData?: {
|
|
28
|
+
start: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
z?: number;
|
|
32
|
+
};
|
|
33
|
+
n: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
z?: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
wallWidth?: number;
|
|
40
|
+
isWindow?: boolean;
|
|
41
|
+
rooftopPz: number;
|
|
42
|
+
isVerticalReferenceLine?: boolean;
|
|
43
|
+
drawWindow?: {
|
|
44
|
+
p: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
z?: number;
|
|
48
|
+
};
|
|
49
|
+
width: number;
|
|
50
|
+
full: boolean;
|
|
51
|
+
}[];
|
|
52
|
+
}
|
|
53
|
+
export type LineUserData = {
|
|
54
|
+
doorDirectConnection?: boolean;
|
|
55
|
+
isDoor?: boolean;
|
|
56
|
+
isWindow?: boolean;
|
|
57
|
+
isVerticalReferenceLine?: boolean;
|
|
58
|
+
wallWidth?: number;
|
|
59
|
+
rooftopPz: number;
|
|
60
|
+
drawWindow?: {
|
|
61
|
+
p: THREE.Vector3;
|
|
62
|
+
width: number;
|
|
63
|
+
full: boolean;
|
|
64
|
+
}[];
|
|
65
|
+
drawDoorData?: any;
|
|
66
|
+
quadtreeNode?: QuadtreeNode;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* [开始点, 结束点, 相交点, 是否是门, 索引]
|
|
70
|
+
*/
|
|
71
|
+
export type DataItem = [Point, Point, number[], boolean, number];
|
|
72
|
+
export type DrawData = {
|
|
73
|
+
unit: Unit;
|
|
74
|
+
line: [number, number, number, number, string][];
|
|
75
|
+
arc: [number, number, number, number, number, string][];
|
|
76
|
+
dimensionLine: number[][];
|
|
77
|
+
center: {
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
};
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
scale: number;
|
|
84
|
+
};
|
|
85
|
+
export type AxisAlignmentCorrectionOption = {
|
|
86
|
+
/**
|
|
87
|
+
* 主轴阈值,默认 0.3
|
|
88
|
+
*/
|
|
89
|
+
principalAxisThreshold?: number;
|
|
90
|
+
/**
|
|
91
|
+
* 交叉轴阈值,默认 0.05
|
|
92
|
+
*/
|
|
93
|
+
crossAxistThreshold?: number;
|
|
94
|
+
/**
|
|
95
|
+
* 吸附阈值,默认 0.2
|
|
96
|
+
*/
|
|
97
|
+
snapThreshold?: number;
|
|
98
|
+
groupMethod?: "precision" | "default";
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
export interface PointGroup {
|
|
104
|
+
points: Point[];
|
|
105
|
+
indices: number[];
|
|
106
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
|
+
import { AxisAlignmentCorrectionOption, LineUserData } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* 轴对齐垂直纠正类
|
|
5
|
+
*/
|
|
6
|
+
export declare class AxisAlignCorr {
|
|
7
|
+
/**
|
|
8
|
+
* 轴对齐垂直修正
|
|
9
|
+
* @param lines 待调整线段组
|
|
10
|
+
* @param targettLine 轴线段
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
static correction(lines: LineSegment<LineUserData>[], targettLine: LineSegment<LineUserData>, option?: AxisAlignmentCorrectionOption): LineSegment<any>[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
|
+
import { Point } from '../../Quadtree/Point';
|
|
3
|
+
import { OriginalDataItem } from '../type';
|
|
4
|
+
export declare class BoundExt {
|
|
5
|
+
/** 通过轨迹点查找外墙
|
|
6
|
+
* @param lines
|
|
7
|
+
* @param trajectoryPoints
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
static findExtWallByTraj(lines: LineSegment[], trajectoryPoints: Point[], minWidth?: number): LineSegment<Record<string, any>>[];
|
|
11
|
+
/** 通过轨迹点外扩边线
|
|
12
|
+
* @param lines
|
|
13
|
+
* @param trajectoryPoints
|
|
14
|
+
*/
|
|
15
|
+
static boundExtbyTraj(data: OriginalDataItem[], trajectory: any, wallWidth?: number): OriginalDataItem[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
|
+
import { LineUserData, OriginalDataItem } from '../type';
|
|
3
|
+
import { Quadtree } from '../../Quadtree/Quadtree';
|
|
4
|
+
/**
|
|
5
|
+
* 线段数据转为原始json数据
|
|
6
|
+
*/
|
|
7
|
+
export declare function lineDataToOriginalData(lines: LineSegment<LineUserData>[], originalZAverage?: number, quadtree?: Quadtree): OriginalDataItem[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
|
+
import { LineUserData } from '../type';
|
|
3
|
+
/** 根据交点,对线段进行裁剪
|
|
4
|
+
* @param this
|
|
5
|
+
* @param lines
|
|
6
|
+
*/
|
|
7
|
+
export declare function lineSegmentClipping(lines: LineSegment<LineUserData>[]): LineSegment<LineUserData>[];
|
|
@@ -175,4 +175,26 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
175
175
|
* @param lines
|
|
176
176
|
*/
|
|
177
177
|
static maxLengthLineIndex(lines: LineSegment[], excludeCallBack?: (line: LineSegment) => boolean): number;
|
|
178
|
+
/** 对平行并且共线线段分组
|
|
179
|
+
* @param selectLines
|
|
180
|
+
*/
|
|
181
|
+
static groupBySamePointAndParallel(selectLines: LineSegment[]): LineSegment<Record<string, any>>[][];
|
|
182
|
+
/** 合并平行线段
|
|
183
|
+
* @param lines
|
|
184
|
+
* @returns
|
|
185
|
+
*/
|
|
186
|
+
static mergeLines(...lines: LineSegment[]): LineSegment<Record<string, any>>;
|
|
187
|
+
/** 合并满足平行的线段
|
|
188
|
+
* @param selectLines
|
|
189
|
+
*/
|
|
190
|
+
static autoMergeLines(selectLines: LineSegment[]): {
|
|
191
|
+
lines: LineSegment<Record<string, any>>[];
|
|
192
|
+
newLines: LineSegment<Record<string, any>>[];
|
|
193
|
+
deleteLines: LineSegment<Record<string, any>>[];
|
|
194
|
+
};
|
|
195
|
+
/** 去重
|
|
196
|
+
* @param lines
|
|
197
|
+
* @returns
|
|
198
|
+
*/
|
|
199
|
+
static deduplication(lines: LineSegment[]): LineSegment<Record<string, any>>[];
|
|
178
200
|
}
|
|
@@ -16,16 +16,21 @@ export declare class Quadtree<T = any> {
|
|
|
16
16
|
children: Quadtree[] | null;
|
|
17
17
|
nodes: QuadtreeNode<T>[];
|
|
18
18
|
color: number[];
|
|
19
|
-
|
|
19
|
+
targetMap: Map<LineSegment, QuadtreeNode<T>>;
|
|
20
|
+
constructor(bounds: Box2, capacity?: number, maxDepth?: number, depth?: number, targetMap?: Map<LineSegment<Record<string, any>>, QuadtreeNode<T>>);
|
|
20
21
|
/**
|
|
21
22
|
* 插入线段节点
|
|
22
23
|
* @param node 线段节点
|
|
23
24
|
*/
|
|
24
|
-
insert(node: QuadtreeNode<T>): void;
|
|
25
|
+
insert(node: QuadtreeNode<T> | LineSegment): void;
|
|
25
26
|
/** 移除
|
|
26
27
|
* @param node
|
|
27
28
|
*/
|
|
28
|
-
remove(node: QuadtreeNode<T>): void;
|
|
29
|
+
remove(node: QuadtreeNode<T> | LineSegment): void;
|
|
30
|
+
/** 移除
|
|
31
|
+
* @param node
|
|
32
|
+
*/
|
|
33
|
+
update(node: QuadtreeNode<T> | LineSegment): void;
|
|
29
34
|
/**
|
|
30
35
|
* 获取线段所属的象限
|
|
31
36
|
* @param line 线段
|