build-dxf 0.0.43 → 0.0.44
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.js +986 -907
- package/src/index3.js +337 -339
- package/src/pages/Editor.vue.d.ts +1 -1
- package/src/selectLocalFile.js +4640 -1769
- package/src/utils/DxfSystem/DxfSystem.d.ts +4 -0
- package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +2 -2
- package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +118 -0
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +0 -94
- package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +3 -3
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +7 -1
- package/src/utils/DxfSystem/type.d.ts +1 -0
- package/src/utils/DxfSystem/utils/drawHelper.d.ts +2 -2
- package/src/utils/DxfSystem/utils/extractClosedPolygons.d.ts +11 -0
- package/src/utils/PointVirtualGrid/index.d.ts +2 -1
- package/src/utils/Quadtree/LineSegment.d.ts +1 -1
- package/src/utils/Quadtree/Point.d.ts +7 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { ComponentManager } from '../ComponentManager';
|
|
2
2
|
import { AngleCorrectionDxf } from './components/AngleCorrectionDxf';
|
|
3
|
+
import { DoorsAnalysisComponent } from './components/DoorsAnalysis';
|
|
3
4
|
import { Dxf } from './components/Dxf';
|
|
5
|
+
import { LineAnalysis } from './components/LineAnalysis';
|
|
4
6
|
import { Variable } from './components/Variable';
|
|
5
7
|
export declare class DxfSystem extends ComponentManager {
|
|
6
8
|
Dxf: Dxf;
|
|
7
9
|
AngleCorrectionDxf: AngleCorrectionDxf;
|
|
8
10
|
Variable: Variable;
|
|
11
|
+
LineAnalysis: LineAnalysis;
|
|
12
|
+
DoorsAnalysis: DoorsAnalysisComponent;
|
|
9
13
|
wallWidth: number;
|
|
10
14
|
environment: "node" | "browser" | "unknown";
|
|
11
15
|
static finalInstance?: DxfSystem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentManager } from '../../ComponentManager';
|
|
2
1
|
import { Dxf } from './Dxf';
|
|
2
|
+
import { DxfSystem } from '../DxfSystem';
|
|
3
3
|
/**
|
|
4
4
|
* 角度修正过后的DXF格式数据
|
|
5
5
|
*/
|
|
@@ -8,6 +8,6 @@ export declare class AngleCorrectionDxf extends Dxf<{
|
|
|
8
8
|
}> {
|
|
9
9
|
static name: string;
|
|
10
10
|
angle: number;
|
|
11
|
-
onAddFromParent(parent:
|
|
11
|
+
onAddFromParent(parent: DxfSystem): void;
|
|
12
12
|
update(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Component, ComponentManager } from '../../ComponentManager';
|
|
2
|
+
import { Dxf } from './Dxf';
|
|
3
|
+
import { Quadtree } from '../../Quadtree/Quadtree';
|
|
4
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
5
|
+
import { Point } from '../../Quadtree/Point';
|
|
6
|
+
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
7
|
+
import { LineAnalysis } from './LineAnalysis';
|
|
8
|
+
type ProjectionAnalysisResult = {
|
|
9
|
+
source: LineSegment;
|
|
10
|
+
sourceIndex: number;
|
|
11
|
+
target: LineSegment;
|
|
12
|
+
targetIndex: number;
|
|
13
|
+
project: LineSegment;
|
|
14
|
+
project2: LineSegment;
|
|
15
|
+
};
|
|
16
|
+
type DoorPoint = {
|
|
17
|
+
line: LineSegment;
|
|
18
|
+
point: Point;
|
|
19
|
+
uuid: string;
|
|
20
|
+
};
|
|
21
|
+
declare class DoorsAnalysis {
|
|
22
|
+
possibleDoorPoints: DoorPoint[];
|
|
23
|
+
doorPoint: DoorPoint[];
|
|
24
|
+
calculatedDoorPoint: DoorPoint[];
|
|
25
|
+
dxf: Dxf;
|
|
26
|
+
pointVirtualGrid: PointVirtualGrid<LineSegment<Record<string, any>>>;
|
|
27
|
+
findPointVirtualGrid: PointVirtualGrid<LineSegment>;
|
|
28
|
+
quadtree: Quadtree;
|
|
29
|
+
resultList: ProjectionAnalysisResult[];
|
|
30
|
+
lineSegments: LineSegment[];
|
|
31
|
+
doorSearchNearAngle: number;
|
|
32
|
+
doorSearchDistance: number;
|
|
33
|
+
doors: LineSegment[];
|
|
34
|
+
lineAnalysis: LineAnalysis;
|
|
35
|
+
continueFind: boolean;
|
|
36
|
+
constructor(lineAnalysis: LineAnalysis);
|
|
37
|
+
private handle;
|
|
38
|
+
/** 查找
|
|
39
|
+
* @param doorPoints
|
|
40
|
+
* @param possibleDoorPoints
|
|
41
|
+
* @param minDoorWidth
|
|
42
|
+
* @param doorSearchDistance
|
|
43
|
+
* @param doorSearchNearAngle
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
private search;
|
|
47
|
+
/** 添加可查找点的过滤规则
|
|
48
|
+
* @param rule
|
|
49
|
+
*/
|
|
50
|
+
addPointsExcludeRule(rule: (line: LineSegment, point: Point, pointIndex: number) => boolean): void;
|
|
51
|
+
private _pointsExcludeRule;
|
|
52
|
+
/**
|
|
53
|
+
* 查找所有可能为门的点位
|
|
54
|
+
*/
|
|
55
|
+
getPossiblePoints(): DoorPoint[];
|
|
56
|
+
/**
|
|
57
|
+
* 查找已知为门的点位
|
|
58
|
+
*/
|
|
59
|
+
getDoorPoint(): {
|
|
60
|
+
doorPoints: DoorPoint[];
|
|
61
|
+
calculatedDoorPoint: DoorPoint[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 查找双线墙的点位
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
searchDoubleLinePoint(): Map<number, 0 | 1 | -1>;
|
|
68
|
+
/** 查找方案一:最近点查找
|
|
69
|
+
* @description 以点为圆心,查找半径内符合角度的点
|
|
70
|
+
* @param doorPoints
|
|
71
|
+
* @param possibleDoorPoints
|
|
72
|
+
* @param doorSearchDistance 查找的距离(半径)
|
|
73
|
+
* @param doorSearchNearAngle 查找的角度
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
searchNearby(doorPoints: DoorPoint[], possibleDoorPoints?: DoorPoint[], doorSearchDistance?: number, doorSearchNearAngle?: number): any[];
|
|
77
|
+
/** 方案二: 沿方向查找
|
|
78
|
+
* @description
|
|
79
|
+
* @param param0
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
searchAlongDirection({ point, line }: DoorPoint, doorSearchDistance?: number): {
|
|
83
|
+
point: Point;
|
|
84
|
+
line: LineSegment<Record<string, any>>;
|
|
85
|
+
} | undefined;
|
|
86
|
+
/** 方案三: 沿法线方向查找
|
|
87
|
+
* @description
|
|
88
|
+
* @param param0
|
|
89
|
+
* @param doorSearchDistance
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
92
|
+
searchAlongNormalDirection({ point, line }: DoorPoint, doorSearchDistance?: number): {
|
|
93
|
+
point: Point;
|
|
94
|
+
line: LineSegment<Record<string, any>>;
|
|
95
|
+
} | undefined;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @param line
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
findLongLineSegment(line: LineSegment): LineSegment<Record<string, any>>;
|
|
102
|
+
}
|
|
103
|
+
export declare class DoorsAnalysisComponent extends Component<{
|
|
104
|
+
analysisCompleted: {};
|
|
105
|
+
}> {
|
|
106
|
+
doorSearchNearAngle: number;
|
|
107
|
+
doorSearchDistance: number;
|
|
108
|
+
DoorsAnalysis?: DoorsAnalysis;
|
|
109
|
+
skipFindDoor: boolean;
|
|
110
|
+
needsSaveDoor: boolean;
|
|
111
|
+
doors: LineSegment[];
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param parent
|
|
115
|
+
*/
|
|
116
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -4,7 +4,6 @@ import { Variable } from './Variable';
|
|
|
4
4
|
import { Quadtree } from '../../Quadtree/Quadtree';
|
|
5
5
|
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
6
6
|
import { Point } from '../../Quadtree/Point';
|
|
7
|
-
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
8
7
|
import * as THREE from "three";
|
|
9
8
|
type ProjectionAnalysisResult = {
|
|
10
9
|
source: LineSegment;
|
|
@@ -14,93 +13,6 @@ type ProjectionAnalysisResult = {
|
|
|
14
13
|
project: LineSegment;
|
|
15
14
|
project2: LineSegment;
|
|
16
15
|
};
|
|
17
|
-
type DoorPoint = {
|
|
18
|
-
line: LineSegment;
|
|
19
|
-
point: Point;
|
|
20
|
-
uuid: string;
|
|
21
|
-
};
|
|
22
|
-
declare class DoorsAnalysis {
|
|
23
|
-
possibleDoorPoints: DoorPoint[];
|
|
24
|
-
doorPoint: DoorPoint[];
|
|
25
|
-
calculatedDoorPoint: DoorPoint[];
|
|
26
|
-
dxf: Dxf;
|
|
27
|
-
pointVirtualGrid: PointVirtualGrid<LineSegment<Record<string, any>>>;
|
|
28
|
-
findPointVirtualGrid: PointVirtualGrid<LineSegment>;
|
|
29
|
-
quadtree: Quadtree;
|
|
30
|
-
resultList: ProjectionAnalysisResult[];
|
|
31
|
-
lineSegments: LineSegment[];
|
|
32
|
-
doorSearchNearAngle: number;
|
|
33
|
-
doorSearchDistance: number;
|
|
34
|
-
doors: LineSegment[];
|
|
35
|
-
lineAnalysis: LineAnalysis;
|
|
36
|
-
continueFind: boolean;
|
|
37
|
-
constructor(lineAnalysis: LineAnalysis);
|
|
38
|
-
private handle;
|
|
39
|
-
/** 查找
|
|
40
|
-
* @param doorPoints
|
|
41
|
-
* @param possibleDoorPoints
|
|
42
|
-
* @param minDoorWidth
|
|
43
|
-
* @param doorSearchDistance
|
|
44
|
-
* @param doorSearchNearAngle
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
|
-
private search;
|
|
48
|
-
/** 添加可查找点的过滤规则
|
|
49
|
-
* @param rule
|
|
50
|
-
*/
|
|
51
|
-
addPointsExcludeRule(rule: (line: LineSegment, point: Point, pointIndex: number) => boolean): void;
|
|
52
|
-
private _pointsExcludeRule;
|
|
53
|
-
/**
|
|
54
|
-
* 查找所有可能为门的点位
|
|
55
|
-
*/
|
|
56
|
-
getPossiblePoints(): DoorPoint[];
|
|
57
|
-
/**
|
|
58
|
-
* 查找已知为门的点位
|
|
59
|
-
*/
|
|
60
|
-
getDoorPoint(): {
|
|
61
|
-
doorPoints: DoorPoint[];
|
|
62
|
-
calculatedDoorPoint: DoorPoint[];
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* 查找双线墙的点位
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
searchDoubleLinePoint(): Map<number, 0 | 1 | -1>;
|
|
69
|
-
/** 查找方案一:最近点查找
|
|
70
|
-
* @description 以点为圆心,查找半径内符合角度的点
|
|
71
|
-
* @param doorPoints
|
|
72
|
-
* @param possibleDoorPoints
|
|
73
|
-
* @param doorSearchDistance 查找的距离(半径)
|
|
74
|
-
* @param doorSearchNearAngle 查找的角度
|
|
75
|
-
* @returns
|
|
76
|
-
*/
|
|
77
|
-
searchNearby(doorPoints: DoorPoint[], possibleDoorPoints?: DoorPoint[], doorSearchDistance?: number, doorSearchNearAngle?: number): any[];
|
|
78
|
-
/** 方案二: 沿方向查找
|
|
79
|
-
* @description
|
|
80
|
-
* @param param0
|
|
81
|
-
* @returns
|
|
82
|
-
*/
|
|
83
|
-
searchAlongDirection({ point, line }: DoorPoint, doorSearchDistance?: number): {
|
|
84
|
-
point: Point;
|
|
85
|
-
line: LineSegment<Record<string, any>>;
|
|
86
|
-
} | undefined;
|
|
87
|
-
/** 方案三: 沿法线方向查找
|
|
88
|
-
* @description
|
|
89
|
-
* @param param0
|
|
90
|
-
* @param doorSearchDistance
|
|
91
|
-
* @returns
|
|
92
|
-
*/
|
|
93
|
-
searchAlongNormalDirection({ point, line }: DoorPoint, doorSearchDistance?: number): {
|
|
94
|
-
point: Point;
|
|
95
|
-
line: LineSegment<Record<string, any>>;
|
|
96
|
-
} | undefined;
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* @param line
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
findLongLineSegment(line: LineSegment): LineSegment<Record<string, any>>;
|
|
103
|
-
}
|
|
104
16
|
export declare class LineAnalysis extends Component<{
|
|
105
17
|
analysisCompleted: {};
|
|
106
18
|
}> {
|
|
@@ -161,11 +73,5 @@ export declare class LineAnalysis extends Component<{
|
|
|
161
73
|
* @returns
|
|
162
74
|
*/
|
|
163
75
|
private projectionAnalysis;
|
|
164
|
-
doorSearchNearAngle: number;
|
|
165
|
-
doorSearchDistance: number;
|
|
166
|
-
doors: LineSegment[];
|
|
167
|
-
DoorsAnalysis?: DoorsAnalysis;
|
|
168
|
-
skipFindDoor: boolean;
|
|
169
|
-
doorsAnalysis(): void;
|
|
170
76
|
}
|
|
171
77
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from '../../../../ComponentManager';
|
|
2
2
|
import { Dxf } from '../../../components/Dxf';
|
|
3
3
|
import { Variable } from '../../../components/Variable';
|
|
4
|
-
import { DomContainer, DomEventRegister, EventInput
|
|
4
|
+
import { Renderer, DomContainer, DomEventRegister, EventInput } from '../../RenderPlugin/components';
|
|
5
5
|
import { RenderManager } from './RenderManager';
|
|
6
6
|
import { CommandManager } from '../../../../CommandManager';
|
|
7
7
|
import { App } from 'vue';
|
|
@@ -47,7 +47,7 @@ export declare class RenderManager extends Component<{}> {
|
|
|
47
47
|
* @param point
|
|
48
48
|
* @returns
|
|
49
49
|
*/
|
|
50
|
-
adsorption(radius?: number, _?: PointVirtualGrid
|
|
50
|
+
adsorption(radius?: number, _?: PointVirtualGrid | null, quadtree?: Quadtree<any>): {
|
|
51
51
|
point: THREE.Vector3;
|
|
52
52
|
find: boolean;
|
|
53
53
|
mode: string;
|
|
@@ -55,8 +55,8 @@ export declare class RenderManager extends Component<{}> {
|
|
|
55
55
|
} | {
|
|
56
56
|
point: THREE.Vector3;
|
|
57
57
|
find: boolean;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
line: undefined;
|
|
59
|
+
mode: undefined;
|
|
60
60
|
};
|
|
61
61
|
/** 创建几何体
|
|
62
62
|
* @param rectangle
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CSS3DRenderer, CSS3DObject, CSS3DSprite } from 'three/addons/renderers/CSS3DRenderer.js';
|
|
2
2
|
import { CSS2DRenderer, CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';
|
|
3
3
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
4
|
+
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
5
|
+
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
6
|
+
import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
|
|
4
7
|
import { Component } from '../../../../ComponentManager';
|
|
5
8
|
import { Point } from '../../../../Quadtree/Point';
|
|
6
9
|
import { LineSegment } from '../../../../Quadtree/LineSegment';
|
|
@@ -50,6 +53,9 @@ export declare class Renderer extends Component<{
|
|
|
50
53
|
width: number;
|
|
51
54
|
height: number;
|
|
52
55
|
private tweenTaskList;
|
|
56
|
+
static loader: GLTFLoader;
|
|
57
|
+
static ktx2Loader: KTX2Loader;
|
|
58
|
+
static draco: DRACOLoader;
|
|
53
59
|
constructor(description: RendererDescription);
|
|
54
60
|
render(): void;
|
|
55
61
|
/**
|
|
@@ -93,6 +99,6 @@ export declare class Renderer extends Component<{
|
|
|
93
99
|
* @param parent
|
|
94
100
|
* @returns
|
|
95
101
|
*/
|
|
96
|
-
createCircle(point: Point, parameters?: THREE.PointsMaterialParameters, parent?: THREE.Object3D): THREE.Points<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.PointsMaterial, THREE.Object3DEventMap>;
|
|
102
|
+
createCircle(point: Point | Point[], parameters?: THREE.PointsMaterialParameters, parent?: THREE.Object3D): THREE.Points<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.PointsMaterial, THREE.Object3DEventMap>;
|
|
97
103
|
destroy(): void;
|
|
98
104
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
2
|
import { LineBasicMaterialParameters, PointsMaterialParameters } from 'three';
|
|
3
3
|
import { Point } from '../../Quadtree/Point';
|
|
4
|
-
export declare function drawLines(lines: LineSegment[] | LineSegment, parameters?: LineBasicMaterialParameters, offset?: number): any;
|
|
5
|
-
export declare function drawPoint(point: Point, parameters?: PointsMaterialParameters, offset?: number): any;
|
|
4
|
+
export declare function drawLines(lines: LineSegment[] | LineSegment | Point[], parameters?: LineBasicMaterialParameters, offset?: number): any;
|
|
5
|
+
export declare function drawPoint(point: Point | Point[], parameters?: PointsMaterialParameters, offset?: number): any;
|
|
6
6
|
export declare function drawText(text: any, point: Point, style?: any, offset?: number): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
2
|
+
import { Point } from '../../Quadtree/Point';
|
|
3
|
+
/**
|
|
4
|
+
* 多边形类型:点数组(闭合,最后一点连接第一点)
|
|
5
|
+
*/
|
|
6
|
+
type Polygon = Point[];
|
|
7
|
+
/**
|
|
8
|
+
* 从线段集合中提取所有闭合多边形
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractClosedPolygons(segments: LineSegment[]): Polygon[];
|
|
11
|
+
export {};
|
|
@@ -32,6 +32,7 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
32
32
|
* @param point
|
|
33
33
|
*/
|
|
34
34
|
remove(point: Point): void;
|
|
35
|
+
update(point: Point): void;
|
|
35
36
|
/**
|
|
36
37
|
* 获取通过坐标,获取唯一网格索引
|
|
37
38
|
* @param point
|
|
@@ -73,7 +74,7 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
73
74
|
* 查找相同点
|
|
74
75
|
* @param point
|
|
75
76
|
*/
|
|
76
|
-
queryPoint(point: Point): {
|
|
77
|
+
queryPoint(point: Point, excludeOneself?: boolean): {
|
|
77
78
|
point: Point;
|
|
78
79
|
userData?: T;
|
|
79
80
|
}[];
|
|
@@ -199,7 +199,7 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
199
199
|
/** 合并满足平行的线段
|
|
200
200
|
* @param selectLines
|
|
201
201
|
*/
|
|
202
|
-
static autoMergeLines(
|
|
202
|
+
static autoMergeLines(lines: LineSegment[]): {
|
|
203
203
|
lines: LineSegment<Record<string, any>>[];
|
|
204
204
|
newLines: LineSegment<Record<string, any>>[];
|
|
205
205
|
deleteLines: LineSegment<Record<string, any>>[];
|
|
@@ -48,6 +48,13 @@ export declare class Point<T = Record<string, any>> {
|
|
|
48
48
|
* @returns
|
|
49
49
|
*/
|
|
50
50
|
division(point: Point): this;
|
|
51
|
+
/**
|
|
52
|
+
* 减法
|
|
53
|
+
* @description 将当前点的坐标减去指定点的坐标
|
|
54
|
+
* @param point
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
subtract(point: Point): this;
|
|
51
58
|
/**
|
|
52
59
|
* 加法
|
|
53
60
|
* @description 将当前点的坐标加上指定点的坐标
|