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.
Files changed (195) hide show
  1. package/README.md +6 -0
  2. package/package.json +50 -0
  3. package/src/App.vue.d.ts +2 -0
  4. package/src/DomEventRegister.js +1 -0
  5. package/src/api/getSocket.d.ts +1 -0
  6. package/src/api/index.d.ts +27 -0
  7. package/src/api/type.d.ts +46 -0
  8. package/src/build.js +1 -0
  9. package/src/components/DragContainer.vue.d.ts +48 -0
  10. package/src/components/NumberEditor.vue.d.ts +33 -0
  11. package/src/constants.d.ts +11 -0
  12. package/src/demo.d.ts +1 -0
  13. package/src/dxf-system/DxfSystem.d.ts +26 -0
  14. package/src/dxf-system/build.d.ts +94 -0
  15. package/src/dxf-system/components/CorrectionDxf.d.ts +44 -0
  16. package/src/dxf-system/components/Dxf.d.ts +96 -0
  17. package/src/dxf-system/components/ThreeVJia.d.ts +33 -0
  18. package/src/dxf-system/components/Variable.d.ts +41 -0
  19. package/src/dxf-system/index.d.ts +2 -0
  20. package/src/dxf-system/plugins/editor/Command/ClippingLine.d.ts +30 -0
  21. package/src/dxf-system/plugins/editor/Command/Command.d.ts +346 -0
  22. package/src/dxf-system/plugins/editor/Command/DefaultCommand.d.ts +56 -0
  23. package/src/dxf-system/plugins/editor/Command/DeleteSelectLine.d.ts +25 -0
  24. package/src/dxf-system/plugins/editor/Command/DrawBalconyRailing.d.ts +12 -0
  25. package/src/dxf-system/plugins/editor/Command/DrawBeam.d.ts +12 -0
  26. package/src/dxf-system/plugins/editor/Command/DrawDoorLine.d.ts +9 -0
  27. package/src/dxf-system/plugins/editor/Command/DrawHole.d.ts +67 -0
  28. package/src/dxf-system/plugins/editor/Command/DrawLine.d.ts +41 -0
  29. package/src/dxf-system/plugins/editor/Command/DrawPillar.d.ts +12 -0
  30. package/src/dxf-system/plugins/editor/Command/DrawWindow.d.ts +12 -0
  31. package/src/dxf-system/plugins/editor/Command/ManualDistance.d.ts +23 -0
  32. package/src/dxf-system/plugins/editor/Command/MergeLine.d.ts +33 -0
  33. package/src/dxf-system/plugins/editor/Command/PointDrag/index.d.ts +38 -0
  34. package/src/dxf-system/plugins/editor/Command/PointDrag/modifyDoor.d.ts +40 -0
  35. package/src/dxf-system/plugins/editor/Command/PointDrag/modifyLine.d.ts +34 -0
  36. package/src/dxf-system/plugins/editor/Command/PointDrag/modifyWindow.d.ts +25 -0
  37. package/src/dxf-system/plugins/editor/Command/PropertiesPanel.d.ts +33 -0
  38. package/src/dxf-system/plugins/editor/Command/RayDistance.d.ts +23 -0
  39. package/src/dxf-system/plugins/editor/Command/SelectAll.d.ts +30 -0
  40. package/src/dxf-system/plugins/editor/Command/TwoLineConnectionLine.d.ts +33 -0
  41. package/src/dxf-system/plugins/editor/Command/TwoPointConnection.d.ts +33 -0
  42. package/src/dxf-system/plugins/editor/Command/VerticalCorr.d.ts +66 -0
  43. package/src/dxf-system/plugins/editor/Command/VerticalCorrContinue.d.ts +35 -0
  44. package/src/dxf-system/plugins/editor/Command/ViewAngle.d.ts +21 -0
  45. package/src/dxf-system/plugins/editor/Editor.d.ts +56 -0
  46. package/src/dxf-system/plugins/editor/RenderManager.d.ts +101 -0
  47. package/src/dxf-system/plugins/editor/index.d.ts +9 -0
  48. package/src/dxf-system/plugins/editor/pages/EditorTool/EditorTool.vue.d.ts +7 -0
  49. package/src/dxf-system/plugins/editor/pages/EditorTool/EditorToolContent.vue.d.ts +7 -0
  50. package/src/dxf-system/plugins/editor/pages/PropertiesPanel.vue.d.ts +18 -0
  51. package/src/dxf-system/plugins/editor/pages/components/Button.vue.d.ts +17 -0
  52. package/src/dxf-system/plugins/editor/pages/components/Input.vue.d.ts +13 -0
  53. package/src/dxf-system/plugins/editor/pages/components/ToolToggle.vue.d.ts +20 -0
  54. package/src/dxf-system/plugins/editor/type.d.ts +11 -0
  55. package/src/dxf-system/plugins/editor/us-service/DragControlPoint.d.ts +48 -0
  56. package/src/dxf-system/plugins/editor/us-service/LineSelector.d.ts +44 -0
  57. package/src/dxf-system/plugins/editor/us-service/PointerFollowMove.d.ts +86 -0
  58. package/src/dxf-system/plugins/editor/us-service/SnapController.d.ts +32 -0
  59. package/src/dxf-system/plugins/editor/utils/Wall2D.d.ts +10 -0
  60. package/src/dxf-system/plugins/model3d/components/DxfLineModel.d.ts +14 -0
  61. package/src/dxf-system/plugins/model3d/components/WhiteModel.d.ts +61 -0
  62. package/src/dxf-system/plugins/model3d/components/index.d.ts +2 -0
  63. package/src/dxf-system/plugins/model3d/index.d.ts +11 -0
  64. package/src/dxf-system/plugins/renderer/components/DomContainer.d.ts +13 -0
  65. package/src/dxf-system/plugins/renderer/components/DomEventRegister.d.ts +116 -0
  66. package/src/dxf-system/plugins/renderer/components/EventInput.d.ts +74 -0
  67. package/src/dxf-system/plugins/renderer/components/ModelDataRender.d.ts +13 -0
  68. package/src/dxf-system/plugins/renderer/components/Renderer.d.ts +100 -0
  69. package/src/dxf-system/plugins/renderer/components/index.d.ts +5 -0
  70. package/src/dxf-system/plugins/renderer/index.d.ts +13 -0
  71. package/src/dxf-system/type.d.ts +218 -0
  72. package/src/dxf-system/utils/BayWindowHelper.d.ts +58 -0
  73. package/src/dxf-system/utils/BoundExt.d.ts +51 -0
  74. package/src/dxf-system/utils/DoorFind.d.ts +44 -0
  75. package/src/dxf-system/utils/DoubleWallFinder.d.ts +24 -0
  76. package/src/dxf-system/utils/HeightQuery.d.ts +12 -0
  77. package/src/dxf-system/utils/LineGroupType.d.ts +125 -0
  78. package/src/dxf-system/utils/LoadModel.d.ts +7 -0
  79. package/src/dxf-system/utils/RunJianPipeline.d.ts +92 -0
  80. package/src/dxf-system/utils/SceneAutoGenerat.d.ts +42 -0
  81. package/src/dxf-system/utils/ThreeVJiaPipeline.d.ts +154 -0
  82. package/src/dxf-system/utils/WallGroupManager.d.ts +27 -0
  83. package/src/dxf-system/utils/WallHole.d.ts +134 -0
  84. package/src/dxf-system/utils/WallHoleDrawData.d.ts +31 -0
  85. package/src/dxf-system/utils/ZHouseMockData.d.ts +127 -0
  86. package/src/dxf-system/utils/cad/DxfDataPlugin.d.ts +20 -0
  87. package/src/dxf-system/utils/cad/DxfDrawPlugin.d.ts +13 -0
  88. package/src/dxf-system/utils/cad/draw-data.d.ts +43 -0
  89. package/src/dxf-system/utils/cad/draw-dxf-image.d.ts +2 -0
  90. package/src/dxf-system/utils/cad/draw-dxf-string.d.ts +3 -0
  91. package/src/dxf-system/utils/cad/index.d.ts +143 -0
  92. package/src/dxf-system/utils/clipping-double-wall.d.ts +7 -0
  93. package/src/dxf-system/utils/draw-helper.d.ts +6 -0
  94. package/src/dxf-system/utils/find-discrete.d.ts +26 -0
  95. package/src/dxf-system/utils/find-rooms.d.ts +16 -0
  96. package/src/dxf-system/utils/get-win-draw-data.d.ts +18 -0
  97. package/src/dxf-system/utils/index.d.ts +8 -0
  98. package/src/dxf-system/utils/line-pipeline/builtin/axis-align-corr.d.ts +16 -0
  99. package/src/dxf-system/utils/line-pipeline/builtin/beam-support-line.d.ts +3 -0
  100. package/src/dxf-system/utils/line-pipeline/builtin/bound-ext.d.ts +8 -0
  101. package/src/dxf-system/utils/line-pipeline/builtin/build-group/bay-window.d.ts +7 -0
  102. package/src/dxf-system/utils/line-pipeline/builtin/build-group/double-wall.d.ts +6 -0
  103. package/src/dxf-system/utils/line-pipeline/builtin/build-group/index.d.ts +7 -0
  104. package/src/dxf-system/utils/line-pipeline/builtin/door-space-handle.d.ts +5 -0
  105. package/src/dxf-system/utils/line-pipeline/builtin/door-to-hole.d.ts +9 -0
  106. package/src/dxf-system/utils/line-pipeline/builtin/double-wall-alignment.d.ts +7 -0
  107. package/src/dxf-system/utils/line-pipeline/builtin/index.d.ts +39 -0
  108. package/src/dxf-system/utils/line-pipeline/builtin/init.d.ts +8 -0
  109. package/src/dxf-system/utils/line-pipeline/builtin/remove-room-sundries.d.ts +3 -0
  110. package/src/dxf-system/utils/line-pipeline/builtin/remove-short-double-wall.d.ts +6 -0
  111. package/src/dxf-system/utils/line-pipeline/builtin/wall-height-handle.d.ts +8 -0
  112. package/src/dxf-system/utils/line-pipeline/index.d.ts +22 -0
  113. package/src/dxf-system/utils/remove-dangline.d.ts +7 -0
  114. package/src/dxf-system/utils/tools.d.ts +91 -0
  115. package/src/index.css +1 -0
  116. package/src/index.js +1 -0
  117. package/src/index2.js +1 -0
  118. package/src/index3.js +1 -0
  119. package/src/main.d.ts +0 -0
  120. package/src/pages/CubeView.vue.d.ts +4 -0
  121. package/src/pages/DxfPreview.vue.d.ts +9 -0
  122. package/src/pages/Editor.vue.d.ts +8 -0
  123. package/src/pages/ExportGLB.vue.d.ts +2 -0
  124. package/src/pages/ImagePreview.vue.d.ts +9 -0
  125. package/src/pages/ModelView.vue.d.ts +11 -0
  126. package/src/pages/Setting.vue.d.ts +6 -0
  127. package/src/pages/Todo.vue.d.ts +2 -0
  128. package/src/pages/WallView.vue.d.ts +9 -0
  129. package/src/pages/WindowManager.vue.d.ts +2 -0
  130. package/src/pages/buildJson.vue.d.ts +4 -0
  131. package/src/pages/modelCarrier/index.vue.d.ts +4 -0
  132. package/src/router/index.d.ts +2 -0
  133. package/src/utils/EventDispatcher.d.ts +18 -0
  134. package/src/utils/algorithms/AlignToParallelSegments.d.ts +25 -0
  135. package/src/utils/algorithms/AxisAlignCorr.d.ts +38 -0
  136. package/src/utils/algorithms/Box2.d.ts +96 -0
  137. package/src/utils/algorithms/CheckPointCloudContinuity.d.ts +63 -0
  138. package/src/utils/algorithms/ConstraintSystem.d.ts +17 -0
  139. package/src/utils/algorithms/ConvexHullGraham.d.ts +16 -0
  140. package/src/utils/algorithms/Debouncing.d.ts +10 -0
  141. package/src/utils/algorithms/LineIndexGenerator.d.ts +12 -0
  142. package/src/utils/algorithms/LineQueryer.d.ts +42 -0
  143. package/src/utils/algorithms/LineSegment.d.ts +258 -0
  144. package/src/utils/algorithms/LineSegmentSpatialHash.d.ts +86 -0
  145. package/src/utils/algorithms/LineSegmentUtils.d.ts +185 -0
  146. package/src/utils/algorithms/Map.d.ts +38 -0
  147. package/src/utils/algorithms/MaxiCircles.d.ts +15 -0
  148. package/src/utils/algorithms/MiniCircles.d.ts +57 -0
  149. package/src/utils/algorithms/OBB.d.ts +30 -0
  150. package/src/utils/algorithms/PCSparseOctree.d.ts +56 -0
  151. package/src/utils/algorithms/Pipeline.d.ts +20 -0
  152. package/src/utils/algorithms/Point.d.ts +271 -0
  153. package/src/utils/algorithms/PointSpatialHash.d.ts +149 -0
  154. package/src/utils/algorithms/PointUtils.d.ts +47 -0
  155. package/src/utils/algorithms/Polygon.d.ts +164 -0
  156. package/src/utils/algorithms/PolygonUtils.d.ts +9 -0
  157. package/src/utils/algorithms/Quadtree.d.ts +89 -0
  158. package/src/utils/algorithms/Rectangle.d.ts +62 -0
  159. package/src/utils/algorithms/UndirectedGraph.d.ts +124 -0
  160. package/src/utils/algorithms/UnionFindSet.d.ts +12 -0
  161. package/src/utils/algorithms/ccw.d.ts +2 -0
  162. package/src/utils/algorithms/lazy.d.ts +14 -0
  163. package/src/utils/algorithms/precision.d.ts +3 -0
  164. package/src/utils/algorithms/stepElimination.d.ts +6 -0
  165. package/src/utils/algorithms/uuid.d.ts +1 -0
  166. package/src/utils/command/CommandFlow.d.ts +45 -0
  167. package/src/utils/command/CommandSystem.d.ts +96 -0
  168. package/src/utils/command/index.d.ts +2 -0
  169. package/src/utils/decorators/measure-time.d.ts +5 -0
  170. package/src/utils/ecs/Component.d.ts +18 -0
  171. package/src/utils/ecs/Container.d.ts +47 -0
  172. package/src/utils/ecs/index.d.ts +4 -0
  173. package/src/utils/geometry-manager/GeometryManager.d.ts +2 -0
  174. package/src/utils/index.d.ts +25 -0
  175. package/src/utils/modelScenario/bayWindow.d.ts +35 -0
  176. package/src/utils/modelScenario/scenario.d.ts +92 -0
  177. package/src/utils/three-object-3d/ExtrudeMesh.d.ts +11 -0
  178. package/src/utils/three-object-3d/LineAlignmentGuide.d.ts +20 -0
  179. package/src/utils/three-object-3d/Lines.d.ts +25 -0
  180. package/src/utils/three-object-3d/Lines2.d.ts +22 -0
  181. package/src/utils/three-object-3d/Shape2D.d.ts +61 -0
  182. package/src/utils/tools/GCHandle.d.ts +12 -0
  183. package/src/utils/tools/Gltf.d.ts +7 -0
  184. package/src/utils/tools/SnapLine.d.ts +19 -0
  185. package/src/utils/tools/StorageHelper.d.ts +8 -0
  186. package/src/utils/tools/clone-user-data.d.ts +7 -0
  187. package/src/utils/tools/create-html.d.ts +9 -0
  188. package/src/utils/tools/create-promise.d.ts +5 -0
  189. package/src/utils/tools/createVueApp.d.ts +1 -0
  190. package/src/utils/tools/download.d.ts +1 -0
  191. package/src/utils/tools/get-json.d.ts +5 -0
  192. package/src/utils/tools/include.d.ts +1 -0
  193. package/src/utils/tools/is-mobile.d.ts +2 -0
  194. package/src/utils/tools/repetitive-task.d.ts +1 -0
  195. package/src/utils/tools/selectLocal-file.d.ts +7 -0
@@ -0,0 +1,9 @@
1
+ import { LineSegment } from './LineSegment';
2
+ import { Polygon } from './Polygon';
3
+ export declare class PolygonUtils {
4
+ /** 拆分为凸包
5
+ * @returns
6
+ */
7
+ static splitConvexHull(ploy: Polygon): Polygon<Record<string, any>>[] | null;
8
+ static splitByLine(lines: LineSegment[], clipLine: LineSegment): LineSegment[][];
9
+ }
@@ -0,0 +1,89 @@
1
+ import { Box2 } from './Box2';
2
+ import { LineSegment } from './LineSegment';
3
+ import { Point } from './Point';
4
+ import { Rectangle } from './Rectangle';
5
+ export interface QuadtreeNode<T = any> {
6
+ line: LineSegment;
7
+ userData: T;
8
+ parent?: Quadtree;
9
+ }
10
+ export declare class Quadtree<T = any> {
11
+ bounds: Box2;
12
+ capacity: number;
13
+ maxDepth: number;
14
+ depth: number;
15
+ isLeaf: boolean;
16
+ children: Quadtree[] | null;
17
+ nodes: QuadtreeNode<T>[];
18
+ color: number[];
19
+ id: symbol;
20
+ constructor(bounds: Box2, capacity?: number, maxDepth?: number, depth?: number, id?: symbol);
21
+ /**
22
+ * 插入线段节点
23
+ * @param node 线段节点
24
+ */
25
+ insert(node: QuadtreeNode<T> | LineSegment, userData?: any): void;
26
+ /** 移除
27
+ * @param node
28
+ */
29
+ remove(node: QuadtreeNode<T> | LineSegment): void;
30
+ /** 移除
31
+ * @param node
32
+ */
33
+ update(node: QuadtreeNode<T> | LineSegment): void;
34
+ clear(): void;
35
+ /**
36
+ * 获取线段所属的象限
37
+ * @param line 线段
38
+ * @returns 象限索引(0:西北,1:东北,2:西南,3:东南)或-1(跨多个象限)
39
+ */
40
+ private getQuadrant;
41
+ /**
42
+ * 细分当前节点为四个子节点
43
+ */
44
+ private subdivide;
45
+ /**
46
+ * 查询与包围盒相交的线段节点
47
+ * @param box2 包围盒
48
+ * @returns 相交的节点数组
49
+ */
50
+ queryBox(box2: Box2): QuadtreeNode<T>[];
51
+ /**
52
+ * 查询与圆形区域相交的线段节点
53
+ * @param pos 圆心
54
+ * @param radius 半径
55
+ * @returns 相交的节点数组
56
+ */
57
+ queryCircle(pos: Point, radius: number): QuadtreeNode<T>[];
58
+ /**
59
+ * 查询与点相交的线段节点
60
+ * @param point 圆心
61
+ * @returns 相交的节点数组
62
+ */
63
+ queryPoint(point: Point): QuadtreeNode<T>[];
64
+ /**
65
+ * 查询与矩形相交的线段节点
66
+ * @param rectangle 矩形
67
+ * @returns 相交的节点数组
68
+ */
69
+ queryRect(rectangle: Rectangle): QuadtreeNode<T>[];
70
+ /**
71
+ * 查询与线段相交的线段节点
72
+ * @param lineSegment 线段
73
+ * @returns 相交的节点数组
74
+ */
75
+ queryLineSegment(lineSegment: LineSegment, endpoint?: boolean): QuadtreeNode<T>[];
76
+ raycast(origin: Point, direct: Point, near?: number, far?: number): {
77
+ targetLine: LineSegment;
78
+ intersectPoint: Point;
79
+ distance: number;
80
+ }[];
81
+ /**
82
+ * 包围盒转换为数组
83
+ * @param array
84
+ * @param colors
85
+ * @returns
86
+ */
87
+ boundsToArray(array?: number[], colors?: number[], recursion?: boolean): number[];
88
+ static from(lines: LineSegment[], userDataFun?: (line: LineSegment, index: number) => any): Quadtree<any>;
89
+ }
@@ -0,0 +1,62 @@
1
+ import { Box2 } from './Box2';
2
+ import { LineSegment } from './LineSegment';
3
+ import { Point, PointType } from './Point';
4
+ /**
5
+ * 非轴对称矩形
6
+ */
7
+ export declare class Rectangle {
8
+ points: Point[];
9
+ get p0(): Point<Record<string, any>>;
10
+ get p1(): Point<Record<string, any>>;
11
+ get p2(): Point<Record<string, any>>;
12
+ get p3(): Point<Record<string, any>>;
13
+ get path(): number[];
14
+ constructor(points?: PointType[]);
15
+ path2D(callback?: (point1: Point, point2: Point) => void): number[];
16
+ toLines(): LineSegment<Record<string, any>>[];
17
+ createGeometry(): number[];
18
+ /**
19
+ * 判断线段是否与矩形相交
20
+ * @param line 线段
21
+ * @returns 是否与矩形相交
22
+ */
23
+ intersectLineSegment(line: LineSegment): boolean;
24
+ /**
25
+ * 判断线段是否完全位于矩形内部
26
+ * @param line 线段
27
+ * @returns 是否完全在矩形内部
28
+ */
29
+ containsLineSegment(line: LineSegment): boolean;
30
+ /**
31
+ * 获取所有点在轴上的投影,并且返回区间
32
+ * @param rect
33
+ * @param axis
34
+ * @returns
35
+ */
36
+ private projectRectangle;
37
+ private isProjectionOverlap;
38
+ /**
39
+ * 判断矩形是否与矩形相交
40
+ * @description 使用分离轴定理
41
+ * @param rectangle 矩形
42
+ * @returns 是否与矩形相交
43
+ */
44
+ intersectRectangle(rectangle: Rectangle): boolean;
45
+ /**
46
+ * 判断点是否完全位于矩形内部
47
+ * @param point
48
+ */
49
+ containsPoint(point: Point): boolean;
50
+ /**
51
+ *
52
+ * @returns
53
+ */
54
+ toBox(out?: Box2): Box2;
55
+ /**
56
+ *
57
+ * @param line
58
+ * @param width
59
+ * @returns
60
+ */
61
+ static fromByLineSegment(line: LineSegment, width?: number, horizontal?: boolean, hScale?: number): Rectangle;
62
+ }
@@ -0,0 +1,124 @@
1
+ import { LineSegment } from './LineSegment';
2
+ import { Point } from './Point';
3
+ type EndType = "none" | "intersect" | "isolated";
4
+ export declare class UndirectedGraph {
5
+ protected adjacencyList: Map<number, Set<number>>;
6
+ get size(): number;
7
+ constructor();
8
+ addNode(node: number): void;
9
+ addEdge(u: number, v: number): void;
10
+ removeEdge(u: number, v: number): void;
11
+ removeNode(node: number): void;
12
+ getNeighbors(node: number): Set<number> | undefined;
13
+ printGraph(): void;
14
+ /** 获取能组成的所有路径
15
+ * @returns
16
+ */
17
+ getPaths(): number[][];
18
+ /** 循环
19
+ * @param callbackFun
20
+ */
21
+ forEach(callbackFun: (node: number, neighbors: Set<number>) => void): void;
22
+ /** 遍历边
23
+ * @param callbackFun
24
+ */
25
+ forEachEdge(callbackFun: (u: number, v: number) => void): void;
26
+ }
27
+ /**
28
+ * 线段无向图
29
+ */
30
+ export declare class LineSegmentUndirectedGraph extends UndirectedGraph {
31
+ private readonly lineMap;
32
+ private readonly pointToIndex;
33
+ private readonly indexToPoint;
34
+ private nextIndex;
35
+ constructor(lines?: readonly LineSegment[]);
36
+ private buildFromLines;
37
+ /**
38
+ * 获取两点之间的线段(无向)
39
+ */
40
+ getLine(a: number, b: number): LineSegment | undefined;
41
+ /** 获取所有线段
42
+ * @returns
43
+ */
44
+ getLineAll(): LineSegment<Record<string, any>>[];
45
+ /**
46
+ * 获取或创建点的索引
47
+ */
48
+ private getOrCreateIndex;
49
+ /**
50
+ * 安全获取点索引(已存在才返回)
51
+ */
52
+ getIndex(point: Point): number | undefined;
53
+ /**
54
+ * @param index
55
+ * @returns
56
+ */
57
+ getPoint(index: number): Point | undefined;
58
+ /**
59
+ * 获取所有点(只读数组,懒计算或缓存可进一步优化)
60
+ */
61
+ get points(): readonly Point[];
62
+ /**
63
+ * 获取所有线段
64
+ */
65
+ get lines(): readonly LineSegment[];
66
+ /**
67
+ * 批量添加线段(比逐条 addLine 更快)
68
+ */
69
+ addLines(lines: readonly LineSegment[]): this;
70
+ /** 批量移除线段边
71
+ * @param lines
72
+ */
73
+ removeLines(lines: readonly LineSegment[]): void;
74
+ /** 路径转线段组
75
+ * @param path
76
+ */
77
+ pathToLines(path: number[]): LineSegment<Record<string, any>>[];
78
+ /**
79
+ * 清空图
80
+ */
81
+ clear(): void;
82
+ /** 断点合并
83
+ * @description 合并断开的直线,断点
84
+ * @param lines
85
+ * @param callBack
86
+ * @returns
87
+ */
88
+ breakpointMerging(callBack?: (newLine: LineSegment, group: LineSegment[]) => void, removeLines?: Set<LineSegment<Record<string, any>>>, newLines?: LineSegment[]): void;
89
+ /**
90
+ * @param fun
91
+ */
92
+ forEachPathLine(
93
+ /**
94
+ * 遍历每条线段时的回调函数
95
+ * @param start 当前线段的起点
96
+ * @param end 当前线段的终点(start 和 end 只是线段的两端,顺序可能和原始线段相反)
97
+ * @param line 当前正在处理的线段对象
98
+ * @param index 当前线段在遍历过程中的序号(按遍历规则产生,并非原数组索引)
99
+ * @param endType 当前线段终点的性质:
100
+ * - noEnd → 这个终点不是整个路径的结尾点
101
+ * - "intersect" → 是路径的结尾点,但与其他线段有相交
102
+ * - "noIntersect" → 是路径的结尾点,且与其他线段无相交
103
+ * @param indexList 所有与当前起点相交、并且已经被遍历过的线段的遍历序号数组
104
+ */
105
+ fun: (start: Point, end: Point, line: LineSegment, index: number, endType: EndType, indexList: number[]) => void): void;
106
+ /** 断点合并
107
+ * @param lines
108
+ * @param callBack
109
+ * @param removeLines
110
+ * @param newLines
111
+ * @returns
112
+ */
113
+ static breakpointMerging(lines: LineSegment[], callBack?: (newLine: LineSegment, group: LineSegment[]) => void, removeLines?: Set<LineSegment<Record<string, any>>>, newLines?: LineSegment[]): LineSegment<Record<string, any>>[];
114
+ /** 线段图旋转
115
+ * @param lines
116
+ * @param angle 弧度
117
+ */
118
+ static rotate(lines: LineSegment[], angle: number, callbackFun?: (line: LineSegment, center: Point, angle: number) => void): LineSegment<Record<string, any>>[];
119
+ toJson(): {
120
+ points: readonly Point<Record<string, any>>[];
121
+ edges: [number, number][];
122
+ };
123
+ }
124
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ArrayMap } from './Map';
2
+ export declare class UnionFindSet {
3
+ private parent;
4
+ private rank;
5
+ constructor(size: number);
6
+ find(x: number): number;
7
+ union(x: number, y: number): void;
8
+ /** 获取所有集合
9
+ * @returns
10
+ */
11
+ getAllSets(): ArrayMap<number, number>;
12
+ }
@@ -0,0 +1,2 @@
1
+ import { LineSegment } from './LineSegment';
2
+ export declare function ccw(lines: LineSegment[]): LineSegment<Record<string, any>>[];
@@ -0,0 +1,14 @@
1
+ type JSValueType = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
2
+ export interface Lazy<T> {
3
+ readonly value: T;
4
+ readonly cachedValue: T | undefined;
5
+ readonly isValueCreated: boolean;
6
+ readonly valueType: JSValueType;
7
+ reset(): void;
8
+ }
9
+ /** 懒加载
10
+ * @param fn
11
+ * @returns
12
+ */
13
+ export declare function lazy<T>(fn: () => T): Lazy<T>;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function precision(value: number, count: number): number;
2
+ export declare function precision4(value: number): number;
3
+ export declare function precision4Nullable(value?: number | null): number | undefined;
@@ -0,0 +1,6 @@
1
+ import { LineSegment } from './LineSegment';
2
+ /** 路径阶梯合并
3
+ * @param lineSegments
4
+ * @returns
5
+ */
6
+ export declare function stepElimination(lineSegments: LineSegment[], findMinWidth?: number, onMerge?: (mainLine: LineSegment, sortLine: LineSegment, secondaryLine: LineSegment, oldLine: LineSegment) => void): LineSegment<Record<string, any>>[];
@@ -0,0 +1 @@
1
+ export declare function uuid(): string;
@@ -0,0 +1,45 @@
1
+ import { EventDispatcher } from '../ecs';
2
+ export type NextFn<T = any> = (data?: T) => void;
3
+ export type CommandFlowFn<IN = any, OUT = any> = (next: NextFn<OUT>, data?: IN) => void;
4
+ export declare class CommandFlow extends EventDispatcher<{
5
+ started: {};
6
+ executing: {
7
+ index: number;
8
+ };
9
+ executionCompleted: {
10
+ index: number;
11
+ data?: any;
12
+ };
13
+ executionInterrupt: {
14
+ index: number;
15
+ };
16
+ completed: {
17
+ data?: any;
18
+ };
19
+ finally: {};
20
+ }> {
21
+ list: CommandFlowFn[];
22
+ dataList: any[];
23
+ rollbacklist: ((data?: any) => void)[];
24
+ revokeRollbacklist: ((data?: any) => void)[];
25
+ writeOperationRecord: boolean;
26
+ loop: boolean;
27
+ currentIndex: number;
28
+ setLoop(loop: boolean): this;
29
+ /**
30
+ *
31
+ * @param operation
32
+ * @returns
33
+ */
34
+ add<T = Record<string, any>>(operation: CommandFlowFn, data?: T): this;
35
+ /** 添加回滚回调列表
36
+ * @param callBack
37
+ */
38
+ addRollback(callBack: (data?: any) => void): this;
39
+ /** 添加撤回回滚回调列表
40
+ * @param callBack
41
+ * @returns
42
+ */
43
+ addRevokeRollback(callBack: (data?: any) => void): this;
44
+ getData<T = Record<string, any>>(index: number): T;
45
+ }
@@ -0,0 +1,96 @@
1
+ import { EventDispatcher } from '../ecs';
2
+ import { CommandFlow } from './CommandFlow';
3
+ export type Operation = {
4
+ name: string;
5
+ data: any;
6
+ };
7
+ type CommandFlowMap<T extends CommandFlow = CommandFlow> = Map<string, T>;
8
+ export declare class CommandManager extends EventDispatcher<{
9
+ startedBefore: {
10
+ name: string;
11
+ currentName: string | null;
12
+ };
13
+ started: {
14
+ name: string;
15
+ };
16
+ cancel: {
17
+ name: string;
18
+ };
19
+ executing: {
20
+ name: string;
21
+ index: number;
22
+ };
23
+ executionCompleted: {
24
+ name: string;
25
+ index: number;
26
+ data?: any;
27
+ };
28
+ executionInterrupt: {
29
+ name: string;
30
+ index: number;
31
+ };
32
+ completed: {
33
+ name: string;
34
+ data?: any;
35
+ };
36
+ finally: {
37
+ name: string;
38
+ };
39
+ rollback: {
40
+ name: string;
41
+ };
42
+ revokeRollback: {
43
+ name: string;
44
+ };
45
+ }> {
46
+ commandFlowMap: CommandFlowMap;
47
+ lock: boolean;
48
+ private abortController;
49
+ private resolve;
50
+ currentName: string | null;
51
+ private _disabled;
52
+ set disabled(disabled: boolean);
53
+ get disabled(): boolean;
54
+ /**
55
+ * 操作记录
56
+ */
57
+ operationList: Operation[];
58
+ rollbackList: Operation[];
59
+ constructor();
60
+ /** 写入记录
61
+ * @param name
62
+ * @param data
63
+ */
64
+ addOperation(name: string, data: Record<string, any>): void;
65
+ /** 添加命令流
66
+ * @param name
67
+ * @param custom 自定义命令流类
68
+ * @returns
69
+ */
70
+ addCommandFlow<T extends CommandFlow = CommandFlow>(name: string, custom?: () => T): CommandFlow;
71
+ /** 获取命令流
72
+ * @param name
73
+ * @returns
74
+ */
75
+ getCommandFlow<T extends CommandFlow = CommandFlow>(name: string): T | undefined;
76
+ private executionPromise;
77
+ private executionResolve;
78
+ /** 执行控制流
79
+ * @param name
80
+ * @returns
81
+ */
82
+ start(name: string, data?: any, step?: number): Promise<any>;
83
+ /** 取消当前命令
84
+ */
85
+ cancel(): void;
86
+ /**
87
+ * 回滚
88
+ */
89
+ rollback(): boolean;
90
+ /**
91
+ * 撤销回滚
92
+ */
93
+ revokeRollback(): boolean;
94
+ destroy(): void;
95
+ }
96
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './CommandFlow';
2
+ export * from './CommandSystem';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 老版 TypeScript 装饰器(experimentalDecorators)
3
+ * 打印函数执行耗时
4
+ */
5
+ export declare function MeasureTime(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -0,0 +1,18 @@
1
+ import { ComponentContainer } from './Container';
2
+ import { EventDispatcher } from '../EventDispatcher';
3
+ export declare class Component<TEventMap extends {} = {}> extends EventDispatcher<{
4
+ addFromParent: {
5
+ parent: ComponentContainer;
6
+ };
7
+ removeFromParent: {
8
+ parent: ComponentContainer;
9
+ };
10
+ update: {};
11
+ } & TEventMap> {
12
+ parent?: ComponentContainer;
13
+ destroyed: boolean;
14
+ constructor(...arg: any[]);
15
+ onAddFromParent(parent: ComponentContainer): void;
16
+ onRemoveFromParent(parent: ComponentContainer): void;
17
+ destroy(): void;
18
+ }
@@ -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 ComponentContainer<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<{}>[];
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,4 @@
1
+ export * from './Component';
2
+ export * from './Container';
3
+ export * from '../EventDispatcher';
4
+ export * from '../algorithms/uuid';
@@ -0,0 +1,2 @@
1
+ export declare class GeometryManager {
2
+ }
@@ -0,0 +1,25 @@
1
+ export * from './algorithms/Box2';
2
+ export * from './algorithms/LineIndexGenerator';
3
+ export * from './algorithms/LineSegment';
4
+ export * from './algorithms/LineSegmentUtils';
5
+ export * from './three-object-3d/Lines';
6
+ export * from './algorithms/Map';
7
+ export * from './algorithms/Point';
8
+ export * from './algorithms/PointUtils';
9
+ export * from './algorithms/Polygon';
10
+ export * from './algorithms/Quadtree';
11
+ export * from './algorithms/Rectangle';
12
+ export * from './algorithms/UndirectedGraph';
13
+ export * from './algorithms/UnionFindSet';
14
+ export * from './tools/clone-user-data';
15
+ export * from './tools/selectLocal-file';
16
+ export * from './algorithms/PointSpatialHash';
17
+ export * from './command';
18
+ export * from './ecs';
19
+ export * from './tools/Gltf';
20
+ export * from './algorithms/MaxiCircles';
21
+ export * from './algorithms/MiniCircles';
22
+ export * from './algorithms/OBB';
23
+ export * from './algorithms/PCSparseOctree';
24
+ export * from './algorithms/CheckPointCloudContinuity';
25
+ export * from './tools/SnapLine';
@@ -0,0 +1,35 @@
1
+ import { Point } from '../algorithms/Point';
2
+ import * as THREE from 'three';
3
+ export declare const DEFAULT_WALL_HALF_WIDTH: number;
4
+ export default class BayWindow {
5
+ bayWindowExpansion: any;
6
+ dottedLinePoints: any;
7
+ singleLine: any;
8
+ bayWindowArea: any;
9
+ bayWindowGroup: THREE.Group;
10
+ private static _instance?;
11
+ static get Instance(): BayWindow | undefined;
12
+ constructor();
13
+ overhangTreatment(data: any, singleLine: any): void;
14
+ dashedLineTreatment(data: any, centroidPoint: any, item: any): void;
15
+ bayWindowExecutionOffset(data: any, index: number, wallHeight: number, item?: any, statuc?: boolean): {
16
+ mesh1: THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
17
+ mesh2: THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
18
+ mesh3: THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
19
+ points3: THREE.Vector3[];
20
+ } | undefined;
21
+ createDashedLineCeilingWall(startingPoint: any, index: number | string, item: any, num: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | null;
22
+ angleToXAxisDegrees(x1: number, y1: number, x2: number, y2: number, wide: number, cd: boolean): number;
23
+ windowOpeningOffset(x: number, y: number, point: THREE.Vector3 | Point, wallHeight: number): THREE.Vector3[];
24
+ xinLine(x: number, y: number, point: THREE.Vector3 | Point, wallHeight: number): THREE.Vector3[];
25
+ xinLine1(x: number, y: number, pointa: THREE.Vector3, pointb: THREE.Vector3, num: number, wallHeight?: number): THREE.Vector3[];
26
+ getPolygonCentroid(points: any): {
27
+ x: number;
28
+ y: number;
29
+ z: any;
30
+ };
31
+ pointSideOfLine(p1: THREE.Vector3, p2: THREE.Vector3, p: any): 0 | 1 | -1;
32
+ windowTreatment(dblWin: any, mesh: any, wallHeight: number, startingPoint: any, data: any): import('three-bvh-csg').Brush;
33
+ installWindows(data: any, index: string, startingPoint: any): void;
34
+ createBayWindowLayout(listS: any, objData: any): void;
35
+ }