build-dxf 0.0.20-24 → 0.0.20-26
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 +2 -0
- package/src/build.js +497 -487
- package/src/index.css +1 -1
- package/src/index3.js +853 -709
- package/src/selectLocalFile.js +3 -1
- package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +1 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +45 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +2 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection copy.d.ts +82 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +7 -18
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +1 -1
- package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +4 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +2 -0
- package/src/utils/PointVirtualGrid/index.d.ts +8 -0
package/src/selectLocalFile.js
CHANGED
|
@@ -29,6 +29,8 @@ class yn extends at {
|
|
|
29
29
|
container = new _.Group();
|
|
30
30
|
onUpdate;
|
|
31
31
|
onResize;
|
|
32
|
+
width = 0;
|
|
33
|
+
height = 0;
|
|
32
34
|
tweenTaskList = [];
|
|
33
35
|
constructor(t) {
|
|
34
36
|
super(), this.description = t;
|
|
@@ -43,7 +45,7 @@ class yn extends at {
|
|
|
43
45
|
const o = this.description.resizeObserver;
|
|
44
46
|
this.resizeObserver = new ResizeObserver(() => {
|
|
45
47
|
const i = this.camera, { width: s, height: l } = o.getBoundingClientRect();
|
|
46
|
-
this.renderer.setSize(s, l), this.html2DRenderer && this.html2DRenderer.setSize(s, l), this.html3DRenderer && this.html3DRenderer.setSize(s, l), this.orbitControls && (i instanceof _.PerspectiveCamera ? i.aspect = s / l : i instanceof _.OrthographicCamera && (i.left = -s * 0.5, i.right = s * 0.5, i.top = l * 0.5, i.bottom = -l * 0.5), i.updateProjectionMatrix()), this.onResize && this.onResize(s, l), this.dispatchEvent({ type: "resize", width: s, height: l });
|
|
48
|
+
this.renderer.setSize(s, l), this.html2DRenderer && this.html2DRenderer.setSize(s, l), this.html3DRenderer && this.html3DRenderer.setSize(s, l), this.orbitControls && (i instanceof _.PerspectiveCamera ? i.aspect = s / l : i instanceof _.OrthographicCamera && (i.left = -s * 0.5, i.right = s * 0.5, i.top = l * 0.5, i.bottom = -l * 0.5), i.updateProjectionMatrix()), this.width = s, this.height = l, this.onResize && this.onResize(s, l), this.dispatchEvent({ type: "resize", width: s, height: l });
|
|
47
49
|
}), this.resizeObserver.observe(o);
|
|
48
50
|
}
|
|
49
51
|
this.renderer.setAnimationLoop(() => {
|
|
@@ -198,7 +198,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
|
198
198
|
*
|
|
199
199
|
* @param type
|
|
200
200
|
*/
|
|
201
|
-
toDxfImageBlob(unit?: Unit, type?: string): Promise<any>;
|
|
201
|
+
toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
|
|
202
202
|
/**
|
|
203
203
|
* 将点json结构转换为Dxf string
|
|
204
204
|
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
+
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
3
|
+
import { ComponentManager } from '../../../../../ComponentManager';
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
export declare class ClippingLine extends CommandFlowComponent<{
|
|
6
|
+
pointerMove: {
|
|
7
|
+
point: THREE.Vector3;
|
|
8
|
+
};
|
|
9
|
+
}> {
|
|
10
|
+
static name: string;
|
|
11
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
12
|
+
shortcutKeys: string[];
|
|
13
|
+
commandName: string;
|
|
14
|
+
static commandName: string;
|
|
15
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
16
|
+
/** 选择开始点
|
|
17
|
+
* @param next
|
|
18
|
+
*/
|
|
19
|
+
selectPointStart(next: any): void;
|
|
20
|
+
/** 选择结束点
|
|
21
|
+
* @param next
|
|
22
|
+
*/
|
|
23
|
+
selectPointEnd(next: any, { point, line }: {
|
|
24
|
+
point: THREE.Vector3;
|
|
25
|
+
line: LineSegment;
|
|
26
|
+
}): void;
|
|
27
|
+
/**
|
|
28
|
+
* 结束处理
|
|
29
|
+
* @param next
|
|
30
|
+
* @param points
|
|
31
|
+
*/
|
|
32
|
+
private end;
|
|
33
|
+
/** 执行完成
|
|
34
|
+
*/
|
|
35
|
+
completed(data: any): void;
|
|
36
|
+
/** 回滚操作
|
|
37
|
+
* @param data
|
|
38
|
+
*/
|
|
39
|
+
private rollback;
|
|
40
|
+
/** 撤回回滚
|
|
41
|
+
* @param data
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
private revokeRollback;
|
|
45
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
2
|
-
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
3
|
-
import { LineUserData } from '../RenderManager';
|
|
4
2
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
5
3
|
import * as THREE from "three";
|
|
6
4
|
export declare class DrawDoorLine extends CommandFlowComponent<{
|
|
@@ -26,13 +24,13 @@ export declare class DrawDoorLine extends CommandFlowComponent<{
|
|
|
26
24
|
private end;
|
|
27
25
|
/** 执行完成
|
|
28
26
|
*/
|
|
29
|
-
completed(
|
|
27
|
+
completed(data: any[]): void;
|
|
30
28
|
/** 回滚操作
|
|
31
29
|
* @param data
|
|
32
30
|
*/
|
|
33
31
|
private rollback;
|
|
34
32
|
/** 撤回回滚
|
|
35
|
-
* @param
|
|
33
|
+
* @param data
|
|
36
34
|
* @returns
|
|
37
35
|
*/
|
|
38
36
|
private revokeRollback;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
+
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
|
+
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
4
|
+
import { Point } from '../../../../../Quadtree/Point';
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
/**
|
|
7
|
+
* 垂直纠正
|
|
8
|
+
*/
|
|
9
|
+
export declare class VerticalCorrection extends CommandFlowComponent<{}> {
|
|
10
|
+
static name: string;
|
|
11
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
12
|
+
shortcutKeys: string[];
|
|
13
|
+
shortcutKeys2: string[];
|
|
14
|
+
static commandName: string;
|
|
15
|
+
recursion: boolean;
|
|
16
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
17
|
+
/**
|
|
18
|
+
* 进入命令约束
|
|
19
|
+
*/
|
|
20
|
+
constraint(next: any, selectLines: LineSegment[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* 线段是否为结尾线段
|
|
23
|
+
* @param line
|
|
24
|
+
*/
|
|
25
|
+
lineIsPathEnd(line: LineSegment): boolean;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param line0
|
|
29
|
+
* @param line1
|
|
30
|
+
*/
|
|
31
|
+
isTowLineSegmentConnect(line0: LineSegment, line1: LineSegment): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 获取所有相同点的位置信息
|
|
34
|
+
* @param point
|
|
35
|
+
* @param point2
|
|
36
|
+
*/
|
|
37
|
+
getSamePointAll(point: Point, line: LineSegment): {
|
|
38
|
+
queryList: {
|
|
39
|
+
point: Point;
|
|
40
|
+
userData?: LineSegment<import('..').LineUserData> | undefined;
|
|
41
|
+
}[];
|
|
42
|
+
parallelList: {
|
|
43
|
+
point: Point;
|
|
44
|
+
userData?: LineSegment<import('..').LineUserData> | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param line
|
|
50
|
+
* @param point
|
|
51
|
+
* @param newPoint
|
|
52
|
+
*/
|
|
53
|
+
setLinePoint(line: LineSegment, newStartPoint?: Point, newEndPoint?: Point, mode?: "start" | "end" | "all", record?: any[]): void;
|
|
54
|
+
/** 修正2
|
|
55
|
+
* 第一步:确定需要修复的线段
|
|
56
|
+
* 第二步:查找与该线段相交的其他线段
|
|
57
|
+
* 第三步:找出两端点相交的线段,其他为区间相交
|
|
58
|
+
* 第四步:修正相交的线段的另一个端点
|
|
59
|
+
* 第五步:判断是否有方向一致的线段,有就调整,调整方法:查找连续平行的线段,求点在线段方向的投影,直到不平行的线段结束
|
|
60
|
+
* 第六步: 中间线段采用投影修正
|
|
61
|
+
* @param targettLine
|
|
62
|
+
* @param vistedList
|
|
63
|
+
*/
|
|
64
|
+
correction(targettLine: LineSegment, entryPoint?: Point, resultList?: any[], vistedList?: Set<LineSegment | Point>): any[] | undefined;
|
|
65
|
+
/** 开始
|
|
66
|
+
* @param next
|
|
67
|
+
*/
|
|
68
|
+
verticalCorrection(next: any, selectLines: LineSegment[]): void;
|
|
69
|
+
/** 执行完成
|
|
70
|
+
* @param data
|
|
71
|
+
*/
|
|
72
|
+
private completed;
|
|
73
|
+
/** 回滚操作
|
|
74
|
+
* @param data
|
|
75
|
+
*/
|
|
76
|
+
private rollback;
|
|
77
|
+
/** 撤回回滚
|
|
78
|
+
* @param lines
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
private revokeRollback;
|
|
82
|
+
}
|
|
@@ -29,28 +29,17 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
|
|
|
29
29
|
* @param line1
|
|
30
30
|
*/
|
|
31
31
|
isTowLineSegmentConnect(line0: LineSegment, line1: LineSegment): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 获取所有相同点的位置信息
|
|
34
|
-
* @param point
|
|
35
|
-
* @param point2
|
|
36
|
-
*/
|
|
37
|
-
getSamePointAll(point: Point, line: LineSegment): {
|
|
38
|
-
queryList: {
|
|
39
|
-
point: Point;
|
|
40
|
-
userData?: LineSegment<import('..').LineUserData> | undefined;
|
|
41
|
-
}[];
|
|
42
|
-
parallelList: {
|
|
43
|
-
point: Point;
|
|
44
|
-
userData?: LineSegment<import('..').LineUserData> | undefined;
|
|
45
|
-
}[];
|
|
46
|
-
};
|
|
47
32
|
/**
|
|
48
33
|
*
|
|
49
34
|
* @param line
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
35
|
+
* @param newStartPoint
|
|
36
|
+
* @param newEndPoint
|
|
37
|
+
* @param mode 需要匹配的点
|
|
38
|
+
* @param record
|
|
39
|
+
* @param id
|
|
40
|
+
* @returns
|
|
52
41
|
*/
|
|
53
|
-
|
|
42
|
+
setLinePoint(line: LineSegment, newStartPoint: Point, newEndPoint: Point, mode?: "start" | "end" | "all" | "none", resultList?: any[], id?: string): any[];
|
|
54
43
|
/** 修正2
|
|
55
44
|
* 第一步:确定需要修复的线段
|
|
56
45
|
* 第二步:查找与该线段相交的其他线段
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
2
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 设置y轴垂直基准线段
|
|
5
5
|
*/
|
|
6
6
|
export declare class VerticalReferenceLine extends CommandFlowComponent<{}> {
|
|
7
7
|
static name: string;
|
|
@@ -5,6 +5,7 @@ import { DomContainer, DomEventRegister, EventInput, Renderer } from '../../Rend
|
|
|
5
5
|
import { RenderManager } from './RenderManager';
|
|
6
6
|
import { CommandManager } from '../../../../CommandManager';
|
|
7
7
|
import { App } from 'vue';
|
|
8
|
+
import { DxfSystem } from '../../../../../build';
|
|
8
9
|
import * as THREE from "three";
|
|
9
10
|
export declare class Editor extends Component<{
|
|
10
11
|
pointerPositionChange: {
|
|
@@ -26,8 +27,10 @@ export declare class Editor extends Component<{
|
|
|
26
27
|
app?: App<Element>;
|
|
27
28
|
domElement: HTMLDivElement;
|
|
28
29
|
viewPermission?: "admin";
|
|
30
|
+
imgEl: HTMLImageElement;
|
|
31
|
+
imgWidth: number;
|
|
29
32
|
constructor(viewPermission?: "admin");
|
|
30
|
-
onAddFromParent(): void;
|
|
33
|
+
onAddFromParent(parent: DxfSystem): void;
|
|
31
34
|
/**
|
|
32
35
|
* 取消命令,由其他命令组件监听事件后注册事件监听实现
|
|
33
36
|
*/
|
|
@@ -46,6 +46,8 @@ export declare class Renderer extends Component<{
|
|
|
46
46
|
container: THREE.Group<THREE.Object3DEventMap>;
|
|
47
47
|
onUpdate?: () => void;
|
|
48
48
|
onResize?: (width: number, height: number) => void;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
49
51
|
private tweenTaskList;
|
|
50
52
|
constructor(description: RendererDescription);
|
|
51
53
|
/**
|