build-dxf 0.0.43 → 0.0.45
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 -2
- package/src/build.js +2217 -1580
- package/src/index.css +1 -1
- package/src/index.js +1 -1
- package/src/index3.js +501 -501
- package/src/pages/Editor.vue.d.ts +1 -1
- package/src/pages/{Dxf.vue.d.ts → WallView.vue.d.ts} +3 -1
- package/src/selectLocalFile.js +792 -796
- 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/Dxf.d.ts +4 -4
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -97
- package/src/utils/DxfSystem/components/ThreeVJia.d.ts +27 -2
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +2 -2
- 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/PointDrag.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +2 -2
- package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +5 -5
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/ModelDataRender.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +3 -3
- package/src/utils/DxfSystem/type.d.ts +14 -4
- package/src/utils/DxfSystem/utils/AxisAlignCorr.d.ts +1 -1
- package/src/utils/DxfSystem/utils/BoundExt.d.ts +3 -3
- package/src/utils/DxfSystem/utils/DoubleWallHelper.d.ts +19 -0
- package/src/utils/DxfSystem/utils/clippingDoubleWall.d.ts +6 -0
- package/src/utils/DxfSystem/utils/clippingLineUserData.d.ts +7 -0
- package/src/utils/DxfSystem/utils/closedPathArea.d.ts +2 -0
- package/src/utils/DxfSystem/utils/createPointVirtualGrid.d.ts +3 -0
- package/src/utils/DxfSystem/utils/drawHelper.d.ts +5 -5
- package/src/utils/DxfSystem/utils/findClosedPolygons.d.ts +22 -0
- package/src/utils/DxfSystem/utils/findClosedPolygons01.d.ts +27 -0
- package/src/utils/DxfSystem/utils/findDiscretePointLine.d.ts +14 -0
- package/src/utils/DxfSystem/utils/findVerticalReference.d.ts +1 -1
- package/src/utils/DxfSystem/utils/lineDataToOriginalData.d.ts +3 -2
- package/src/utils/DxfSystem/utils/lineSegmentClipping.d.ts +1 -1
- package/src/utils/DxfSystem/utils/mergeLineUserData.d.ts +7 -0
- package/src/utils/DxfSystem/utils/originalDataToLineData.d.ts +1 -1
- package/src/utils/DxfSystem/utils/recomputedWindow.d.ts +1 -1
- package/src/utils/{Quadtree/LineSegment.d.ts → LineSegment.d.ts} +35 -3
- package/src/utils/Map.d.ts +17 -0
- package/src/utils/{Quadtree/Point.d.ts → Point.d.ts} +9 -0
- package/src/utils/PointVirtualGrid/index.d.ts +12 -8
- package/src/utils/{Quadtree/Quadtree.d.ts → Quadtree.d.ts} +2 -2
- package/src/utils/UndirectedGraph.d.ts +28 -0
- package/src/utils/UnionFindSet.d.ts +12 -0
- package/src/utils/cloneUserData.d.ts +7 -0
- /package/src/utils/{Quadtree/Box2.d.ts → Box2.d.ts} +0 -0
- /package/src/utils/{Quadtree/Rectangle.d.ts → Rectangle.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
2
|
+
import { LineSegment } from '../../LineSegment';
|
|
3
|
+
/** 查找有游离的点的线段
|
|
4
|
+
* @param lines
|
|
5
|
+
* @param grid
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function findDiscretePointLine<T = any>(lines: LineSegment<T>[], grid0?: PointVirtualGrid<LineSegment<T>>, removeLines?: Set<LineSegment<T>>, deep?: boolean): Set<LineSegment<T>>;
|
|
9
|
+
/** 查找有游离的点的线段, 通过点的统计,而不是虚拟网格
|
|
10
|
+
* @param lines
|
|
11
|
+
* @param grid
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function findDiscretePointLine2<T = any>(lines: LineSegment<T>[], removeLines?: Set<LineSegment<T>> | null, deep?: boolean): Set<LineSegment<T>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LineSegment } from '../../
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
2
|
export declare function findVerticalReference(lineSegments: LineSegment[]): LineSegment<Record<string, any>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { LineSegment } from '../../
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
2
|
import { LineUserData, OriginalDataItem } from '../type';
|
|
3
|
-
import { Quadtree } from '../../Quadtree
|
|
3
|
+
import { Quadtree } from '../../Quadtree';
|
|
4
|
+
export declare function toOriginalDataItem(line: LineSegment<LineUserData>, originalZAverage?: number, quadtree?: Quadtree, lines?: LineSegment[]): OriginalDataItem;
|
|
4
5
|
/**
|
|
5
6
|
* 线段数据转为原始json数据
|
|
6
7
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
|
+
import { LineUserData } from '../type';
|
|
3
|
+
/** 合并线段userData
|
|
4
|
+
* @param line1
|
|
5
|
+
* @param line2
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeLineUserData(line1: LineSegment<LineUserData>, line2: LineSegment<LineUserData> | LineSegment<LineUserData>[]): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LineSegment } from '../../
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
2
|
import { LineUserData, OriginalDataItem } from '../type';
|
|
3
3
|
export declare function originalDataToLineData(data: OriginalDataItem[]): {
|
|
4
4
|
originalZAverage: number;
|
|
@@ -6,9 +6,11 @@ import { Rectangle } from './Rectangle';
|
|
|
6
6
|
export declare class LineSegment<T = Record<string, any>> {
|
|
7
7
|
points: Point[];
|
|
8
8
|
userData: T;
|
|
9
|
+
currentData: Record<string | number | symbol, any>;
|
|
9
10
|
get center(): Point<Record<string, any>>;
|
|
10
11
|
get start(): Point<Record<string, any>>;
|
|
11
12
|
get end(): Point<Record<string, any>>;
|
|
13
|
+
id: number;
|
|
12
14
|
constructor(p1?: Point, p2?: Point);
|
|
13
15
|
set(p1: Point, p2: Point): this;
|
|
14
16
|
getAnotherPoint(point: Point): Point<Record<string, any>>;
|
|
@@ -101,6 +103,13 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
101
103
|
* @returns 投影并裁剪后的线段
|
|
102
104
|
*/
|
|
103
105
|
projectPoint(p1: Point, clip?: boolean): Point | null;
|
|
106
|
+
/**
|
|
107
|
+
* 判断两条线段,是否在同一直线上:
|
|
108
|
+
* - 返回 -1:不在同一直线(不共线)
|
|
109
|
+
* - 返回 0:共线但没有重合部分
|
|
110
|
+
* - 返回 1:共线且有重合(端点或区间重叠)
|
|
111
|
+
*/
|
|
112
|
+
sameLine(line: LineSegment): number;
|
|
104
113
|
/**
|
|
105
114
|
* 判断线段是否与另一条线段相交(包含共用端点或部分重合的情况)
|
|
106
115
|
* @param line
|
|
@@ -183,9 +192,15 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
183
192
|
*/
|
|
184
193
|
static maxLengthLineIndex(lines: LineSegment[], excludeCallBack?: (line: LineSegment) => boolean): number;
|
|
185
194
|
/** 对平行并且共线线段分组
|
|
186
|
-
* @param
|
|
195
|
+
* @param lines
|
|
196
|
+
*/
|
|
197
|
+
static groupBySamePointAndParallel(lines: LineSegment[]): LineSegment<Record<string, any>>[][];
|
|
198
|
+
/**
|
|
199
|
+
* @param lines
|
|
200
|
+
* @param line
|
|
201
|
+
* @returns
|
|
187
202
|
*/
|
|
188
|
-
static
|
|
203
|
+
static groupByPosition(lines: LineSegment[], line: LineSegment): LineSegment<Record<string, any>>[][];
|
|
189
204
|
/** 合并线段到最长线段
|
|
190
205
|
* @param lines
|
|
191
206
|
* @returns
|
|
@@ -199,14 +214,31 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
199
214
|
/** 合并满足平行的线段
|
|
200
215
|
* @param selectLines
|
|
201
216
|
*/
|
|
202
|
-
static autoMergeLines(
|
|
217
|
+
static autoMergeLines(lines: LineSegment[], callBack?: (newLine: LineSegment, group: LineSegment[]) => void): {
|
|
203
218
|
lines: LineSegment<Record<string, any>>[];
|
|
204
219
|
newLines: LineSegment<Record<string, any>>[];
|
|
205
220
|
deleteLines: LineSegment<Record<string, any>>[];
|
|
206
221
|
};
|
|
222
|
+
/** 合并本属于同一条的线段,切不能被其他线段分割
|
|
223
|
+
* @param lines
|
|
224
|
+
* @param callBack
|
|
225
|
+
* @returns
|
|
226
|
+
*/
|
|
227
|
+
static brokenLineMerging(lines: LineSegment[], callBack?: (newLine: LineSegment, group: LineSegment[]) => void): LineSegment<Record<string, any>>[];
|
|
207
228
|
/** 去重
|
|
208
229
|
* @param lines
|
|
209
230
|
* @returns
|
|
210
231
|
*/
|
|
211
232
|
static deduplication(lines: LineSegment[]): LineSegment<Record<string, any>>[];
|
|
233
|
+
/** 裁剪
|
|
234
|
+
* @param line
|
|
235
|
+
* @param points
|
|
236
|
+
* @returns
|
|
237
|
+
*/
|
|
238
|
+
static clipping(line: LineSegment, points: Point[], callBack?: (newLine: LineSegment, line: LineSegment) => void): LineSegment<Record<string, any>>[];
|
|
239
|
+
/** 通过线段裁剪线段
|
|
240
|
+
* @param target
|
|
241
|
+
* @param clippingLine
|
|
242
|
+
*/
|
|
243
|
+
static clippingByLine(target: LineSegment, clippingLine: LineSegment, callBack?: (newLine: LineSegment, line: LineSegment) => void): LineSegment<Record<string, any>>[];
|
|
212
244
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class MapEnhance<K, V> extends Map<K, V> {
|
|
2
|
+
get valueArray(): V[];
|
|
3
|
+
map<T = any>(callbackfn: (v: V, k: K) => T): T[];
|
|
4
|
+
filter(callbackfn: (v: V, k: K) => boolean): V[];
|
|
5
|
+
reduce<T>(callbackfn: (pre: T, v: V, k: K) => T, result: T): T;
|
|
6
|
+
some(callbackfn: (v: V, k: K) => boolean): boolean;
|
|
7
|
+
every(callbackfn: (v: V, k: K) => boolean): boolean;
|
|
8
|
+
find(callbackfn: (v: V, k: K) => boolean): V | undefined;
|
|
9
|
+
findKey(callbackfn: (v: V, k: K) => boolean): K | undefined;
|
|
10
|
+
someKeys(keys: K[]): boolean;
|
|
11
|
+
everyKeys(keys: K[]): boolean;
|
|
12
|
+
group(callbackfn: (v: V, k: K) => string): ArrayMap<string, V>;
|
|
13
|
+
toObject(): Record<string, V>;
|
|
14
|
+
}
|
|
15
|
+
export declare class ArrayMap<K, V> extends MapEnhance<K, V[]> {
|
|
16
|
+
append(k: K, ...arr: V[]): this;
|
|
17
|
+
}
|
|
@@ -5,6 +5,7 @@ export declare class Point<T = Record<string, any>> {
|
|
|
5
5
|
get X(): number;
|
|
6
6
|
get Y(): number;
|
|
7
7
|
userData: T;
|
|
8
|
+
currentData: Record<string | number | symbol, any>;
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
10
11
|
* @param x
|
|
@@ -48,6 +49,13 @@ export declare class Point<T = Record<string, any>> {
|
|
|
48
49
|
* @returns
|
|
49
50
|
*/
|
|
50
51
|
division(point: Point): this;
|
|
52
|
+
/**
|
|
53
|
+
* 减法
|
|
54
|
+
* @description 将当前点的坐标减去指定点的坐标
|
|
55
|
+
* @param point
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
subtract(point: Point): this;
|
|
51
59
|
/**
|
|
52
60
|
* 加法
|
|
53
61
|
* @description 将当前点的坐标加上指定点的坐标
|
|
@@ -129,6 +137,7 @@ export declare class Point<T = Record<string, any>> {
|
|
|
129
137
|
* @param point
|
|
130
138
|
*/
|
|
131
139
|
distance(point: Point): number;
|
|
140
|
+
hashCode(fixed?: number): string;
|
|
132
141
|
/**
|
|
133
142
|
* 克隆
|
|
134
143
|
* @returns
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box2 } from '../
|
|
2
|
-
import { Point } from '../
|
|
3
|
-
import { Rectangle } from '../
|
|
1
|
+
import { Box2 } from '../Box2';
|
|
2
|
+
import { Point } from '../Point';
|
|
3
|
+
import { Rectangle } from '../Rectangle';
|
|
4
4
|
type Target<T> = {
|
|
5
5
|
point: Point;
|
|
6
6
|
userData?: T;
|
|
@@ -8,11 +8,8 @@ type Target<T> = {
|
|
|
8
8
|
type NodeSet<T> = Set<Target<T>>;
|
|
9
9
|
export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
10
10
|
map: Map<string, NodeSet<T>>;
|
|
11
|
-
targetMap: Map<Point<Record<string, any>>, {
|
|
12
|
-
target: Target<T>;
|
|
13
|
-
set: NodeSet<T>;
|
|
14
|
-
}>;
|
|
15
11
|
gridSize: number;
|
|
12
|
+
id: symbol;
|
|
16
13
|
constructor(gridSize?: number);
|
|
17
14
|
/**
|
|
18
15
|
* 插入
|
|
@@ -32,6 +29,7 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
32
29
|
* @param point
|
|
33
30
|
*/
|
|
34
31
|
remove(point: Point): void;
|
|
32
|
+
update(point: Point): void;
|
|
35
33
|
/**
|
|
36
34
|
* 获取通过坐标,获取唯一网格索引
|
|
37
35
|
* @param point
|
|
@@ -73,7 +71,7 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
73
71
|
* 查找相同点
|
|
74
72
|
* @param point
|
|
75
73
|
*/
|
|
76
|
-
queryPoint(point: Point): {
|
|
74
|
+
queryPoint(point: Point, excludeOneself?: boolean): {
|
|
77
75
|
point: Point;
|
|
78
76
|
userData?: T;
|
|
79
77
|
}[];
|
|
@@ -85,5 +83,11 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
85
83
|
point: Point;
|
|
86
84
|
userData: T;
|
|
87
85
|
} | null;
|
|
86
|
+
/** 查找游离的点
|
|
87
|
+
*/
|
|
88
|
+
getFreePoint(): Target<T>[];
|
|
89
|
+
/** 查找第一个游离的点
|
|
90
|
+
*/
|
|
91
|
+
getFreePointFirst(): Target<T> | undefined;
|
|
88
92
|
}
|
|
89
93
|
export {};
|
|
@@ -16,8 +16,8 @@ export declare class Quadtree<T = any> {
|
|
|
16
16
|
children: Quadtree[] | null;
|
|
17
17
|
nodes: QuadtreeNode<T>[];
|
|
18
18
|
color: number[];
|
|
19
|
-
|
|
20
|
-
constructor(bounds: Box2, capacity?: number, maxDepth?: number, depth?: number,
|
|
19
|
+
id: symbol;
|
|
20
|
+
constructor(bounds: Box2, capacity?: number, maxDepth?: number, depth?: number, id?: symbol);
|
|
21
21
|
/**
|
|
22
22
|
* 插入线段节点
|
|
23
23
|
* @param node 线段节点
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LineSegment } from './LineSegment';
|
|
2
|
+
import { Point } from './Point';
|
|
3
|
+
export declare class UndirectedGraph {
|
|
4
|
+
protected adjacencyList: Map<number, Set<number>>;
|
|
5
|
+
get size(): number;
|
|
6
|
+
constructor();
|
|
7
|
+
addNode(node: number): void;
|
|
8
|
+
addEdge(u: number, v: number): void;
|
|
9
|
+
removeEdge(u: number, v: number): void;
|
|
10
|
+
removeNode(node: number): void;
|
|
11
|
+
getNeighbors(node: number): Set<number> | undefined;
|
|
12
|
+
printGraph(): void;
|
|
13
|
+
/** 循环
|
|
14
|
+
* @param callbackFun
|
|
15
|
+
*/
|
|
16
|
+
forEach(callbackFun: (node: number, neighbors: Set<number>) => void): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class LineSegmentUndirectedGraph extends UndirectedGraph {
|
|
19
|
+
constructor(lines: LineSegment[]);
|
|
20
|
+
private lineMap;
|
|
21
|
+
protected create(lines: LineSegment[]): void;
|
|
22
|
+
getLine(n1: number, n2: number): LineSegment<Record<string, any>> | undefined;
|
|
23
|
+
private indexMap;
|
|
24
|
+
private pointMap;
|
|
25
|
+
private currentIndex;
|
|
26
|
+
getIndex(point: Point): number;
|
|
27
|
+
getPoint(index: number): Point<Record<string, any>> | undefined;
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArrayMap } from './Map';
|
|
2
|
+
export declare class UnionFindSet {
|
|
3
|
+
private parent;
|
|
4
|
+
private rank;
|
|
5
|
+
constructor(size: number);
|
|
6
|
+
find(x: number): number;
|
|
7
|
+
union(x: number, y: number): void;
|
|
8
|
+
/** 获取所有集合
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
getAllSets(): ArrayMap<number, number>;
|
|
12
|
+
}
|
|
File without changes
|
|
File without changes
|