build-dxf 0.0.44 → 0.0.46
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 +2000 -1449
- package/src/index.css +1 -1
- package/src/index.js +1 -1
- package/src/index3.js +230 -228
- package/src/pages/{Dxf.vue.d.ts → WallView.vue.d.ts} +3 -1
- package/src/selectLocalFile.js +1763 -4638
- package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +3 -3
- package/src/utils/DxfSystem/components/Dxf.d.ts +4 -4
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -3
- 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/RenderManager.d.ts +2 -2
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/ModelDataRender.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +2 -8
- package/src/utils/DxfSystem/type.d.ts +13 -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 +4 -4
- 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} +2 -0
- package/src/utils/PointVirtualGrid/index.d.ts +10 -7
- 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/DxfSystem/utils/extractClosedPolygons.d.ts +0 -11
- /package/src/utils/{Quadtree/Box2.d.ts → Box2.d.ts} +0 -0
- /package/src/utils/{Quadtree/Rectangle.d.ts → Rectangle.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Component, ComponentManager } from '../../ComponentManager';
|
|
2
2
|
import { Dxf } from './Dxf';
|
|
3
|
-
import { Quadtree } from '../../Quadtree
|
|
4
|
-
import { LineSegment } from '../../
|
|
5
|
-
import { Point } from '../../
|
|
3
|
+
import { Quadtree } from '../../Quadtree';
|
|
4
|
+
import { LineSegment } from '../../LineSegment';
|
|
5
|
+
import { Point } from '../../Point';
|
|
6
6
|
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
7
7
|
import { LineAnalysis } from './LineAnalysis';
|
|
8
8
|
type ProjectionAnalysisResult = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Component } from '../../ComponentManager';
|
|
2
|
-
import { Point } from '../../
|
|
3
|
-
import { Box2 } from '../../
|
|
4
|
-
import { LineSegment } from '../../
|
|
5
|
-
import { Quadtree } from '../../Quadtree
|
|
2
|
+
import { Point } from '../../Point';
|
|
3
|
+
import { Box2 } from '../../Box2';
|
|
4
|
+
import { LineSegment } from '../../LineSegment';
|
|
5
|
+
import { Quadtree } from '../../Quadtree';
|
|
6
6
|
import { AxisAlignmentCorrectionOption, DataItem, DrawData, LineUserData, OriginalDataItem, Unit } from '../type';
|
|
7
7
|
/**
|
|
8
8
|
* 将点云结构转换为DXF格式
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Component, ComponentManager } from '../../ComponentManager';
|
|
2
2
|
import { Dxf } from './Dxf';
|
|
3
3
|
import { Variable } from './Variable';
|
|
4
|
-
import { Quadtree } from '../../Quadtree
|
|
5
|
-
import { LineSegment } from '../../
|
|
6
|
-
import { Point } from '../../
|
|
4
|
+
import { Quadtree } from '../../Quadtree';
|
|
5
|
+
import { LineSegment } from '../../LineSegment';
|
|
6
|
+
import { Point } from '../../Point';
|
|
7
7
|
import * as THREE from "three";
|
|
8
8
|
type ProjectionAnalysisResult = {
|
|
9
9
|
source: LineSegment;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Component } from '../../ComponentManager';
|
|
2
|
-
import { LineSegment } from '../../
|
|
2
|
+
import { LineSegment } from '../../LineSegment';
|
|
3
|
+
import { LineUserData } from '../type';
|
|
4
|
+
import { ArrayMap } from '../../Map';
|
|
3
5
|
/**
|
|
4
6
|
* 转为 三维家 墙体结构
|
|
5
7
|
*/
|
|
@@ -7,9 +9,31 @@ export declare class ThreeVJia extends Component<{
|
|
|
7
9
|
updateData: {};
|
|
8
10
|
}> {
|
|
9
11
|
static name: string;
|
|
10
|
-
lineSegments: LineSegment<
|
|
12
|
+
lineSegments: LineSegment<LineUserData>[];
|
|
13
|
+
neededUpdate: boolean;
|
|
14
|
+
/**
|
|
15
|
+
*/
|
|
11
16
|
onAddFromParent(): void;
|
|
17
|
+
/** 获取分组
|
|
18
|
+
* @param lines
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
getGroups(lines: LineSegment<LineUserData>[]): ArrayMap<string, LineSegment<Record<string, any>>> | null;
|
|
22
|
+
/** 更新
|
|
23
|
+
*/
|
|
12
24
|
updateData(): void;
|
|
25
|
+
/** 处理有分组
|
|
26
|
+
* @param map
|
|
27
|
+
*/
|
|
28
|
+
handleGroup(map: ArrayMap<string, LineSegment<LineUserData>>): void;
|
|
29
|
+
/**
|
|
30
|
+
* 角度纠正
|
|
31
|
+
*/
|
|
32
|
+
angleCorrection(): void;
|
|
33
|
+
/**
|
|
34
|
+
* 处理没有分组
|
|
35
|
+
*/
|
|
36
|
+
handle(): void;
|
|
13
37
|
toJson(): {
|
|
14
38
|
version: string;
|
|
15
39
|
name: string;
|
|
@@ -29,6 +53,7 @@ export declare class ThreeVJia extends Component<{
|
|
|
29
53
|
};
|
|
30
54
|
thickness: number;
|
|
31
55
|
type: string;
|
|
56
|
+
isDoor: boolean | undefined;
|
|
32
57
|
loadBearingWall: boolean;
|
|
33
58
|
height: number;
|
|
34
59
|
}[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
-
import { LineSegment } from '../../../../../
|
|
2
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
3
3
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
export declare class ClippingLine extends CommandFlowComponent<{
|
|
@@ -4,8 +4,8 @@ import { EventInput, Renderer } from '../../../RenderPlugin/components';
|
|
|
4
4
|
import { CommandManager } from '../../../../../CommandManager';
|
|
5
5
|
import { RenderManager } from '../RenderManager';
|
|
6
6
|
import { Default } from './Default';
|
|
7
|
-
import { LineSegment } from '../../../../../
|
|
8
|
-
import { Point } from '../../../../../
|
|
7
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
8
|
+
import { Point } from '../../../../../Point';
|
|
9
9
|
export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Component<TEventMap> {
|
|
10
10
|
private _renderer?;
|
|
11
11
|
get renderer(): Renderer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LineSegment } from '../../../../../
|
|
1
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
2
2
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
3
3
|
import { LineUserData } from '../../../../type';
|
|
4
4
|
import * as THREE from "three";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
-
import { LineSegment } from '../../../../../
|
|
2
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
3
3
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
4
4
|
import { LineUserData } from '../../../../type';
|
|
5
5
|
import * as THREE from "three";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
-
import { LineSegment } from '../../../../../
|
|
2
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
3
3
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
export declare class PointDrag extends CommandFlowComponent<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
2
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
|
-
import { LineSegment } from '../../../../../
|
|
3
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
/**
|
|
6
6
|
* 选择全部命令
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
2
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
|
-
import { LineSegment } from '../../../../../
|
|
4
|
-
import { Point } from '../../../../../
|
|
3
|
+
import { LineSegment } from '../../../../../LineSegment';
|
|
4
|
+
import { Point } from '../../../../../Point';
|
|
5
5
|
import { LineUserData } from '../../../../type';
|
|
6
6
|
import * as THREE from "three";
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { LineSegment } from '../../../../
|
|
1
|
+
import { LineSegment } from '../../../../LineSegment';
|
|
2
2
|
import { Component } from '../../../../ComponentManager';
|
|
3
3
|
import { Variable } from '../../../components/Variable';
|
|
4
4
|
import { EventInput, Renderer } from '../../RenderPlugin/components';
|
|
5
5
|
import { PointVirtualGrid } from '../../../../PointVirtualGrid';
|
|
6
6
|
import { Editor } from './Editor';
|
|
7
|
-
import { Quadtree } from '../../../../Quadtree
|
|
7
|
+
import { Quadtree } from '../../../../Quadtree';
|
|
8
8
|
import { DxfLineModel } from '../../ModelDataPlugin/components';
|
|
9
9
|
import { LineUserData, OriginalDataItem } from '../../../type';
|
|
10
10
|
import { Dxf } from '../../../components/Dxf';
|
|
@@ -1,12 +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';
|
|
7
4
|
import { Component } from '../../../../ComponentManager';
|
|
8
|
-
import { Point } from '../../../../
|
|
9
|
-
import { LineSegment } from '../../../../
|
|
5
|
+
import { Point } from '../../../../Point';
|
|
6
|
+
import { LineSegment } from '../../../../LineSegment';
|
|
10
7
|
import * as THREE from "three";
|
|
11
8
|
export interface RendererDescription {
|
|
12
9
|
canvas: HTMLCanvasElement;
|
|
@@ -53,9 +50,6 @@ export declare class Renderer extends Component<{
|
|
|
53
50
|
width: number;
|
|
54
51
|
height: number;
|
|
55
52
|
private tweenTaskList;
|
|
56
|
-
static loader: GLTFLoader;
|
|
57
|
-
static ktx2Loader: KTX2Loader;
|
|
58
|
-
static draco: DRACOLoader;
|
|
59
53
|
constructor(description: RendererDescription);
|
|
60
54
|
render(): void;
|
|
61
55
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { QuadtreeNode } from '../Quadtree
|
|
2
|
-
import { Point } from '../
|
|
3
|
-
import * as THREE from "three";
|
|
1
|
+
import { QuadtreeNode } from '../Quadtree';
|
|
2
|
+
import { Point } from '../Point';
|
|
4
3
|
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
4
|
export interface OriginalDataItem {
|
|
6
5
|
start: {
|
|
@@ -40,6 +39,7 @@ export interface OriginalDataItem {
|
|
|
40
39
|
isWindow?: boolean;
|
|
41
40
|
rooftopPz?: number;
|
|
42
41
|
isVerticalReferenceLine?: boolean;
|
|
42
|
+
groupId?: string;
|
|
43
43
|
drawWindow?: {
|
|
44
44
|
p: {
|
|
45
45
|
x: number;
|
|
@@ -57,12 +57,19 @@ export type LineUserData = {
|
|
|
57
57
|
isVerticalReferenceLine?: boolean;
|
|
58
58
|
wallWidth?: number;
|
|
59
59
|
rooftopPz?: number;
|
|
60
|
+
groupId?: string;
|
|
61
|
+
groupType?: string;
|
|
60
62
|
drawWindow?: {
|
|
61
|
-
p:
|
|
63
|
+
p: {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
z: number;
|
|
67
|
+
};
|
|
62
68
|
width: number;
|
|
63
69
|
full: boolean;
|
|
64
70
|
rooftopPz?: number;
|
|
65
71
|
}[];
|
|
72
|
+
sillHeight?: number;
|
|
66
73
|
drawDoorData?: any;
|
|
67
74
|
quadtreeNode?: QuadtreeNode;
|
|
68
75
|
};
|
|
@@ -114,6 +121,8 @@ export type AxisAlignmentCorrectionOption = {
|
|
|
114
121
|
* 吸附方式, 默认 adsorption
|
|
115
122
|
*/
|
|
116
123
|
adsorptionMethod?: "originalInterPoint" | "adsorption";
|
|
124
|
+
removeClosedLine?: boolean;
|
|
125
|
+
wallGroup?: boolean;
|
|
117
126
|
};
|
|
118
127
|
/**
|
|
119
128
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LineSegment } from '../../
|
|
2
|
-
import { Point } from '../../
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
|
+
import { Point } from '../../Point';
|
|
3
3
|
import { OriginalDataItem } from '../type';
|
|
4
4
|
export declare class BoundExt {
|
|
5
5
|
/** 通过轨迹点查找外墙
|
|
@@ -12,5 +12,5 @@ export declare class BoundExt {
|
|
|
12
12
|
* @param lines
|
|
13
13
|
* @param trajectoryPoints
|
|
14
14
|
*/
|
|
15
|
-
static boundExtbyTraj(data: OriginalDataItem[], trajectory: any, wallWidth?: number): OriginalDataItem[];
|
|
15
|
+
static boundExtbyTraj(data: OriginalDataItem[], trajectory: any, wallWidth?: number, findCallBack?: (lines: LineSegment[], trajectory: Point[]) => void): OriginalDataItem[];
|
|
16
16
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
|
+
import { LineUserData } from '../type';
|
|
3
|
+
export declare class DoubleWallHelper {
|
|
4
|
+
static errorAngle: number;
|
|
5
|
+
/** 线段投影分析
|
|
6
|
+
* @param index
|
|
7
|
+
* @param sourceLineSegment
|
|
8
|
+
* @param lineSegmentList
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
private static projectionAnalysis;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param lines
|
|
15
|
+
* @param wallWidth
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
static complementSide(lines: LineSegment<LineUserData>[], wallWidth?: number): LineSegment<LineUserData>[];
|
|
19
|
+
}
|
|
@@ -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 clippingLineUserData(line1: LineSegment<LineUserData>, line2: LineSegment<LineUserData>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LineSegment } from '../../
|
|
2
|
-
import { LineBasicMaterialParameters, PointsMaterialParameters } from 'three';
|
|
3
|
-
import { Point } from '../../
|
|
4
|
-
export declare function drawLines(lines: LineSegment[] | LineSegment | Point[], parameters?: LineBasicMaterialParameters, offset?: number):
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
|
+
import { LineBasicMaterialParameters, Object3D, PointsMaterialParameters } from 'three';
|
|
3
|
+
import { Point } from '../../Point';
|
|
4
|
+
export declare function drawLines(lines: LineSegment[] | LineSegment | Point[], parameters?: LineBasicMaterialParameters, offset?: number): Object3D<import('three').Object3DEventMap> | undefined;
|
|
5
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,22 @@
|
|
|
1
|
+
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
2
|
+
import { LineSegment } from '../../LineSegment';
|
|
3
|
+
/** 分组,通过路径
|
|
4
|
+
* @param lines
|
|
5
|
+
*/
|
|
6
|
+
export declare function groupByPath(lines: LineSegment[], grid?: PointVirtualGrid<LineSegment>): LineSegment<Record<string, any>>[][];
|
|
7
|
+
/** 移除非环线
|
|
8
|
+
* @param lines
|
|
9
|
+
*/
|
|
10
|
+
export declare function removeNotRingLine(lines: LineSegment[], removeLines?: Set<LineSegment<Record<string, any>>>, grid0?: PointVirtualGrid<LineSegment>): LineSegment<Record<string, any>>[][];
|
|
11
|
+
/** 查找线段组成的最大环
|
|
12
|
+
* @param lines
|
|
13
|
+
*/
|
|
14
|
+
export declare function findMaxRing(lines: LineSegment[], grid?: PointVirtualGrid<LineSegment>): LineSegment<Record<string, any>>[];
|
|
15
|
+
/**
|
|
16
|
+
* 从线段集合中提取所有闭合多边形
|
|
17
|
+
*/
|
|
18
|
+
export declare function findClosedPolygons(lines: LineSegment[]): {
|
|
19
|
+
removeLines: LineSegment<Record<string, any>>[];
|
|
20
|
+
groups: LineSegment<Record<string, any>>[][];
|
|
21
|
+
lines: LineSegment<Record<string, any>>[];
|
|
22
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LineSegment } from '../../LineSegment';
|
|
2
|
+
import { Point } from '../../Point';
|
|
3
|
+
/** 将线段路径转换为点路径
|
|
4
|
+
* @param lines
|
|
5
|
+
*/
|
|
6
|
+
export declare function linePathToPointPath(lines: LineSegment[]): Point<Record<string, any>>[];
|
|
7
|
+
/** 通过并查集,查找为环的一部分边
|
|
8
|
+
* @param lines
|
|
9
|
+
*/
|
|
10
|
+
export declare function findRingEdges(lines: LineSegment[]): LineSegment<Record<string, any>>[];
|
|
11
|
+
/** 根据已知环线查找环
|
|
12
|
+
* @param lines
|
|
13
|
+
*/
|
|
14
|
+
export declare function findRing(lines: LineSegment[], ringEdges: LineSegment[]): {
|
|
15
|
+
ringLines: LineSegment<Record<string, any>>[];
|
|
16
|
+
removeLines: Set<LineSegment<Record<string, any>>>;
|
|
17
|
+
ringList: LineSegment<Record<string, any>>[][];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 从线段集合中提取所有闭合多边形
|
|
21
|
+
*/
|
|
22
|
+
export declare function findClosedPolygons(lines: LineSegment[]): {
|
|
23
|
+
lines: LineSegment<Record<string, any>>[];
|
|
24
|
+
removeLines: LineSegment<Record<string, any>>[];
|
|
25
|
+
groups: LineSegment<Record<string, any>>[][];
|
|
26
|
+
ringLines: LineSegment<Record<string, any>>[];
|
|
27
|
+
};
|
|
@@ -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(lines: LineSegment[]): {
|
|
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
|
|
@@ -136,6 +137,7 @@ export declare class Point<T = Record<string, any>> {
|
|
|
136
137
|
* @param point
|
|
137
138
|
*/
|
|
138
139
|
distance(point: Point): number;
|
|
140
|
+
hashCode(fixed?: number): string;
|
|
139
141
|
/**
|
|
140
142
|
* 克隆
|
|
141
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
|
* 插入
|
|
@@ -86,5 +83,11 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
86
83
|
point: Point;
|
|
87
84
|
userData: T;
|
|
88
85
|
} | null;
|
|
86
|
+
/** 查找游离的点
|
|
87
|
+
*/
|
|
88
|
+
getFreePoint(): Target<T>[];
|
|
89
|
+
/** 查找第一个游离的点
|
|
90
|
+
*/
|
|
91
|
+
getFreePointFirst(): Target<T> | undefined;
|
|
89
92
|
}
|
|
90
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
|
+
}
|