rm-build-dxf 0.1.186
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/README.md +6 -0
- package/package.json +50 -0
- package/src/App.vue.d.ts +2 -0
- package/src/DomEventRegister.js +1 -0
- package/src/api/getSocket.d.ts +1 -0
- package/src/api/index.d.ts +27 -0
- package/src/api/type.d.ts +46 -0
- package/src/build.js +1 -0
- package/src/components/DragContainer.vue.d.ts +48 -0
- package/src/components/NumberEditor.vue.d.ts +33 -0
- package/src/constants.d.ts +11 -0
- package/src/demo.d.ts +1 -0
- package/src/dxf-system/DxfSystem.d.ts +26 -0
- package/src/dxf-system/build.d.ts +94 -0
- package/src/dxf-system/components/CorrectionDxf.d.ts +44 -0
- package/src/dxf-system/components/Dxf.d.ts +96 -0
- package/src/dxf-system/components/ThreeVJia.d.ts +33 -0
- package/src/dxf-system/components/Variable.d.ts +41 -0
- package/src/dxf-system/index.d.ts +2 -0
- package/src/dxf-system/plugins/editor/Command/ClippingLine.d.ts +30 -0
- package/src/dxf-system/plugins/editor/Command/Command.d.ts +346 -0
- package/src/dxf-system/plugins/editor/Command/DefaultCommand.d.ts +56 -0
- package/src/dxf-system/plugins/editor/Command/DeleteSelectLine.d.ts +25 -0
- package/src/dxf-system/plugins/editor/Command/DrawBalconyRailing.d.ts +12 -0
- package/src/dxf-system/plugins/editor/Command/DrawBeam.d.ts +12 -0
- package/src/dxf-system/plugins/editor/Command/DrawDoorLine.d.ts +9 -0
- package/src/dxf-system/plugins/editor/Command/DrawHole.d.ts +67 -0
- package/src/dxf-system/plugins/editor/Command/DrawLine.d.ts +41 -0
- package/src/dxf-system/plugins/editor/Command/DrawPillar.d.ts +12 -0
- package/src/dxf-system/plugins/editor/Command/DrawWindow.d.ts +12 -0
- package/src/dxf-system/plugins/editor/Command/ManualDistance.d.ts +23 -0
- package/src/dxf-system/plugins/editor/Command/MergeLine.d.ts +33 -0
- package/src/dxf-system/plugins/editor/Command/PointDrag/index.d.ts +38 -0
- package/src/dxf-system/plugins/editor/Command/PointDrag/modifyDoor.d.ts +40 -0
- package/src/dxf-system/plugins/editor/Command/PointDrag/modifyLine.d.ts +34 -0
- package/src/dxf-system/plugins/editor/Command/PointDrag/modifyWindow.d.ts +25 -0
- package/src/dxf-system/plugins/editor/Command/PropertiesPanel.d.ts +33 -0
- package/src/dxf-system/plugins/editor/Command/RayDistance.d.ts +23 -0
- package/src/dxf-system/plugins/editor/Command/SelectAll.d.ts +30 -0
- package/src/dxf-system/plugins/editor/Command/TwoLineConnectionLine.d.ts +33 -0
- package/src/dxf-system/plugins/editor/Command/TwoPointConnection.d.ts +33 -0
- package/src/dxf-system/plugins/editor/Command/VerticalCorr.d.ts +66 -0
- package/src/dxf-system/plugins/editor/Command/VerticalCorrContinue.d.ts +35 -0
- package/src/dxf-system/plugins/editor/Command/ViewAngle.d.ts +21 -0
- package/src/dxf-system/plugins/editor/Editor.d.ts +56 -0
- package/src/dxf-system/plugins/editor/RenderManager.d.ts +101 -0
- package/src/dxf-system/plugins/editor/index.d.ts +9 -0
- package/src/dxf-system/plugins/editor/pages/EditorTool/EditorTool.vue.d.ts +7 -0
- package/src/dxf-system/plugins/editor/pages/EditorTool/EditorToolContent.vue.d.ts +7 -0
- package/src/dxf-system/plugins/editor/pages/PropertiesPanel.vue.d.ts +18 -0
- package/src/dxf-system/plugins/editor/pages/components/Button.vue.d.ts +17 -0
- package/src/dxf-system/plugins/editor/pages/components/Input.vue.d.ts +13 -0
- package/src/dxf-system/plugins/editor/pages/components/ToolToggle.vue.d.ts +20 -0
- package/src/dxf-system/plugins/editor/type.d.ts +11 -0
- package/src/dxf-system/plugins/editor/us-service/DragControlPoint.d.ts +48 -0
- package/src/dxf-system/plugins/editor/us-service/LineSelector.d.ts +44 -0
- package/src/dxf-system/plugins/editor/us-service/PointerFollowMove.d.ts +86 -0
- package/src/dxf-system/plugins/editor/us-service/SnapController.d.ts +32 -0
- package/src/dxf-system/plugins/editor/utils/Wall2D.d.ts +10 -0
- package/src/dxf-system/plugins/model3d/components/DxfLineModel.d.ts +14 -0
- package/src/dxf-system/plugins/model3d/components/WhiteModel.d.ts +61 -0
- package/src/dxf-system/plugins/model3d/components/index.d.ts +2 -0
- package/src/dxf-system/plugins/model3d/index.d.ts +11 -0
- package/src/dxf-system/plugins/renderer/components/DomContainer.d.ts +13 -0
- package/src/dxf-system/plugins/renderer/components/DomEventRegister.d.ts +116 -0
- package/src/dxf-system/plugins/renderer/components/EventInput.d.ts +74 -0
- package/src/dxf-system/plugins/renderer/components/ModelDataRender.d.ts +13 -0
- package/src/dxf-system/plugins/renderer/components/Renderer.d.ts +100 -0
- package/src/dxf-system/plugins/renderer/components/index.d.ts +5 -0
- package/src/dxf-system/plugins/renderer/index.d.ts +13 -0
- package/src/dxf-system/type.d.ts +218 -0
- package/src/dxf-system/utils/BayWindowHelper.d.ts +58 -0
- package/src/dxf-system/utils/BoundExt.d.ts +51 -0
- package/src/dxf-system/utils/DoorFind.d.ts +44 -0
- package/src/dxf-system/utils/DoubleWallFinder.d.ts +24 -0
- package/src/dxf-system/utils/HeightQuery.d.ts +12 -0
- package/src/dxf-system/utils/LineGroupType.d.ts +125 -0
- package/src/dxf-system/utils/LoadModel.d.ts +7 -0
- package/src/dxf-system/utils/RunJianPipeline.d.ts +92 -0
- package/src/dxf-system/utils/SceneAutoGenerat.d.ts +42 -0
- package/src/dxf-system/utils/ThreeVJiaPipeline.d.ts +154 -0
- package/src/dxf-system/utils/WallGroupManager.d.ts +27 -0
- package/src/dxf-system/utils/WallHole.d.ts +134 -0
- package/src/dxf-system/utils/WallHoleDrawData.d.ts +31 -0
- package/src/dxf-system/utils/ZHouseMockData.d.ts +127 -0
- package/src/dxf-system/utils/cad/DxfDataPlugin.d.ts +20 -0
- package/src/dxf-system/utils/cad/DxfDrawPlugin.d.ts +13 -0
- package/src/dxf-system/utils/cad/draw-data.d.ts +43 -0
- package/src/dxf-system/utils/cad/draw-dxf-image.d.ts +2 -0
- package/src/dxf-system/utils/cad/draw-dxf-string.d.ts +3 -0
- package/src/dxf-system/utils/cad/index.d.ts +143 -0
- package/src/dxf-system/utils/clipping-double-wall.d.ts +7 -0
- package/src/dxf-system/utils/draw-helper.d.ts +6 -0
- package/src/dxf-system/utils/find-discrete.d.ts +26 -0
- package/src/dxf-system/utils/find-rooms.d.ts +16 -0
- package/src/dxf-system/utils/get-win-draw-data.d.ts +18 -0
- package/src/dxf-system/utils/index.d.ts +8 -0
- package/src/dxf-system/utils/line-pipeline/builtin/axis-align-corr.d.ts +16 -0
- package/src/dxf-system/utils/line-pipeline/builtin/beam-support-line.d.ts +3 -0
- package/src/dxf-system/utils/line-pipeline/builtin/bound-ext.d.ts +8 -0
- package/src/dxf-system/utils/line-pipeline/builtin/build-group/bay-window.d.ts +7 -0
- package/src/dxf-system/utils/line-pipeline/builtin/build-group/double-wall.d.ts +6 -0
- package/src/dxf-system/utils/line-pipeline/builtin/build-group/index.d.ts +7 -0
- package/src/dxf-system/utils/line-pipeline/builtin/door-space-handle.d.ts +5 -0
- package/src/dxf-system/utils/line-pipeline/builtin/door-to-hole.d.ts +9 -0
- package/src/dxf-system/utils/line-pipeline/builtin/double-wall-alignment.d.ts +7 -0
- package/src/dxf-system/utils/line-pipeline/builtin/index.d.ts +39 -0
- package/src/dxf-system/utils/line-pipeline/builtin/init.d.ts +8 -0
- package/src/dxf-system/utils/line-pipeline/builtin/remove-room-sundries.d.ts +3 -0
- package/src/dxf-system/utils/line-pipeline/builtin/remove-short-double-wall.d.ts +6 -0
- package/src/dxf-system/utils/line-pipeline/builtin/wall-height-handle.d.ts +8 -0
- package/src/dxf-system/utils/line-pipeline/index.d.ts +22 -0
- package/src/dxf-system/utils/remove-dangline.d.ts +7 -0
- package/src/dxf-system/utils/tools.d.ts +91 -0
- package/src/index.css +1 -0
- package/src/index.js +1 -0
- package/src/index2.js +1 -0
- package/src/index3.js +1 -0
- package/src/main.d.ts +0 -0
- package/src/pages/CubeView.vue.d.ts +4 -0
- package/src/pages/DxfPreview.vue.d.ts +9 -0
- package/src/pages/Editor.vue.d.ts +8 -0
- package/src/pages/ExportGLB.vue.d.ts +2 -0
- package/src/pages/ImagePreview.vue.d.ts +9 -0
- package/src/pages/ModelView.vue.d.ts +11 -0
- package/src/pages/Setting.vue.d.ts +6 -0
- package/src/pages/Todo.vue.d.ts +2 -0
- package/src/pages/WallView.vue.d.ts +9 -0
- package/src/pages/WindowManager.vue.d.ts +2 -0
- package/src/pages/buildJson.vue.d.ts +4 -0
- package/src/pages/modelCarrier/index.vue.d.ts +4 -0
- package/src/router/index.d.ts +2 -0
- package/src/utils/EventDispatcher.d.ts +18 -0
- package/src/utils/algorithms/AlignToParallelSegments.d.ts +25 -0
- package/src/utils/algorithms/AxisAlignCorr.d.ts +38 -0
- package/src/utils/algorithms/Box2.d.ts +96 -0
- package/src/utils/algorithms/CheckPointCloudContinuity.d.ts +63 -0
- package/src/utils/algorithms/ConstraintSystem.d.ts +17 -0
- package/src/utils/algorithms/ConvexHullGraham.d.ts +16 -0
- package/src/utils/algorithms/Debouncing.d.ts +10 -0
- package/src/utils/algorithms/LineIndexGenerator.d.ts +12 -0
- package/src/utils/algorithms/LineQueryer.d.ts +42 -0
- package/src/utils/algorithms/LineSegment.d.ts +258 -0
- package/src/utils/algorithms/LineSegmentSpatialHash.d.ts +86 -0
- package/src/utils/algorithms/LineSegmentUtils.d.ts +185 -0
- package/src/utils/algorithms/Map.d.ts +38 -0
- package/src/utils/algorithms/MaxiCircles.d.ts +15 -0
- package/src/utils/algorithms/MiniCircles.d.ts +57 -0
- package/src/utils/algorithms/OBB.d.ts +30 -0
- package/src/utils/algorithms/PCSparseOctree.d.ts +56 -0
- package/src/utils/algorithms/Pipeline.d.ts +20 -0
- package/src/utils/algorithms/Point.d.ts +271 -0
- package/src/utils/algorithms/PointSpatialHash.d.ts +149 -0
- package/src/utils/algorithms/PointUtils.d.ts +47 -0
- package/src/utils/algorithms/Polygon.d.ts +164 -0
- package/src/utils/algorithms/PolygonUtils.d.ts +9 -0
- package/src/utils/algorithms/Quadtree.d.ts +89 -0
- package/src/utils/algorithms/Rectangle.d.ts +62 -0
- package/src/utils/algorithms/UndirectedGraph.d.ts +124 -0
- package/src/utils/algorithms/UnionFindSet.d.ts +12 -0
- package/src/utils/algorithms/ccw.d.ts +2 -0
- package/src/utils/algorithms/lazy.d.ts +14 -0
- package/src/utils/algorithms/precision.d.ts +3 -0
- package/src/utils/algorithms/stepElimination.d.ts +6 -0
- package/src/utils/algorithms/uuid.d.ts +1 -0
- package/src/utils/command/CommandFlow.d.ts +45 -0
- package/src/utils/command/CommandSystem.d.ts +96 -0
- package/src/utils/command/index.d.ts +2 -0
- package/src/utils/decorators/measure-time.d.ts +5 -0
- package/src/utils/ecs/Component.d.ts +18 -0
- package/src/utils/ecs/Container.d.ts +47 -0
- package/src/utils/ecs/index.d.ts +4 -0
- package/src/utils/geometry-manager/GeometryManager.d.ts +2 -0
- package/src/utils/index.d.ts +25 -0
- package/src/utils/modelScenario/bayWindow.d.ts +35 -0
- package/src/utils/modelScenario/scenario.d.ts +92 -0
- package/src/utils/three-object-3d/ExtrudeMesh.d.ts +11 -0
- package/src/utils/three-object-3d/LineAlignmentGuide.d.ts +20 -0
- package/src/utils/three-object-3d/Lines.d.ts +25 -0
- package/src/utils/three-object-3d/Lines2.d.ts +22 -0
- package/src/utils/three-object-3d/Shape2D.d.ts +61 -0
- package/src/utils/tools/GCHandle.d.ts +12 -0
- package/src/utils/tools/Gltf.d.ts +7 -0
- package/src/utils/tools/SnapLine.d.ts +19 -0
- package/src/utils/tools/StorageHelper.d.ts +8 -0
- package/src/utils/tools/clone-user-data.d.ts +7 -0
- package/src/utils/tools/create-html.d.ts +9 -0
- package/src/utils/tools/create-promise.d.ts +5 -0
- package/src/utils/tools/createVueApp.d.ts +1 -0
- package/src/utils/tools/download.d.ts +1 -0
- package/src/utils/tools/get-json.d.ts +5 -0
- package/src/utils/tools/include.d.ts +1 -0
- package/src/utils/tools/is-mobile.d.ts +2 -0
- package/src/utils/tools/repetitive-task.d.ts +1 -0
- package/src/utils/tools/selectLocal-file.d.ts +7 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { LineSegment } from '../../utils/algorithms/LineSegment';
|
|
2
|
+
import { IPublicInfoFile, LineUserData } from '../type';
|
|
3
|
+
import { WallGroupManager } from './WallGroupManager';
|
|
4
|
+
import { Pipeline, HandlerContext } from '../../utils/algorithms/Pipeline';
|
|
5
|
+
import { IRoom } from './find-rooms';
|
|
6
|
+
type Vec2 = {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
type HoleType = "DOOR" | "DOUBLE_DOOR" | "SLIDE_DOOR" | "UNEQUAL_DOUBLE_DOOR" | "PASS" | "WINDOW" | "BAY_WINDOW" | "FRENCH_WINDOW" | "SLIDE_WINDOW" | "CORNER_WINDOW" | "CORNER_BAY_WINDOW" | "U_WINDOW" | "U_BAY_WINDOW" | "RAILING" | "L_RAILING" | "U_RAILING" | "GLASS_RAILING" | "BALCONY_RAILING" | "BALCONY_SEAL_WINDOW" | "WALL_HOLE";
|
|
11
|
+
type Hole = {
|
|
12
|
+
id: number;
|
|
13
|
+
type: HoleType;
|
|
14
|
+
start: Vec2;
|
|
15
|
+
end: Vec2;
|
|
16
|
+
height?: number;
|
|
17
|
+
groundClearance?: number;
|
|
18
|
+
sillHeight?: number;
|
|
19
|
+
openSide?: "RIGHT" | "LEFT" | "UP" | "DOWN";
|
|
20
|
+
height1?: number;
|
|
21
|
+
height2?: number;
|
|
22
|
+
height3?: number;
|
|
23
|
+
depth?: number;
|
|
24
|
+
windowWidth?: number;
|
|
25
|
+
windowHeight?: number;
|
|
26
|
+
pictures?: string[];
|
|
27
|
+
};
|
|
28
|
+
type Wall = {
|
|
29
|
+
ID: number;
|
|
30
|
+
start: Vec2;
|
|
31
|
+
end: Vec2;
|
|
32
|
+
thickness: number;
|
|
33
|
+
type: "LINE";
|
|
34
|
+
isDoor: boolean;
|
|
35
|
+
loadBearingWall: boolean;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
type Room = {
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
roomTypeId: number;
|
|
42
|
+
position: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
};
|
|
46
|
+
polygon: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
type PlaceHolder = {
|
|
52
|
+
name: string;
|
|
53
|
+
polygon: {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
}[];
|
|
57
|
+
direction: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
};
|
|
61
|
+
height: number;
|
|
62
|
+
sillHeight: number;
|
|
63
|
+
roomId: number;
|
|
64
|
+
id: number;
|
|
65
|
+
};
|
|
66
|
+
export type ThreeVJiaJsonObject = {
|
|
67
|
+
version: string;
|
|
68
|
+
name: string;
|
|
69
|
+
center: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
angle: number;
|
|
74
|
+
communityName: string;
|
|
75
|
+
city: string;
|
|
76
|
+
province: string;
|
|
77
|
+
height: number;
|
|
78
|
+
walls: Wall[];
|
|
79
|
+
pillars: any[];
|
|
80
|
+
beams: any[];
|
|
81
|
+
holes: Hole[];
|
|
82
|
+
rooms: Room[];
|
|
83
|
+
placeHolders: PlaceHolder[];
|
|
84
|
+
};
|
|
85
|
+
type DataOption = {
|
|
86
|
+
lines: LineSegment[];
|
|
87
|
+
json: ThreeVJiaJsonObject;
|
|
88
|
+
};
|
|
89
|
+
interface ICache {
|
|
90
|
+
wallLines: LineSegment[];
|
|
91
|
+
}
|
|
92
|
+
export declare class ThreeVJiaPipeline extends Pipeline<DataOption, ICache> {
|
|
93
|
+
manager: WallGroupManager;
|
|
94
|
+
index: number;
|
|
95
|
+
maxHeight: number;
|
|
96
|
+
lines: LineSegment[];
|
|
97
|
+
constructor(lines: LineSegment[], maxHeight: number);
|
|
98
|
+
/** 双线墙处理
|
|
99
|
+
* 孔洞提取
|
|
100
|
+
* 会拆分成有宽度的单线墙壁
|
|
101
|
+
* @param param0
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
doubleWallHandle({ data: { lines }, cache }: HandlerContext<DataOption, ICache>): void;
|
|
105
|
+
/**
|
|
106
|
+
* 单线墙处理 - 孔洞提取
|
|
107
|
+
* @param param0
|
|
108
|
+
*/
|
|
109
|
+
wallHandle({ data: { lines }, cache }: HandlerContext<DataOption, ICache>): void;
|
|
110
|
+
/**
|
|
111
|
+
* 门线处理
|
|
112
|
+
* @param param0
|
|
113
|
+
*/
|
|
114
|
+
doorHandle({ data: { lines }, cache }: HandlerContext<DataOption, ICache>): void;
|
|
115
|
+
/** 飘窗处理
|
|
116
|
+
* @param data
|
|
117
|
+
* @returns
|
|
118
|
+
*/
|
|
119
|
+
bayWindowHandle({ data: { lines }, cache }: HandlerContext<DataOption, ICache>): void;
|
|
120
|
+
/** 阳台护栏
|
|
121
|
+
* @param param0
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
balconyRailing({ data: { lines }, cache }: HandlerContext<DataOption, ICache>): void;
|
|
125
|
+
/** 墙壁孔洞处理
|
|
126
|
+
* @param param0
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
wallHoleHandle({ data: { lines, json } }: HandlerContext<DataOption, ICache>): void;
|
|
130
|
+
/** 转换
|
|
131
|
+
* @returns
|
|
132
|
+
*/
|
|
133
|
+
transform(): ThreeVJiaJsonObject;
|
|
134
|
+
/** 添加房间
|
|
135
|
+
* @param option
|
|
136
|
+
* @param rooms
|
|
137
|
+
*/
|
|
138
|
+
static appendRooms(json: ThreeVJiaJsonObject, rooms: IRoom[]): ThreeVJiaJsonObject;
|
|
139
|
+
/** 添加物品
|
|
140
|
+
* @param option json
|
|
141
|
+
* @param publicInfo 物品信息
|
|
142
|
+
* @returns
|
|
143
|
+
*/
|
|
144
|
+
static appendPlaceHolders(json: ThreeVJiaJsonObject, publicInfo: IPublicInfoFile, z: number): ThreeVJiaJsonObject;
|
|
145
|
+
/**
|
|
146
|
+
* 转为 三维家 墙体结构
|
|
147
|
+
* @param lineSegments
|
|
148
|
+
* @param angle 弧度
|
|
149
|
+
* @param updateGroup
|
|
150
|
+
* @returns
|
|
151
|
+
*/
|
|
152
|
+
static toThreeVJiaJson(lineSegments: LineSegment<LineUserData>[], angle?: number, updateGroup?: boolean): ThreeVJiaJsonObject;
|
|
153
|
+
}
|
|
154
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LineSegment } from '../../utils/algorithms/LineSegment';
|
|
2
|
+
import { LineUserData } from '../type';
|
|
3
|
+
export interface IGroup<T = any> {
|
|
4
|
+
type: string;
|
|
5
|
+
lines: LineSegment<LineUserData>[];
|
|
6
|
+
data?: T;
|
|
7
|
+
}
|
|
8
|
+
export declare class WallGroupManager {
|
|
9
|
+
[Symbol.iterator](): ArrayIterator<IGroup<any>>;
|
|
10
|
+
private groups;
|
|
11
|
+
add(group: IGroup): void;
|
|
12
|
+
forEach(fun: (group: IGroup, index: number, isEnd: boolean) => void): void;
|
|
13
|
+
map<T = any>(fun: (group: IGroup, index: number) => T): T[];
|
|
14
|
+
/** 查找符合条件的组
|
|
15
|
+
* @param fun
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
findGroup(fun: (group: IGroup) => boolean): IGroup<any> | undefined;
|
|
19
|
+
findGroupByType(type: string): IGroup<any> | undefined;
|
|
20
|
+
/** 查找所有符合条件的组
|
|
21
|
+
* @param fun
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
findGroups(fun: (group: IGroup) => boolean): IGroup<any>[];
|
|
25
|
+
findGroupsByType(type: string | string[]): IGroup<any>[];
|
|
26
|
+
static fromByLines(lineSegments: LineSegment[]): WallGroupManager;
|
|
27
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { LineSegment } from '../../utils/algorithms/LineSegment';
|
|
2
|
+
import { HoleData, HoleStorageType, HoleType, LineUserData } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* 墙体嵌入物(窗户、空洞)处理对象
|
|
5
|
+
*/
|
|
6
|
+
export declare class WallHole {
|
|
7
|
+
static mountedObjectType: never[];
|
|
8
|
+
lines: LineSegment<LineUserData>[];
|
|
9
|
+
constructor(lines: LineSegment<LineUserData>[]);
|
|
10
|
+
/** 是否是墙体嵌入物
|
|
11
|
+
* @param line
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
static isHole(line: LineSegment<LineUserData>): boolean | undefined;
|
|
15
|
+
isHole(line: LineSegment<LineUserData>): boolean | undefined;
|
|
16
|
+
/** 是否是门洞
|
|
17
|
+
* @param line
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
static isDoor(line: LineSegment<LineUserData>): boolean;
|
|
21
|
+
/** 是不是双线孔洞门
|
|
22
|
+
* @param line
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
static isDoubleDoor(line: LineSegment<LineUserData>): boolean;
|
|
26
|
+
/** 是不是梁
|
|
27
|
+
* @param line
|
|
28
|
+
*/
|
|
29
|
+
static isBeam(line: LineSegment<LineUserData>): boolean;
|
|
30
|
+
/** 是不是通道、垭口
|
|
31
|
+
* @param line
|
|
32
|
+
*/
|
|
33
|
+
static isPass(line: LineSegment<LineUserData>): boolean;
|
|
34
|
+
/** 是不是双线孔洞
|
|
35
|
+
* @param line
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
static isDouble(line: LineSegment<LineUserData>): boolean;
|
|
39
|
+
/** 是否配对
|
|
40
|
+
* @param lines
|
|
41
|
+
*/
|
|
42
|
+
static isPairing(lines: LineSegment<LineUserData>[]): true | undefined;
|
|
43
|
+
/** 取消配对
|
|
44
|
+
* @param lines
|
|
45
|
+
*/
|
|
46
|
+
static cancelPairing(line: LineSegment, line2: LineSegment): void;
|
|
47
|
+
/** 获取孔洞 id
|
|
48
|
+
* @param item
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
static getId(item: HoleData): number | undefined;
|
|
52
|
+
/** 获取孔洞NearId
|
|
53
|
+
* @param item
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
static getNearId(item: HoleData): number | undefined;
|
|
57
|
+
/** 孔洞数据装线段
|
|
58
|
+
* @param line
|
|
59
|
+
* @param insertObject
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
static holeDataToLine(line: LineSegment<LineUserData>, insertObject: HoleData, projClip?: boolean, snap?: boolean): LineSegment<any>;
|
|
63
|
+
/** 获取组
|
|
64
|
+
* @param lines
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
static getDoubleGroup(lines: LineSegment<LineUserData>[]): {
|
|
68
|
+
results: [LineSegment<Record<string, any>>, LineSegment<Record<string, any>>][];
|
|
69
|
+
otherLines: LineSegment<Record<string, any>>[];
|
|
70
|
+
};
|
|
71
|
+
/** 获取孔洞迭代器
|
|
72
|
+
* @param line
|
|
73
|
+
*/
|
|
74
|
+
static getIterator(line: LineSegment<LineUserData>): Generator<HoleData, void, unknown>;
|
|
75
|
+
/** 获取属性迭代器
|
|
76
|
+
* @param line
|
|
77
|
+
*/
|
|
78
|
+
static getStorageDataIterator(line: LineSegment<LineUserData>): Generator<HoleData[], void, unknown>;
|
|
79
|
+
/** 遍历孔洞
|
|
80
|
+
* @param line
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
83
|
+
static forEachStorageType(line: LineSegment<LineUserData>, callBack: (data: HoleData[], key: HoleStorageType) => void): void;
|
|
84
|
+
/** 获取最小
|
|
85
|
+
* @param line
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
static getMinWidth(key: HoleStorageType, type?: HoleType): 0.3 | 0.2 | 0.05 | 0.35;
|
|
89
|
+
/** 清理孔洞
|
|
90
|
+
* @param target
|
|
91
|
+
* @param key
|
|
92
|
+
*/
|
|
93
|
+
static clear(target: LineSegment, key?: HoleStorageType): void;
|
|
94
|
+
/** 过滤宽度最小值孔洞
|
|
95
|
+
* @param line
|
|
96
|
+
*/
|
|
97
|
+
static miniWidthFilter(line: LineSegment | LineSegment[]): typeof WallHole;
|
|
98
|
+
/**
|
|
99
|
+
* 过滤非法的孔洞
|
|
100
|
+
*/
|
|
101
|
+
static filterIllegal(line: LineSegment | LineSegment[]): typeof WallHole;
|
|
102
|
+
/**
|
|
103
|
+
* 重新计算位置
|
|
104
|
+
* @deprecated 已废弃
|
|
105
|
+
*/
|
|
106
|
+
static recomputedCenter(lines: LineSegment[]): typeof WallHole;
|
|
107
|
+
/**
|
|
108
|
+
* 对重合的孔洞进行合并
|
|
109
|
+
*/
|
|
110
|
+
static merge(line: LineSegment | LineSegment[]): typeof WallHole;
|
|
111
|
+
/** 添加孔洞
|
|
112
|
+
* @param target
|
|
113
|
+
* @param insertObject
|
|
114
|
+
* @param type
|
|
115
|
+
*/
|
|
116
|
+
static addHole(target: LineSegment<LineUserData>, insertObject: HoleData, type?: HoleStorageType): void;
|
|
117
|
+
/** 移除孔洞
|
|
118
|
+
* @param target
|
|
119
|
+
* @param insertObject
|
|
120
|
+
*/
|
|
121
|
+
static removeHole(target: LineSegment<LineUserData>, insertObject: HoleData): void;
|
|
122
|
+
/** 复制所有孔洞
|
|
123
|
+
* @param target
|
|
124
|
+
* @param source
|
|
125
|
+
*/
|
|
126
|
+
static copyHole(target: LineSegment<LineUserData>, source: LineSegment<LineUserData>): void;
|
|
127
|
+
/** 拆分目标target的孔洞到source, 并且清空target
|
|
128
|
+
* @description 拆分规则,只考虑孔洞中点投影是否落到线段上
|
|
129
|
+
* @param target
|
|
130
|
+
* @param source
|
|
131
|
+
*/
|
|
132
|
+
static splitHole(target: LineSegment<LineUserData> | HoleData[], source: LineSegment<LineUserData> | LineSegment<LineUserData>[]): void;
|
|
133
|
+
}
|
|
134
|
+
export declare const WH: typeof WallHole;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LineSegment } from '../../utils/algorithms/LineSegment';
|
|
2
|
+
import { PointSpatialHash } from '../../utils/algorithms/PointSpatialHash';
|
|
3
|
+
import { LineUserData } from '../type';
|
|
4
|
+
import { ArrayMap } from '../../utils/algorithms/Map';
|
|
5
|
+
export declare class WallHoleDrawData {
|
|
6
|
+
/** 单线孔洞
|
|
7
|
+
* @param line
|
|
8
|
+
* @param grid
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
static singleHoleLine(line: LineSegment<LineUserData>, grid?: PointSpatialHash): LineSegment<Record<string, any>>[] | null;
|
|
12
|
+
/** 双线孔洞
|
|
13
|
+
* @param lines
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
static doubleHoleLine(lines: LineSegment<LineUserData>[]): LineSegment<Record<string, any>>[];
|
|
17
|
+
/** 自动处理
|
|
18
|
+
* @param doubleWallGroup 四边形
|
|
19
|
+
* @param wall
|
|
20
|
+
* @param lines
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
static handleHoleDrawData(doubleWallGroup: LineSegment[][], wall: LineSegment[], lines?: LineSegment<LineUserData>[]): ArrayMap<string, LineSegment<Record<string, any>>> & {
|
|
24
|
+
readonly untreatedDoubleWallGroup: LineSegment<Record<string, any>>[][];
|
|
25
|
+
readonly untreatedWall: LineSegment<Record<string, any>>[];
|
|
26
|
+
readonly passageEntrance: LineSegment<Record<string, any>>[];
|
|
27
|
+
readonly window: LineSegment<Record<string, any>>[];
|
|
28
|
+
readonly door: LineSegment<Record<string, any>>[];
|
|
29
|
+
readonly beam: LineSegment<Record<string, any>>[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 模拟数据
|
|
3
|
+
* @author xuld
|
|
4
|
+
* @date 2024-01-03
|
|
5
|
+
* @lastEditTime 2024-01-03 09:22:54
|
|
6
|
+
* @lastEditors xuld
|
|
7
|
+
* @filePath
|
|
8
|
+
*/
|
|
9
|
+
export declare class ZHouseMockData {
|
|
10
|
+
private static _data;
|
|
11
|
+
static getData(): {
|
|
12
|
+
name: string;
|
|
13
|
+
communityName: string;
|
|
14
|
+
city: string;
|
|
15
|
+
province: string;
|
|
16
|
+
rooms: {
|
|
17
|
+
name: string;
|
|
18
|
+
roomTypeId: number;
|
|
19
|
+
position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
walls: {
|
|
25
|
+
start: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
end: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
33
|
+
type: string;
|
|
34
|
+
thickness: number;
|
|
35
|
+
loadBearingWall: boolean;
|
|
36
|
+
}[];
|
|
37
|
+
holes: ({
|
|
38
|
+
start: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
};
|
|
42
|
+
end: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
};
|
|
46
|
+
height: number;
|
|
47
|
+
groundClearance: number;
|
|
48
|
+
type: string;
|
|
49
|
+
sillHeight: number;
|
|
50
|
+
id: number;
|
|
51
|
+
openSide?: undefined;
|
|
52
|
+
depth?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
start: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
|
58
|
+
end: {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
};
|
|
62
|
+
height: number;
|
|
63
|
+
openSide: string;
|
|
64
|
+
groundClearance: number;
|
|
65
|
+
type: string;
|
|
66
|
+
sillHeight: number;
|
|
67
|
+
id: number;
|
|
68
|
+
depth?: undefined;
|
|
69
|
+
} | {
|
|
70
|
+
start: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
end: {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
};
|
|
78
|
+
height: number;
|
|
79
|
+
openSide: string;
|
|
80
|
+
groundClearance: number;
|
|
81
|
+
type: string;
|
|
82
|
+
sillHeight: number;
|
|
83
|
+
depth: string;
|
|
84
|
+
id: number;
|
|
85
|
+
})[];
|
|
86
|
+
pillars: {
|
|
87
|
+
polygon: {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
}[];
|
|
91
|
+
}[];
|
|
92
|
+
flues: {
|
|
93
|
+
polygon: {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
}[];
|
|
97
|
+
}[];
|
|
98
|
+
beams: {
|
|
99
|
+
start: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
};
|
|
103
|
+
end: {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
};
|
|
107
|
+
height: number;
|
|
108
|
+
thickness: number;
|
|
109
|
+
id: number;
|
|
110
|
+
}[];
|
|
111
|
+
placeHolders: {
|
|
112
|
+
name: string;
|
|
113
|
+
polygon: {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
}[];
|
|
117
|
+
direction: {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
};
|
|
121
|
+
height: number;
|
|
122
|
+
sillHeight: number;
|
|
123
|
+
roomId: number;
|
|
124
|
+
id: number;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LineSegment } from '../../../utils/algorithms/LineSegment';
|
|
2
|
+
import { CAD, ICADPlugin } from '.';
|
|
3
|
+
import { WallGroupManager } from '../WallGroupManager';
|
|
4
|
+
import { LineUserData } from '../../type';
|
|
5
|
+
import { Pipeline } from '../../../utils/algorithms/Pipeline';
|
|
6
|
+
type DataOption = {
|
|
7
|
+
lines: LineSegment[];
|
|
8
|
+
};
|
|
9
|
+
type CacheOption = {
|
|
10
|
+
cad: CAD;
|
|
11
|
+
};
|
|
12
|
+
/** dxf 数据处理插件
|
|
13
|
+
*/
|
|
14
|
+
export declare class DxfDataPlugin extends Pipeline<DataOption, CacheOption> implements ICADPlugin {
|
|
15
|
+
manager: WallGroupManager;
|
|
16
|
+
lines: LineSegment<LineUserData>[];
|
|
17
|
+
constructor(lines: LineSegment<LineUserData>[]);
|
|
18
|
+
install(cad: CAD): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CAD, ICADPlugin } from '.';
|
|
2
|
+
/** dxf 绘制插件
|
|
3
|
+
*/
|
|
4
|
+
export declare class DxfDrawPlugin implements ICADPlugin {
|
|
5
|
+
/** 获取角度范围
|
|
6
|
+
* @param center
|
|
7
|
+
* @param p1
|
|
8
|
+
* @param p2
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
private getArcAngleRange;
|
|
12
|
+
install(cad: CAD): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Unit } from '../../type';
|
|
2
|
+
import { CAD } from '.';
|
|
3
|
+
export type DrawData = {
|
|
4
|
+
unit: Unit;
|
|
5
|
+
lines: [number, number, number, number, string][];
|
|
6
|
+
lines2: [number, number, number, number, string][];
|
|
7
|
+
arcs: [number, number, number, number, number, string][];
|
|
8
|
+
texts: [string, number, number, string][];
|
|
9
|
+
center: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
scale: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const units: {
|
|
18
|
+
Unitless: number;
|
|
19
|
+
Inches: number;
|
|
20
|
+
Feet: number;
|
|
21
|
+
Miles: number;
|
|
22
|
+
Millimeters: number;
|
|
23
|
+
Centimeters: number;
|
|
24
|
+
Meters: number;
|
|
25
|
+
Kilometers: number;
|
|
26
|
+
Microinches: number;
|
|
27
|
+
Mils: number;
|
|
28
|
+
Yards: number;
|
|
29
|
+
Angstroms: number;
|
|
30
|
+
Nanometers: number;
|
|
31
|
+
Microns: number;
|
|
32
|
+
Decimeters: number;
|
|
33
|
+
Decameters: number;
|
|
34
|
+
Hectometers: number;
|
|
35
|
+
Gigameters: number;
|
|
36
|
+
"Astronomical units": number;
|
|
37
|
+
"Light years": number;
|
|
38
|
+
Parsecs: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 转为绘制数据
|
|
42
|
+
*/
|
|
43
|
+
export declare function toDrawData(this: CAD, unit?: Unit): DrawData;
|