build-dxf 0.0.36 → 0.0.38
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/README.md +6 -1
- package/package.json +1 -1
- package/src/build.d.ts +2 -1
- package/src/build.js +2240 -2047
- package/src/index.css +1 -1
- package/src/index.js +7 -6
- package/src/index3.js +750 -740
- package/src/selectLocalFile.js +903 -880
- package/src/utils/DxfSystem/DxfSystem.d.ts +19 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +4 -138
- 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/VerticalCorrection.d.ts +2 -2
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +3 -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 +123 -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/findVerticalReference.d.ts +2 -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 +8 -0
- package/src/utils/DxfSystem/utils/recomputedWindow.d.ts +7 -0
- package/src/utils/Quadtree/LineSegment.d.ts +13 -2
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
static finalInstance?: DxfSystem;
|
|
12
|
+
/** 构造函数
|
|
13
|
+
* @param wallWidth 输出墙壁厚度,该墙壁厚度不受缩放影响
|
|
14
|
+
* @param scale 原始数据缩放比例
|
|
15
|
+
*/
|
|
16
|
+
constructor(wallWidth?: number, scale?: number);
|
|
17
|
+
usePlugin(plugin: (this: DxfSystem, dxfSystem: DxfSystem) => void): this;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -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,44 +167,10 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
267
167
|
* @returns
|
|
268
168
|
*/
|
|
269
169
|
private computedOriginalSize;
|
|
270
|
-
get boundaryExtension(): typeof Dxf.boundaryExtension;
|
|
271
|
-
/**
|
|
272
|
-
* 线段数据转为原始json数据
|
|
273
|
-
*/
|
|
274
|
-
static lineDataToOriginalData(lines: LineSegment<LineUserData>[], originalZAverage?: number, quadtree?: Quadtree): OriginalDataItem[];
|
|
275
170
|
/**
|
|
276
171
|
* 创建数据
|
|
277
172
|
* @param pointsGroups
|
|
278
173
|
* @returns
|
|
279
174
|
*/
|
|
280
175
|
static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
|
|
281
|
-
/** 根据交点,对线段进行裁剪
|
|
282
|
-
* @param this
|
|
283
|
-
* @param lines
|
|
284
|
-
*/
|
|
285
|
-
static lineSegmentClipping(lines: LineSegment<LineUserData>[]): LineSegment<LineUserData>[];
|
|
286
|
-
/**
|
|
287
|
-
* 重新计算窗户
|
|
288
|
-
* @param windowLines
|
|
289
|
-
*/
|
|
290
|
-
static recomputedWindow(...windowLines: LineSegment<LineUserData>[]): void;
|
|
291
|
-
/**
|
|
292
|
-
* 轴对齐垂直修正
|
|
293
|
-
* @param lines 待调整线段组
|
|
294
|
-
* @param targettLine 轴线段
|
|
295
|
-
* @returns
|
|
296
|
-
*/
|
|
297
|
-
static axisAlignmentCorrection(lines: LineSegment[], targettLine: LineSegment, option?: AxisAlignmentCorrectionOption): LineSegment<LineUserData>[];
|
|
298
|
-
/** 查找外墙
|
|
299
|
-
* @param lines
|
|
300
|
-
* @param trajectoryPoints
|
|
301
|
-
* @returns
|
|
302
|
-
*/
|
|
303
|
-
static findExteriorWall(lines: LineSegment[], trajectoryPoints: Point[], minWidth?: number): LineSegment<Record<string, any>>[];
|
|
304
|
-
/** 边线外扩
|
|
305
|
-
* @param lines
|
|
306
|
-
* @param trajectoryPoints
|
|
307
|
-
*/
|
|
308
|
-
static boundaryExtension(data: OriginalDataItem[], trajectory: any, wallWidth?: number): OriginalDataItem[];
|
|
309
176
|
}
|
|
310
|
-
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: {
|
|
@@ -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,7 +53,7 @@ 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
|
/** 开始
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { LineSegment } from '../../../../Quadtree/LineSegment';
|
|
2
2
|
import { Component } from '../../../../ComponentManager';
|
|
3
|
-
import { Dxf, LineUserData, OriginalDataItem } from '../../../components/Dxf';
|
|
4
3
|
import { Variable } from '../../../components/Variable';
|
|
5
4
|
import { EventInput, Renderer } from '../../RenderPlugin/components';
|
|
6
5
|
import { PointVirtualGrid } from '../../../../PointVirtualGrid';
|
|
7
6
|
import { Editor } from './Editor';
|
|
8
7
|
import { Quadtree } from '../../../../Quadtree/Quadtree';
|
|
9
8
|
import { DxfLineModel } from '../../ModelDataPlugin/components';
|
|
9
|
+
import { LineUserData, OriginalDataItem } from '../../../type';
|
|
10
|
+
import { Dxf } from '../../../components/Dxf';
|
|
10
11
|
import * as THREE from "three";
|
|
11
12
|
export declare class RenderManager extends Component<{}> {
|
|
12
13
|
static name: string;
|
|
@@ -46,12 +47,7 @@ export declare class RenderManager extends Component<{}> {
|
|
|
46
47
|
* @param point
|
|
47
48
|
* @returns
|
|
48
49
|
*/
|
|
49
|
-
adsorption(radius?: number,
|
|
50
|
-
point: THREE.Vector3;
|
|
51
|
-
find: boolean;
|
|
52
|
-
mode: string;
|
|
53
|
-
line: LineSegment<LineUserData>;
|
|
54
|
-
} | {
|
|
50
|
+
adsorption(radius?: number, _?: PointVirtualGrid<LineSegment<LineUserData>>, quadtree?: Quadtree<any>): {
|
|
55
51
|
point: THREE.Vector3;
|
|
56
52
|
find: boolean;
|
|
57
53
|
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,123 @@
|
|
|
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 FittingMethodType = "average" | "max";
|
|
86
|
+
export type AxisAlignmentCorrectionOption = {
|
|
87
|
+
/**
|
|
88
|
+
* 主轴阈值,默认 0.3 groupMethod是precision时生效
|
|
89
|
+
*/
|
|
90
|
+
principalAxisThreshold?: number;
|
|
91
|
+
/**
|
|
92
|
+
* 交叉轴阈值,默认 0.06
|
|
93
|
+
*/
|
|
94
|
+
crossAxistThreshold?: number;
|
|
95
|
+
/**
|
|
96
|
+
* 吸附阈值,默认 0.2
|
|
97
|
+
*/
|
|
98
|
+
snapThreshold?: number;
|
|
99
|
+
/**
|
|
100
|
+
* 拟合方式, 默认 max
|
|
101
|
+
* @description average 以分组线段平均数作为拟合位置
|
|
102
|
+
* @description max 以分组线段中最长线段作为拟合位置
|
|
103
|
+
*/
|
|
104
|
+
fittingMethod?: FittingMethodType;
|
|
105
|
+
/**
|
|
106
|
+
* 分组方式, 默认 default
|
|
107
|
+
* @description cross 以交叉轴辅助分组
|
|
108
|
+
* @description principalAndCross 以主轴和交叉轴辅助分组
|
|
109
|
+
* @description originalInterPoint 通过原始交点计算分组,把原来平行的放到分组里
|
|
110
|
+
*/
|
|
111
|
+
groupMethod?: "cross" | "principalAndCross" | "originalInterPoint";
|
|
112
|
+
/**
|
|
113
|
+
* 吸附方式, 默认 adsorption
|
|
114
|
+
*/
|
|
115
|
+
adsorptionMethod?: "originalInterPoint" | "adsorption";
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
export interface PointGroup {
|
|
121
|
+
points: Point[];
|
|
122
|
+
indices: number[];
|
|
123
|
+
}
|
|
@@ -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,8 @@
|
|
|
1
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
|
+
import { LineUserData } from '../type';
|
|
3
|
+
/** 根据交点,对线段进行裁剪
|
|
4
|
+
* @param lines
|
|
5
|
+
* @param minLen
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function lineSegmentClipping(lines: LineSegment<LineUserData>[], minLen?: number): LineSegment<LineUserData>[];
|
|
@@ -130,10 +130,16 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
130
130
|
*/
|
|
131
131
|
directionEqual(line: LineSegment, errAngle?: number): boolean;
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* 两条线段或角度是否平行
|
|
134
134
|
* @param line
|
|
135
135
|
*/
|
|
136
|
-
parallel(
|
|
136
|
+
parallel(angle: LineSegment | number, errAngle?: number): boolean;
|
|
137
|
+
/** 两条线段或角度是否 垂直
|
|
138
|
+
* @param line
|
|
139
|
+
* @param errAngle
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
vertical(angle: LineSegment | number, errAngle?: number): boolean;
|
|
137
143
|
/**
|
|
138
144
|
* 两条线段方向相反否一致
|
|
139
145
|
* @param line
|
|
@@ -179,6 +185,11 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
179
185
|
* @param selectLines
|
|
180
186
|
*/
|
|
181
187
|
static groupBySamePointAndParallel(selectLines: LineSegment[]): LineSegment<Record<string, any>>[][];
|
|
188
|
+
/** 合并线段到最长线段
|
|
189
|
+
* @param lines
|
|
190
|
+
* @returns
|
|
191
|
+
*/
|
|
192
|
+
static mergeLinesByMaxlength(...lines: LineSegment[]): LineSegment<Record<string, any>>;
|
|
182
193
|
/** 合并平行线段
|
|
183
194
|
* @param lines
|
|
184
195
|
* @returns
|