build-dxf 0.0.10 → 0.0.11
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 +14 -5
- package/src/App.vue.d.ts +2 -0
- package/src/build.d.ts +3 -0
- package/src/build.js +10 -8
- package/src/components/Card.vue.d.ts +9 -0
- package/src/index.js +3 -2
- package/src/index2.js +6 -0
- package/src/main.d.ts +0 -0
- package/src/pages/Dxf.vue.d.ts +2 -0
- package/src/router/index.d.ts +2 -0
- package/src/utils/ComponentManager/Component.d.ts +17 -0
- package/src/utils/ComponentManager/ComponentManager.d.ts +47 -0
- package/src/utils/ComponentManager/EventDispatcher.d.ts +4 -0
- package/src/utils/ComponentManager/index.d.ts +4 -0
- package/src/utils/ComponentManager/uuid.d.ts +1 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +150 -0
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +85 -0
- package/src/utils/DxfSystem/components/Variable.d.ts +33 -0
- package/src/utils/DxfSystem/index.d.ts +16 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/DetailsPoint.d.ts +39 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/DxfLineModel.d.ts +10 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/WhiteModel.d.ts +21 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/index.d.ts +3 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/index.d.ts +4 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DetailsPointRender.d.ts +48 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DomContainer.d.ts +8 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DomEventRegister.d.ts +23 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/ModelDataRender.d.ts +13 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/OriginalLineRender.d.ts +16 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +82 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/index.d.ts +6 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +5 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/pages/Dxf.vue.d.ts +21 -0
- package/src/utils/DxfSystem/plugin/index.d.ts +1 -0
- package/src/utils/Lines.d.ts +11 -0
- package/src/utils/PointVirtualGrid/index.d.ts +70 -0
- package/src/utils/Quadtree/Box2.d.ts +89 -0
- package/src/utils/Quadtree/LineSegment.d.ts +29 -0
- package/src/utils/Quadtree/Point.d.ts +113 -0
- package/src/utils/Quadtree/Quadtree.d.ts +60 -0
- package/src/utils/Quadtree/Rectangle.d.ts +40 -0
- package/src/utils/drawLinePathToPng.d.ts +7 -0
- package/src/utils/selectLocalFile.d.ts +7 -0
- package/src/index.d.ts +0 -605
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-dxf",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "线段构建双线墙壁的dxf版本",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
".": {
|
|
12
12
|
"import": {
|
|
13
13
|
"types": "./src/index.d.ts",
|
|
14
|
-
"default": "./src/index.js"
|
|
14
|
+
"default": "./src/index.js",
|
|
15
|
+
"style": "./src/index.css"
|
|
15
16
|
},
|
|
16
17
|
"require": {
|
|
17
18
|
"types": "./src/index.d.ts",
|
|
@@ -19,10 +20,18 @@
|
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
"./RenderPlugin": {
|
|
22
|
-
"import":
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts",
|
|
25
|
+
"default": "./src/index2.js"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./src/index.d.ts",
|
|
29
|
+
"default": "./src/index2.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./index.css": "./src/index.css"
|
|
25
33
|
},
|
|
34
|
+
"style": "src/index.css",
|
|
26
35
|
"dependencies": {
|
|
27
36
|
"clipper-lib": ">=6.4.2",
|
|
28
37
|
"dxf-writer": ">=1.18.4",
|
package/src/App.vue.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
package/src/build.d.ts
ADDED
package/src/build.js
CHANGED
|
@@ -702,6 +702,7 @@ const units = {
|
|
|
702
702
|
// 秒差距,1米 ≈ 0.00000000000000003240779289666404秒差距
|
|
703
703
|
};
|
|
704
704
|
class Dxf extends Component {
|
|
705
|
+
static name = "Dxf";
|
|
705
706
|
width = 0.04;
|
|
706
707
|
scale = 1;
|
|
707
708
|
originalData = [];
|
|
@@ -1037,6 +1038,7 @@ class Dxf extends Component {
|
|
|
1037
1038
|
}
|
|
1038
1039
|
}
|
|
1039
1040
|
class Variable extends Component {
|
|
1041
|
+
static name = "Variable";
|
|
1040
1042
|
originalLineVisible = true;
|
|
1041
1043
|
dxfVisible = true;
|
|
1042
1044
|
whiteModelVisible = true;
|
|
@@ -1532,6 +1534,7 @@ class PointVirtualGrid {
|
|
|
1532
1534
|
}
|
|
1533
1535
|
}
|
|
1534
1536
|
class LineAnalysis extends Component {
|
|
1537
|
+
static name = "LineAnalysis";
|
|
1535
1538
|
Dxf = null;
|
|
1536
1539
|
Variable = null;
|
|
1537
1540
|
lineSegmentList = [];
|
|
@@ -1544,8 +1547,9 @@ class LineAnalysis extends Component {
|
|
|
1544
1547
|
* @param parent
|
|
1545
1548
|
*/
|
|
1546
1549
|
onAddFromParent(parent) {
|
|
1547
|
-
this.Dxf = parent.
|
|
1548
|
-
this.Variable = this.parent?.
|
|
1550
|
+
this.Dxf = parent.findComponentByType(Dxf);
|
|
1551
|
+
this.Variable = this.parent?.findComponentByType(Variable);
|
|
1552
|
+
console.log(this.Dxf);
|
|
1549
1553
|
this.Dxf.addEventListener("setDta", this.lineAnalysis.bind(this));
|
|
1550
1554
|
this.Dxf.addEventListener("lineOffset", this.duplicatePointFiltering.bind(this));
|
|
1551
1555
|
}
|
|
@@ -1777,6 +1781,7 @@ function lineSqueezing(p1, p2, width = 0.1) {
|
|
|
1777
1781
|
};
|
|
1778
1782
|
}
|
|
1779
1783
|
class WhiteModel extends Component {
|
|
1784
|
+
static name = "WhiteModel";
|
|
1780
1785
|
Dxf = null;
|
|
1781
1786
|
Variable = null;
|
|
1782
1787
|
// dxf数据白模
|
|
@@ -1875,6 +1880,7 @@ class WhiteModel extends Component {
|
|
|
1875
1880
|
}
|
|
1876
1881
|
}
|
|
1877
1882
|
class DetailsPoint extends Component {
|
|
1883
|
+
static name = "DetailsPoint";
|
|
1878
1884
|
Dxf = null;
|
|
1879
1885
|
WhiteModel = null;
|
|
1880
1886
|
Variable = null;
|
|
@@ -1969,6 +1975,7 @@ class DetailsPoint extends Component {
|
|
|
1969
1975
|
}
|
|
1970
1976
|
}
|
|
1971
1977
|
class DxfLineModel extends Component {
|
|
1978
|
+
static name = "DxfLineModel";
|
|
1972
1979
|
dxfLineModel = new THREE.LineSegments();
|
|
1973
1980
|
dxfDoorsLineModel = new THREE.LineSegments();
|
|
1974
1981
|
dxfModelGroup = new THREE.Group();
|
|
@@ -1989,7 +1996,7 @@ class DxfLineModel extends Component {
|
|
|
1989
1996
|
this.dxfDoorsLineModel.geometry = new THREE.BufferGeometry().setAttribute("position", new THREE.BufferAttribute(doorsArray, 3, true)).setAttribute("color", new THREE.BufferAttribute(doorsColorArray, 3));
|
|
1990
1997
|
}
|
|
1991
1998
|
}
|
|
1992
|
-
const index
|
|
1999
|
+
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1993
2000
|
__proto__: null,
|
|
1994
2001
|
DetailsPoint,
|
|
1995
2002
|
DxfLineModel,
|
|
@@ -2000,11 +2007,6 @@ function ModelDataPlugin(dxfSystem) {
|
|
|
2000
2007
|
dxfSystem.addComponent(new WhiteModel());
|
|
2001
2008
|
dxfSystem.addComponent(new DetailsPoint());
|
|
2002
2009
|
}
|
|
2003
|
-
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2004
|
-
__proto__: null,
|
|
2005
|
-
ModelDataPlugin,
|
|
2006
|
-
components: index$1
|
|
2007
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2008
2010
|
function loadRenderPlugin() {
|
|
2009
2011
|
return import("./index2.js");
|
|
2010
2012
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
message: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
look: (...args: any[]) => void;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
onLook?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
|
+
export default _default;
|
package/src/index.js
CHANGED
package/src/index2.js
CHANGED
|
@@ -3342,6 +3342,7 @@ THREE.BufferGeometry.prototype.computeBoundsTree = computeBoundsTree;
|
|
|
3342
3342
|
THREE.BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree;
|
|
3343
3343
|
THREE.Mesh.prototype.raycast = acceleratedRaycast;
|
|
3344
3344
|
class Renderer extends Component {
|
|
3345
|
+
static name = "Renderer";
|
|
3345
3346
|
static CSS2DObject = CSS2DObject;
|
|
3346
3347
|
static CSS3DObject = CSS3DObject;
|
|
3347
3348
|
static CSS3DSprite = CSS3DSprite;
|
|
@@ -6782,6 +6783,7 @@ class Lines extends THREE.LineSegments {
|
|
|
6782
6783
|
}
|
|
6783
6784
|
const DES_POINT_DEFAULT_COLOR = "radial-gradient(circle at center, rgba(0,0,0, 1), transparent, rgba(0,0,0, 1))", DES_POINT_LINE_COLOR = "#409eff", DES_POINT_ACTIVE_COLOR = `radial-gradient(circle at center, ${DES_POINT_LINE_COLOR}, transparent, ${DES_POINT_LINE_COLOR})`;
|
|
6784
6785
|
class DetailsPointRender extends Component {
|
|
6786
|
+
static name = "DetailsPointRender";
|
|
6785
6787
|
Dxf = null;
|
|
6786
6788
|
Renderer = null;
|
|
6787
6789
|
WhiteModel = null;
|
|
@@ -6979,6 +6981,7 @@ class DetailsPointRender extends Component {
|
|
|
6979
6981
|
}
|
|
6980
6982
|
}
|
|
6981
6983
|
class DomContainer extends Component {
|
|
6984
|
+
static name = "DomContainer";
|
|
6982
6985
|
domElement = document.createElement("div");
|
|
6983
6986
|
canvas = document.createElement("canvas");
|
|
6984
6987
|
html2DRenderer = document.createElement("div");
|
|
@@ -7002,6 +7005,7 @@ class DomContainer extends Component {
|
|
|
7002
7005
|
}
|
|
7003
7006
|
}
|
|
7004
7007
|
class OriginalLineRender extends Component {
|
|
7008
|
+
static name = "OriginalLineRender";
|
|
7005
7009
|
Dxf = null;
|
|
7006
7010
|
Renderer = null;
|
|
7007
7011
|
originalLineMode = new THREE.LineSegments();
|
|
@@ -7096,6 +7100,7 @@ class OriginalLineRender extends Component {
|
|
|
7096
7100
|
}
|
|
7097
7101
|
}
|
|
7098
7102
|
class ModelDataRender extends Component {
|
|
7103
|
+
static name = "ModelDataRender";
|
|
7099
7104
|
onAddFromParent(parent) {
|
|
7100
7105
|
this.dxf(parent);
|
|
7101
7106
|
this.whiteModel(parent);
|
|
@@ -7124,6 +7129,7 @@ class ModelDataRender extends Component {
|
|
|
7124
7129
|
}
|
|
7125
7130
|
}
|
|
7126
7131
|
class DomEventRegister extends Component {
|
|
7132
|
+
static name = "DomEventRegister";
|
|
7127
7133
|
/**
|
|
7128
7134
|
*
|
|
7129
7135
|
* @param parent
|
package/src/main.d.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentManager } from './ComponentManager';
|
|
2
|
+
import { EventDispatcher } from './EventDispatcher';
|
|
3
|
+
export declare class Component<TEventMap extends {} = {}> extends EventDispatcher<{
|
|
4
|
+
addFromParent: {
|
|
5
|
+
parent: ComponentManager;
|
|
6
|
+
};
|
|
7
|
+
removeFromParent: {
|
|
8
|
+
parent: ComponentManager;
|
|
9
|
+
};
|
|
10
|
+
update: {};
|
|
11
|
+
} & TEventMap> {
|
|
12
|
+
parent?: ComponentManager;
|
|
13
|
+
constructor(...arg: any[]);
|
|
14
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
15
|
+
onRemoveFromParent(parent: ComponentManager): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Component } from './Component';
|
|
2
|
+
import { EventDispatcher } from './EventDispatcher';
|
|
3
|
+
interface EventTypeMap {
|
|
4
|
+
addComponent: {
|
|
5
|
+
component: Component;
|
|
6
|
+
};
|
|
7
|
+
removeComponent: {
|
|
8
|
+
component: Component;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare class ComponentManager<TEventMap extends {} = {}> extends EventDispatcher<TEventMap & EventTypeMap> {
|
|
12
|
+
static readonly EventType: {
|
|
13
|
+
ADD_COMPONENT: string;
|
|
14
|
+
};
|
|
15
|
+
components: Component[];
|
|
16
|
+
/**
|
|
17
|
+
* 添加组件
|
|
18
|
+
* @param component
|
|
19
|
+
*/
|
|
20
|
+
addComponent(component: Component): this;
|
|
21
|
+
/**
|
|
22
|
+
* 移除组件
|
|
23
|
+
* @param component
|
|
24
|
+
*/
|
|
25
|
+
removeComponent(component: Component): void;
|
|
26
|
+
/**
|
|
27
|
+
* 查找符合条件的第一个组件
|
|
28
|
+
* @param callBack
|
|
29
|
+
*/
|
|
30
|
+
findComponent(predicate: (component: Component, index: number) => boolean): Component<{}> | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* 查找所有符合条件的组件
|
|
33
|
+
* @param callBack
|
|
34
|
+
*/
|
|
35
|
+
findComponents(predicate: (component: Component, index: number) => boolean): Component<{}> | undefined;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param type
|
|
39
|
+
*/
|
|
40
|
+
findComponentByType<T extends typeof Component>(type: T): InstanceType<T> | null;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param type
|
|
44
|
+
*/
|
|
45
|
+
findComponentByName(name: string): Component<{}> | null;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uuid(): string;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Component } from '../../ComponentManager';
|
|
2
|
+
import { Point } from '../../Quadtree/Point';
|
|
3
|
+
import { Box2 } from '../../Quadtree/Box2';
|
|
4
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
5
|
+
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
|
+
export interface OriginalDataItem {
|
|
7
|
+
start: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
z: number;
|
|
11
|
+
};
|
|
12
|
+
end: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
z: number;
|
|
16
|
+
};
|
|
17
|
+
insetionArr: {
|
|
18
|
+
index: number;
|
|
19
|
+
p: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
z: number;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
isDoor?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* [开始点, 结束点, 相交点, 是否是门, 索引]
|
|
29
|
+
*/
|
|
30
|
+
export type DataItem = [Point, Point, number[], boolean, number];
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export interface PointGroup {
|
|
35
|
+
points: Point[];
|
|
36
|
+
indices: number[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 将点云结构转换为DXF格式
|
|
40
|
+
*/
|
|
41
|
+
export declare class Dxf extends Component<{
|
|
42
|
+
setDta: {
|
|
43
|
+
originalData: OriginalDataItem[];
|
|
44
|
+
data: DataItem[];
|
|
45
|
+
};
|
|
46
|
+
lineOffset: {
|
|
47
|
+
wallsGroup: Point[][];
|
|
48
|
+
};
|
|
49
|
+
createGroup: {
|
|
50
|
+
groups: Point[][][];
|
|
51
|
+
};
|
|
52
|
+
}> {
|
|
53
|
+
static name: string;
|
|
54
|
+
width: number;
|
|
55
|
+
scale: number;
|
|
56
|
+
originalData: OriginalDataItem[];
|
|
57
|
+
data: DataItem[];
|
|
58
|
+
originalBox: Box2;
|
|
59
|
+
box: Box2;
|
|
60
|
+
pointsGroups: Point[][][];
|
|
61
|
+
wallsGroup: Point[][];
|
|
62
|
+
doors: DataItem[];
|
|
63
|
+
lineSegments: LineSegment<{
|
|
64
|
+
isDoor: boolean;
|
|
65
|
+
}>[];
|
|
66
|
+
originalZAverage: number;
|
|
67
|
+
static EndType: {
|
|
68
|
+
etOpenSquare: number;
|
|
69
|
+
etOpenRound: number;
|
|
70
|
+
etOpenButt: number;
|
|
71
|
+
};
|
|
72
|
+
static JoinType: {
|
|
73
|
+
jtSquare: number;
|
|
74
|
+
jtRound: number;
|
|
75
|
+
jtMiter: number;
|
|
76
|
+
};
|
|
77
|
+
/** 原始数据组
|
|
78
|
+
*/
|
|
79
|
+
get lines(): LineSegment<{
|
|
80
|
+
isDoor: boolean;
|
|
81
|
+
}>[];
|
|
82
|
+
/**初始化
|
|
83
|
+
* @param data 点云数据
|
|
84
|
+
* @param width 墙体宽度
|
|
85
|
+
* @param scale 缩放比例
|
|
86
|
+
*/
|
|
87
|
+
constructor(width?: number, scale?: number);
|
|
88
|
+
/**
|
|
89
|
+
* 设置
|
|
90
|
+
* @param data
|
|
91
|
+
* @param width
|
|
92
|
+
* @param scale
|
|
93
|
+
*/
|
|
94
|
+
set(data: OriginalDataItem[] | string, width?: number, scale?: number): Promise<any>;
|
|
95
|
+
/** 创建分组
|
|
96
|
+
* @description 根据相交数组insetionArr, 把相交的线段,划分到一组内,方便后续路径查找合并使用
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
private createGroups;
|
|
100
|
+
/** 计算当前墙体数据的边界框
|
|
101
|
+
* @description 根据分组数据pointsGroups,计算包围盒, pointsGroups数据为缩放后数据。
|
|
102
|
+
* @description 可通过box属性查看计算结果。
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
computedSize(): Box2;
|
|
106
|
+
/** 线路拓扑
|
|
107
|
+
* @description 处理线路拓扑,使线路有序链接,形成长路径
|
|
108
|
+
* @param lines
|
|
109
|
+
*/
|
|
110
|
+
private lineTopology;
|
|
111
|
+
/** etOpenRound 去除毛刺
|
|
112
|
+
* @description 检查连续的短线段数量,去除合并后产生的毛刺
|
|
113
|
+
*/
|
|
114
|
+
private squareRemoveBurr;
|
|
115
|
+
/** 线偏移
|
|
116
|
+
* @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
|
|
117
|
+
*/
|
|
118
|
+
lineOffset(endType?: number, joinType?: number, scale?: number): Point[][];
|
|
119
|
+
/**
|
|
120
|
+
* 将点云结构转换为Float32Array
|
|
121
|
+
*/
|
|
122
|
+
to3DArray(scale: number): Float32Array<ArrayBuffer>;
|
|
123
|
+
/**
|
|
124
|
+
* 将点云结构转换为string
|
|
125
|
+
*/
|
|
126
|
+
toDxfString(unit?: Unit): string;
|
|
127
|
+
/**
|
|
128
|
+
* 将点云结构转换为DXF格式
|
|
129
|
+
* @returns
|
|
130
|
+
*/
|
|
131
|
+
toDxfBlob(unit?: Unit): Blob;
|
|
132
|
+
/**
|
|
133
|
+
* 下载
|
|
134
|
+
* @param filename
|
|
135
|
+
*/
|
|
136
|
+
download(filename: string, unit?: Unit): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* 计算原始数据的边界框
|
|
139
|
+
* @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
private computedOriginalSize;
|
|
143
|
+
/**
|
|
144
|
+
* 创建数据
|
|
145
|
+
* @param pointsGroups
|
|
146
|
+
* @returns
|
|
147
|
+
*/
|
|
148
|
+
static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
|
|
149
|
+
}
|
|
150
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Component, ComponentManager } from '../../ComponentManager';
|
|
2
|
+
import { Dxf } from './Dxf';
|
|
3
|
+
import { Variable } from './Variable';
|
|
4
|
+
import { Quadtree } from '../../Quadtree/Quadtree';
|
|
5
|
+
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
6
|
+
import { Point } from '../../Quadtree/Point';
|
|
7
|
+
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
8
|
+
import * as THREE from "three";
|
|
9
|
+
type ProjectionAnalysisResult = {
|
|
10
|
+
source: LineSegment;
|
|
11
|
+
sourceIndex: number;
|
|
12
|
+
target: LineSegment;
|
|
13
|
+
targetIndex: number;
|
|
14
|
+
project: LineSegment;
|
|
15
|
+
project2: LineSegment;
|
|
16
|
+
};
|
|
17
|
+
export declare class LineAnalysis extends Component {
|
|
18
|
+
static name: string;
|
|
19
|
+
Dxf: Dxf | null;
|
|
20
|
+
Variable: Variable | null;
|
|
21
|
+
lineSegmentList: LineSegment[];
|
|
22
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
23
|
+
errorAngle: number;
|
|
24
|
+
width: number;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param parent
|
|
28
|
+
*/
|
|
29
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
30
|
+
/**
|
|
31
|
+
* 去除路径上重复的点
|
|
32
|
+
* @description 判断方向向量,一个连续的方向上,只应该出现两个点
|
|
33
|
+
*/
|
|
34
|
+
duplicatePointFiltering(): void;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param p1
|
|
38
|
+
* @param p2
|
|
39
|
+
* @param width
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
expandLineSegment(p1: Point, p2: Point, width?: number): {
|
|
43
|
+
points: Point[];
|
|
44
|
+
indices: number[];
|
|
45
|
+
rectIndices: number[];
|
|
46
|
+
};
|
|
47
|
+
appendLineSegmentList: LineSegment[];
|
|
48
|
+
/**
|
|
49
|
+
* 追加数据
|
|
50
|
+
* @param p1
|
|
51
|
+
* @param p2
|
|
52
|
+
*/
|
|
53
|
+
addData(p1: Point, p2: Point): void;
|
|
54
|
+
/** 结果分析创建矩形
|
|
55
|
+
* @param result
|
|
56
|
+
*/
|
|
57
|
+
createRectangle(result: ProjectionAnalysisResult): void;
|
|
58
|
+
pointVirtualGrid: PointVirtualGrid<{
|
|
59
|
+
index: number;
|
|
60
|
+
type: "start" | "end";
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* 构建点的虚拟网格索引
|
|
64
|
+
*/
|
|
65
|
+
buildVirtualGrid(): void;
|
|
66
|
+
quadtree?: Quadtree;
|
|
67
|
+
/**
|
|
68
|
+
* 构建线段四叉树,快速查找,
|
|
69
|
+
*/
|
|
70
|
+
buildQuadtree(): void;
|
|
71
|
+
resultList: ProjectionAnalysisResult[];
|
|
72
|
+
/** 线段分析
|
|
73
|
+
* @description 判断两条线段距离是否较短且趋近平行,然后查找两条线段的重合部分的投影线,以此判断两根线是否需要合并
|
|
74
|
+
* @param data
|
|
75
|
+
*/
|
|
76
|
+
lineAnalysis(): void;
|
|
77
|
+
/** 线段投影分析
|
|
78
|
+
* @param index
|
|
79
|
+
* @param sourceLineSegment
|
|
80
|
+
* @param lineSegmentList
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
83
|
+
private projectionAnalysis;
|
|
84
|
+
}
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component } from '../../ComponentManager';
|
|
2
|
+
type EventData<T> = {
|
|
3
|
+
value: T;
|
|
4
|
+
oldValue: T;
|
|
5
|
+
};
|
|
6
|
+
interface EventType {
|
|
7
|
+
originalLineVisible: EventData<boolean>;
|
|
8
|
+
dxfVisible: EventData<boolean>;
|
|
9
|
+
whiteModelVisible: EventData<boolean>;
|
|
10
|
+
isLook: EventData<boolean>;
|
|
11
|
+
currentWheel: EventData<number>;
|
|
12
|
+
pointerMove: EventData<{
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}>;
|
|
16
|
+
currentKeyUp: EventData<string>;
|
|
17
|
+
}
|
|
18
|
+
export declare class Variable extends Component<EventType> {
|
|
19
|
+
static name: string;
|
|
20
|
+
originalLineVisible: boolean;
|
|
21
|
+
dxfVisible: boolean;
|
|
22
|
+
whiteModelVisible: boolean;
|
|
23
|
+
isLook: boolean;
|
|
24
|
+
currentWheel: number;
|
|
25
|
+
pointerMove: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
currentKeyUp: string;
|
|
30
|
+
set<KeyT extends keyof EventType>(key: KeyT, value: any): void;
|
|
31
|
+
get<KeyT extends keyof EventType>(key: KeyT): this[KeyT] | undefined;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentManager } from '../ComponentManager';
|
|
2
|
+
import { Dxf } from './components/Dxf';
|
|
3
|
+
import { Variable } from './components/Variable';
|
|
4
|
+
export declare class DxfSystem extends ComponentManager {
|
|
5
|
+
Dxf: Dxf;
|
|
6
|
+
Variable: Variable;
|
|
7
|
+
wallWidth: number;
|
|
8
|
+
environment: "node" | "browser" | "unknown";
|
|
9
|
+
/** 构造函数
|
|
10
|
+
* @param wallWidth 输出墙壁厚度,该墙壁厚度不受缩放影响
|
|
11
|
+
* @param scale 原始数据缩放比例
|
|
12
|
+
*/
|
|
13
|
+
constructor(wallWidth?: number, scale?: number);
|
|
14
|
+
usePlugin(plugin: (this: DxfSystem, dxfSystem: DxfSystem) => void): this;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, ComponentManager } from '../../../../ComponentManager';
|
|
2
|
+
import { Dxf } from '../../../components/Dxf';
|
|
3
|
+
import { Variable } from '../../../components/Variable';
|
|
4
|
+
import { WhiteModel } from './WhiteModel';
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
interface IDesPointItem {
|
|
7
|
+
message: string;
|
|
8
|
+
position: THREE.Vector3;
|
|
9
|
+
intersection: THREE.Vector3;
|
|
10
|
+
}
|
|
11
|
+
export declare class DetailsPoint extends Component<{
|
|
12
|
+
handleSuccess: {
|
|
13
|
+
desPoints: IDesPointItem[];
|
|
14
|
+
};
|
|
15
|
+
}> {
|
|
16
|
+
static name: string;
|
|
17
|
+
Dxf: Dxf | null;
|
|
18
|
+
WhiteModel: WhiteModel | null;
|
|
19
|
+
Variable: Variable | null;
|
|
20
|
+
desPoints: IDesPointItem[];
|
|
21
|
+
raylines: [THREE.Vector3, THREE.Vector3][];
|
|
22
|
+
data: any[];
|
|
23
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
24
|
+
/**
|
|
25
|
+
* 设置值
|
|
26
|
+
* @param data
|
|
27
|
+
*/
|
|
28
|
+
set(data: any): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* 设置射线辅助
|
|
31
|
+
*/
|
|
32
|
+
racasterHelper(position: THREE.Vector3, direction: THREE.Vector3, far: number): void;
|
|
33
|
+
private _timer;
|
|
34
|
+
/**
|
|
35
|
+
* 更新模型
|
|
36
|
+
*/
|
|
37
|
+
updateModel(): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component, ComponentManager } from '../../../../ComponentManager';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
export declare class DxfLineModel extends Component {
|
|
4
|
+
static name: string;
|
|
5
|
+
private dxfLineModel;
|
|
6
|
+
private dxfDoorsLineModel;
|
|
7
|
+
dxfModelGroup: THREE.Group<THREE.Object3DEventMap>;
|
|
8
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
9
|
+
updateMode(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, ComponentManager } from '../../../../ComponentManager';
|
|
2
|
+
import { Dxf } from '../../../components/Dxf';
|
|
3
|
+
import { Variable } from '../../../components/Variable';
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
export declare class WhiteModel extends Component<{
|
|
6
|
+
updateModel: {
|
|
7
|
+
whiteModelGroup: THREE.Group;
|
|
8
|
+
originalWhiteMode: THREE.Group;
|
|
9
|
+
};
|
|
10
|
+
}> {
|
|
11
|
+
static name: string;
|
|
12
|
+
Dxf: Dxf | null;
|
|
13
|
+
Variable: Variable | null;
|
|
14
|
+
whiteModelGroup: THREE.Group<THREE.Object3DEventMap>;
|
|
15
|
+
originalWhiteMode: THREE.Group<THREE.Object3DEventMap>;
|
|
16
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
17
|
+
updateModel(): void;
|
|
18
|
+
toOBJ(): Promise<string>;
|
|
19
|
+
toBlob(): Promise<Blob | undefined>;
|
|
20
|
+
download(filename: string): Promise<void>;
|
|
21
|
+
}
|