build-dxf 0.0.23 → 0.0.24
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 +1313 -1055
- package/src/index.css +1 -1
- package/src/index3.js +687 -828
- package/src/utils/DxfSystem/components/Dxf.d.ts +39 -13
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +2 -16
- package/src/utils/Quadtree/LineSegment.d.ts +12 -0
|
@@ -2,6 +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, QuadtreeNode } from '../../Quadtree/Quadtree';
|
|
6
|
+
import * as THREE from "three";
|
|
5
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";
|
|
6
8
|
export interface OriginalDataItem {
|
|
7
9
|
start: {
|
|
@@ -50,6 +52,20 @@ export interface OriginalDataItem {
|
|
|
50
52
|
full: boolean;
|
|
51
53
|
}[];
|
|
52
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
|
+
};
|
|
53
69
|
/**
|
|
54
70
|
* [开始点, 结束点, 相交点, 是否是门, 索引]
|
|
55
71
|
*/
|
|
@@ -101,12 +117,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
101
117
|
wallsGroup: Point[][];
|
|
102
118
|
doors: DataItem[];
|
|
103
119
|
doorLineSegment: LineSegment[];
|
|
104
|
-
lineSegments: LineSegment<
|
|
105
|
-
isDoor: boolean;
|
|
106
|
-
isWindow: boolean;
|
|
107
|
-
drawDoorData: any;
|
|
108
|
-
drawWindow: any[];
|
|
109
|
-
}>[];
|
|
120
|
+
lineSegments: LineSegment<LineUserData>[];
|
|
110
121
|
originalZAverage: number;
|
|
111
122
|
static EndType: {
|
|
112
123
|
etOpenSquare: number;
|
|
@@ -120,25 +131,31 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
120
131
|
};
|
|
121
132
|
/** 原始数据组
|
|
122
133
|
*/
|
|
123
|
-
get lines(): LineSegment<
|
|
124
|
-
isDoor: boolean;
|
|
125
|
-
isWindow: boolean;
|
|
126
|
-
drawDoorData: any;
|
|
127
|
-
drawWindow: any[];
|
|
128
|
-
}>[];
|
|
134
|
+
get lines(): LineSegment<LineUserData>[];
|
|
129
135
|
/**初始化
|
|
130
136
|
* @param data 点云数据
|
|
131
137
|
* @param width 墙体宽度
|
|
132
138
|
* @param scale 缩放比例
|
|
133
139
|
*/
|
|
134
140
|
constructor(width?: number, scale?: number);
|
|
141
|
+
/**
|
|
142
|
+
* 预处理数据
|
|
143
|
+
* @param data
|
|
144
|
+
*/
|
|
145
|
+
preprocessing(data: OriginalDataItem[], axisAlignmentCorrection?: boolean): {
|
|
146
|
+
lineSegments: LineSegment<Record<string, any>>[];
|
|
147
|
+
data: OriginalDataItem[];
|
|
148
|
+
} | {
|
|
149
|
+
lineSegments: LineSegment<LineUserData>[];
|
|
150
|
+
data: OriginalDataItem[];
|
|
151
|
+
};
|
|
135
152
|
/**
|
|
136
153
|
* 设置
|
|
137
154
|
* @param data
|
|
138
155
|
* @param width
|
|
139
156
|
* @param scale
|
|
140
157
|
*/
|
|
141
|
-
set(data: OriginalDataItem[] | string, width?: number, scale?: number): Promise<any>;
|
|
158
|
+
set(data: OriginalDataItem[] | string, width?: number, scale?: number, axisAlignmentCorrection?: boolean): Promise<any>;
|
|
142
159
|
/** 创建分组
|
|
143
160
|
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
144
161
|
* @returns
|
|
@@ -191,6 +208,10 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
191
208
|
* @returns
|
|
192
209
|
*/
|
|
193
210
|
private getArcAngleRange;
|
|
211
|
+
/**
|
|
212
|
+
* 线段数据转为原始json数据
|
|
213
|
+
*/
|
|
214
|
+
lineDataToOriginalData(lines: LineSegment<LineUserData>[], quadtree?: Quadtree): OriginalDataItem[];
|
|
194
215
|
/**
|
|
195
216
|
* 转为绘制数据
|
|
196
217
|
*/
|
|
@@ -209,6 +230,11 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
209
230
|
* @returns
|
|
210
231
|
*/
|
|
211
232
|
toDxfBlob(unit?: Unit): Blob;
|
|
233
|
+
/**
|
|
234
|
+
* 下载原始json
|
|
235
|
+
* @param filename
|
|
236
|
+
*/
|
|
237
|
+
downloadOriginalData(filename: string): Promise<void>;
|
|
212
238
|
/**
|
|
213
239
|
* 下载
|
|
214
240
|
* @param filename
|
|
@@ -56,7 +56,7 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
|
|
|
56
56
|
*/
|
|
57
57
|
axisAlignmentCorrection(targettLine: LineSegment): {
|
|
58
58
|
newLines: LineSegment<Record<string, any>>[];
|
|
59
|
-
oldLines: LineSegment<LineUserData>[];
|
|
59
|
+
oldLines: LineSegment<import('../../../../components/Dxf').LineUserData>[];
|
|
60
60
|
};
|
|
61
61
|
/** 开始
|
|
62
62
|
* @param next
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
import { LineSegment } from '../../../../Quadtree/LineSegment';
|
|
2
2
|
import { Component } from '../../../../ComponentManager';
|
|
3
|
-
import { Dxf, OriginalDataItem } from '../../../components/Dxf';
|
|
3
|
+
import { Dxf, LineUserData, OriginalDataItem } from '../../../components/Dxf';
|
|
4
4
|
import { Variable } from '../../../components/Variable';
|
|
5
5
|
import { EventInput, Renderer } from '../../RenderPlugin/components';
|
|
6
6
|
import { PointVirtualGrid } from '../../../../PointVirtualGrid';
|
|
7
7
|
import { Editor } from './Editor';
|
|
8
|
-
import { Quadtree
|
|
8
|
+
import { Quadtree } from '../../../../Quadtree/Quadtree';
|
|
9
9
|
import { DxfLineModel } from '../../ModelDataPlugin/components';
|
|
10
10
|
import * as THREE from "three";
|
|
11
|
-
export type LineUserData = {
|
|
12
|
-
doorDirectConnection?: boolean;
|
|
13
|
-
isDoor?: boolean;
|
|
14
|
-
isWindow?: boolean;
|
|
15
|
-
isVerticalReferenceLine?: boolean;
|
|
16
|
-
wallWidth?: number;
|
|
17
|
-
drawWindow?: {
|
|
18
|
-
p: THREE.Vector3;
|
|
19
|
-
width: number;
|
|
20
|
-
full: boolean;
|
|
21
|
-
}[];
|
|
22
|
-
drawDoorData?: any;
|
|
23
|
-
quadtreeNode?: QuadtreeNode;
|
|
24
|
-
};
|
|
25
11
|
export declare class RenderManager extends Component<{}> {
|
|
26
12
|
static name: string;
|
|
27
13
|
container: THREE.Group<THREE.Object3DEventMap>;
|
|
@@ -145,4 +145,16 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
145
145
|
*/
|
|
146
146
|
areLinesCoincident(line: LineSegment): boolean;
|
|
147
147
|
clone(): LineSegment<T>;
|
|
148
|
+
/**
|
|
149
|
+
* 轴对齐垂直修正
|
|
150
|
+
* @param lines 待调整线段组
|
|
151
|
+
* @param targettLine 轴线段
|
|
152
|
+
* @returns
|
|
153
|
+
*/
|
|
154
|
+
static axisAlignmentCorrection(lines: LineSegment[], targettLine: LineSegment): LineSegment<Record<string, any>>[];
|
|
155
|
+
/**
|
|
156
|
+
* 获取最长线段
|
|
157
|
+
* @param lines
|
|
158
|
+
*/
|
|
159
|
+
static maxLengthLineIndex(lines: LineSegment[]): number;
|
|
148
160
|
}
|