build-dxf 0.1.14 → 0.1.16

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 (58) hide show
  1. package/package.json +1 -1
  2. package/src/DomEventRegister.js +472 -0
  3. package/src/build.js +3065 -3352
  4. package/src/index.css +1 -131
  5. package/src/index.js +10 -10
  6. package/src/index2.js +2 -155
  7. package/src/index3.js +6295 -2640
  8. package/src/utils/DxfSystem/DxfSystem.d.ts +0 -3
  9. package/src/utils/DxfSystem/components/CorrectionDxf.d.ts +26 -2
  10. package/src/utils/DxfSystem/components/Dxf.d.ts +3 -2
  11. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +1 -2
  12. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +7 -2
  13. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +1 -1
  14. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +2 -3
  15. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +3 -5
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +2 -3
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +1 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +2 -3
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +1 -1
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{IntersectionConnectionLine.d.ts → TwoLineConnectionLine.d.ts} +3 -3
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{ConnectionLine.d.ts → TwoPointConnection.d.ts} +3 -3
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{VerticalCorrection.d.ts → VerticalCorr.d.ts} +2 -12
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{DeleteSelectWindow.d.ts → VerticalCorrContinue.d.ts} +10 -8
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +1 -1
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ViewAngle.d.ts +1 -1
  26. package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -1
  27. package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +1 -0
  28. package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +1 -2
  29. package/src/utils/DxfSystem/type.d.ts +2 -0
  30. package/src/utils/DxfSystem/utils/DoorFind.d.ts +36 -0
  31. package/src/utils/{modelScenario → DxfSystem/utils}/SceneAutoGenerat.d.ts +3 -1
  32. package/src/utils/DxfSystem/utils/index.d.ts +1 -5
  33. package/src/utils/LineSegment.d.ts +9 -0
  34. package/src/utils/Map.d.ts +1 -0
  35. package/src/utils/MaxiCircles.d.ts +13 -0
  36. package/src/utils/MiniCircles.d.ts +33 -0
  37. package/src/utils/Point.d.ts +1 -1
  38. package/src/utils/{PointVirtualGrid/index.d.ts → PointVirtualGrid.d.ts} +5 -5
  39. package/src/utils/Polygon.d.ts +11 -0
  40. package/src/utils/UndirectedGraph.d.ts +4 -0
  41. package/src/utils/index.d.ts +4 -2
  42. package/src/bin/Main.js +0 -269
  43. package/src/bin/mini_cycles.js +0 -15
  44. package/src/bin/mini_cycles.wasm +0 -0
  45. package/src/bin/mini_cycles.wasm.map +0 -1
  46. package/src/bin/wasm_mini_cycles.js +0 -296
  47. package/src/index4.js +0 -4261
  48. package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +0 -115
  49. package/src/utils/DxfSystem/plugin/RenderPlugin/pages/Dxf.vue.d.ts +0 -21
  50. package/src/utils/DxfSystem/utils/closedPathArea.d.ts +0 -2
  51. package/src/utils/DxfSystem/utils/findClosedPolygons.d.ts +0 -14
  52. package/src/utils/DxfSystem/utils/findLargestCircle.d.ts +0 -14
  53. package/src/utils/DxfSystem/utils/mergeSmallestCircle.d.ts +0 -14
  54. package/src/utils/DxfSystem/utils/smallestCircle.d.ts +0 -6
  55. package/src/utils/deepClone.d.ts +0 -6
  56. package/src/utils/drawLinePathToPng.d.ts +0 -7
  57. /package/src/utils/{Lines.d.ts → DxfSystem/utils/Lines.d.ts} +0 -0
  58. /package/src/utils/{LoadModel.d.ts → DxfSystem/utils/LoadModel.d.ts} +0 -0
@@ -1,13 +1,11 @@
1
1
  import { ComponentManager } from '../ComponentManager';
2
2
  import { CorrectionDxf } from './components/CorrectionDxf';
3
- import { DoorsAnalysisComponent } from './components/DoorsAnalysis';
4
3
  import { Dxf } from './components/Dxf';
5
4
  import { ThreeVJia } from './components/ThreeVJia';
6
5
  import { Variable } from './components/Variable';
7
6
  export declare class DxfSystem extends ComponentManager {
8
7
  Dxf: Dxf;
9
8
  Variable: Variable;
10
- DoorsAnalysis: DoorsAnalysisComponent;
11
9
  CorrectionDxf: CorrectionDxf;
12
10
  wallWidth: number;
13
11
  environment: "node" | "browser" | "unknown";
@@ -23,7 +21,6 @@ declare const components: {
23
21
  ThreeVJia: typeof ThreeVJia;
24
22
  Variable: typeof Variable;
25
23
  Dxf: typeof Dxf;
26
- DoorsAnalysisComponent: typeof DoorsAnalysisComponent;
27
24
  CorrectionDxf: typeof CorrectionDxf;
28
25
  };
29
26
  export { components };
@@ -1,4 +1,5 @@
1
- import { SetDataOption, OriginalDataItem } from '../type';
1
+ import { SetDataOption, OriginalDataItem, Unit } from '../type';
2
+ import { CAD } from '../utils/CAD';
2
3
  import { DxfSystem } from '../DxfSystem';
3
4
  import { Dxf } from './Dxf';
4
5
  /**
@@ -6,7 +7,9 @@ import { Dxf } from './Dxf';
6
7
  */
7
8
  export declare class CorrectionDxf<TEventMap extends {} = {}> extends Dxf<{} & TEventMap> {
8
9
  static name: string;
9
- static readonly PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", (lines: import('../..').LineSegment[], option: SetDataOption) => import('../..').LineSegment[]>;
10
+ static readonly PRE_PROCESSOR: Record<"DoorFind" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter" | "WallHeightHandle" | "Clipping" | "RemoveShortLine", (lines: import('../..').LineSegment[], option: SetDataOption) => import('../..').LineSegment[]>;
11
+ rotateCorrCad?: CAD;
12
+ constructor();
10
13
  onAddFromParent(parent: DxfSystem): void;
11
14
  /** 设置
12
15
  * @param data 房屋结构数据,node环境可以为路径
@@ -17,4 +20,25 @@ export declare class CorrectionDxf<TEventMap extends {} = {}> extends Dxf<{} & T
17
20
  * @returns
18
21
  */
19
22
  set(data: OriginalDataItem[], options?: SetDataOption): any;
23
+ /** 获取 dxf 图片 二进制对象
24
+ * @param type
25
+ */
26
+ toRCDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
27
+ /** 下载 dxf 图片
28
+ * @param filename
29
+ */
30
+ downloadRCDxfImage(filename: string, unit?: Unit, type?: string): Promise<boolean | undefined>;
31
+ /**
32
+ * 将点json结构转换为Dxf 字符串
33
+ */
34
+ toRCDxfString(unit?: Unit): string | undefined;
35
+ /**
36
+ * 将点云结构转换为 DXF 二进制对象
37
+ * @returns
38
+ */
39
+ toRCDxfBlob(unit?: Unit): Blob | undefined;
40
+ /** 下载Dxf
41
+ * @param filename
42
+ */
43
+ downloadRCDxf(filename: string, unit?: Unit): Promise<void | undefined>;
20
44
  }
@@ -5,7 +5,7 @@ import { Quadtree } from '../../Quadtree';
5
5
  import { SetDataOption, DataItem, LineUserData, OriginalDataItem, Unit } from '../type';
6
6
  import { CAD } from '../utils/CAD';
7
7
  type PreProcessor = (lines: LineSegment[], option: SetDataOption) => LineSegment[];
8
- export declare const PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", PreProcessor>;
8
+ export declare const PRE_PROCESSOR: Record<"DoorFind" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter" | "WallHeightHandle" | "Clipping" | "RemoveShortLine", PreProcessor>;
9
9
  /**
10
10
  * 将点云结构转换为DXF格式
11
11
  */
@@ -22,7 +22,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
22
22
  };
23
23
  } & TEventMap> {
24
24
  static name: string;
25
- static readonly PRE_PROCESSOR: Record<"DoorsAnalysis" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter", PreProcessor>;
25
+ static readonly PRE_PROCESSOR: Record<"DoorFind" | "AxisAlignCorr" | "BoundExt" | "AngleCorr" | "ResetGeometricCenter" | "WallHeightHandle" | "Clipping" | "RemoveShortLine", PreProcessor>;
26
26
  width: number;
27
27
  originalData: OriginalDataItem[];
28
28
  data: DataItem[];
@@ -33,6 +33,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
33
33
  verticalReferenceLine?: LineSegment<LineUserData>;
34
34
  originalZAverage: number;
35
35
  private _preProcessorSet;
36
+ protected _staticPreProcessorSet: PreProcessor[];
36
37
  /** 原始数据组
37
38
  */
38
39
  get lines(): LineSegment<LineUserData>[];
@@ -9,8 +9,7 @@ export declare class ClippingLine extends CommandFlowComponent<{
9
9
  }> {
10
10
  static name: string;
11
11
  container: THREE.Group<THREE.Object3DEventMap>;
12
- shortcutKeys: string[];
13
- commandName: string;
12
+ static shortcutKeys: string[];
14
13
  static commandName: string;
15
14
  onAddFromParent(parent: ComponentManager): void;
16
15
  /** 选择开始点
@@ -7,6 +7,9 @@ import { Default } from './Default';
7
7
  import { LineSegment } from '../../../../../LineSegment';
8
8
  import { Point } from '../../../../../Point';
9
9
  export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Component<TEventMap & {}> {
10
+ static interruptKeys: string[];
11
+ static confirmKeys: string[];
12
+ static shortcutKeys: string[];
10
13
  private _renderer?;
11
14
  get renderer(): Renderer;
12
15
  private _domElement?;
@@ -21,8 +24,10 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
21
24
  get commandManager(): CommandManager;
22
25
  private _default?;
23
26
  get default(): Default;
24
- interruptKeys: string[];
25
- commandName: string;
27
+ get commandName(): string;
28
+ get interruptKeys(): string[];
29
+ get shortcutKeys(): string[];
30
+ get confirmKeys(): string[];
26
31
  constructor();
27
32
  onAddFromParent(parent: ComponentManager): void;
28
33
  /**
@@ -5,7 +5,7 @@ import { ComponentManager } from '../../../../../ComponentManager';
5
5
  */
6
6
  export declare class DeleteSelectLine extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
- shortcutKeys: string[];
8
+ static shortcutKeys: string[];
9
9
  static commandName: string;
10
10
  onAddFromParent(parent: ComponentManager): void;
11
11
  /**
@@ -8,9 +8,8 @@ export declare class DrawDoorLine extends CommandFlowComponent<{
8
8
  }> {
9
9
  static name: string;
10
10
  container: THREE.Group<THREE.Object3DEventMap>;
11
- interruptKeys: string[];
12
- shortcutKeys: string[];
13
- commandName: string;
11
+ static shortcutKeys: string[];
12
+ static commandName: string;
14
13
  onAddFromParent(parent: ComponentManager): void;
15
14
  /** 选择点
16
15
  * @param next
@@ -15,11 +15,9 @@ export declare class DrawLine extends CommandFlowComponent<{
15
15
  }> {
16
16
  static name: string;
17
17
  container: THREE.Group<THREE.Object3DEventMap>;
18
- interruptKeys: string[];
19
- withdrawalKeys: string[];
20
- shortcutKeys: string[];
21
- confirmKeys: string[];
22
- commandName: string;
18
+ static withdrawalKeys: string[];
19
+ static shortcutKeys: string[];
20
+ static commandName: string;
23
21
  onAddFromParent(parent: ComponentManager): void;
24
22
  /** 选择点
25
23
  * @param next
@@ -10,9 +10,8 @@ export declare class DrawWindow extends CommandFlowComponent<{
10
10
  }> {
11
11
  static name: string;
12
12
  container: THREE.Group<THREE.Object3DEventMap>;
13
- interruptKeys: string[];
14
- shortcutKeys: string[];
15
- commandName: string;
13
+ static shortcutKeys: string[];
14
+ static commandName: string;
16
15
  onAddFromParent(parent: ComponentManager): void;
17
16
  /** 选择开始点
18
17
  * @param next
@@ -5,7 +5,7 @@ import { ComponentManager } from '../../../../../ComponentManager';
5
5
  */
6
6
  export declare class MergeLine extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
- shortcutKeys: string[];
8
+ static shortcutKeys: string[];
9
9
  static commandName: string;
10
10
  onAddFromParent(parent: ComponentManager): void;
11
11
  /**
@@ -9,9 +9,8 @@ export declare class PointDrag extends CommandFlowComponent<{
9
9
  }> {
10
10
  static name: string;
11
11
  container: THREE.Group<THREE.Object3DEventMap>;
12
- interruptKeys: string[];
13
- shortcutKeys: string[];
14
- commandName: string;
12
+ static shortcutKeys: string[];
13
+ static commandName: string;
15
14
  onAddFromParent(parent: ComponentManager): void;
16
15
  /** 选择开始点
17
16
  * @param next
@@ -8,7 +8,7 @@ import * as THREE from "three";
8
8
  export declare class SelectAll extends CommandFlowComponent<{}> {
9
9
  static name: string;
10
10
  container: THREE.Group<THREE.Object3DEventMap>;
11
- shortcutKeys: string[];
11
+ static shortcutKeys: string[];
12
12
  static commandName: string;
13
13
  onAddFromParent(parent: ComponentManager): void;
14
14
  /** 开始
@@ -1,11 +1,11 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { ComponentManager } from '../../../../../ComponentManager';
3
3
  /**
4
- * 连接选择的线段
4
+ * 两线段链接
5
5
  */
6
- export declare class IntersectionConnectionLine extends CommandFlowComponent<{}> {
6
+ export declare class TwoLineConnectionLine extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
- shortcutKeys: string[];
8
+ static shortcutKeys: string[];
9
9
  static commandName: string;
10
10
  onAddFromParent(parent: ComponentManager): void;
11
11
  /**
@@ -1,11 +1,11 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { ComponentManager } from '../../../../../ComponentManager';
3
3
  /**
4
- * 连接选择的线段
4
+ * 两点链接
5
5
  */
6
- export declare class ConnectionLine extends CommandFlowComponent<{}> {
6
+ export declare class TwoPointConnection extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
- shortcutKeys: string[];
8
+ static shortcutKeys: string[];
9
9
  static commandName: string;
10
10
  onAddFromParent(parent: ComponentManager): void;
11
11
  /**
@@ -7,13 +7,11 @@ import * as THREE from "three";
7
7
  /**
8
8
  * 垂直纠正
9
9
  */
10
- export declare class VerticalCorrection extends CommandFlowComponent<{}> {
10
+ export declare class VerticalCorr extends CommandFlowComponent<{}> {
11
11
  static name: string;
12
12
  container: THREE.Group<THREE.Object3DEventMap>;
13
- shortcutKeys: string[];
14
- shortcutKeys3: string[];
13
+ static shortcutKeys: string[];
15
14
  static commandName: string;
16
- axisAlignment: boolean;
17
15
  onAddFromParent(parent: ComponentManager): void;
18
16
  /**
19
17
  * 进入命令约束
@@ -48,14 +46,6 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
48
46
  * @param vistedList
49
47
  */
50
48
  correction(targettLine: LineSegment, resultList?: any[], vistedList?: Set<LineSegment>): any[];
51
- /** 轴对齐垂直修正
52
- * @param targettLine
53
- * @returns
54
- */
55
- axisAlignmentCorrection(targettLine: LineSegment): {
56
- newLines: LineSegment<any>[];
57
- oldLines: LineSegment<LineUserData>[];
58
- };
59
49
  /** 开始
60
50
  * @param next
61
51
  */
@@ -1,24 +1,26 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { ComponentManager } from '../../../../../ComponentManager';
3
+ import { LineSegment } from '../../../../../LineSegment';
4
+ import * as THREE from "three";
3
5
  /**
4
- * 删除选择的线段上的窗户线
6
+ * 连续垂直纠正
5
7
  */
6
- export declare class DeleteSelectWindow extends CommandFlowComponent<{}> {
8
+ export declare class VerticalCorrContinue extends CommandFlowComponent<{}> {
7
9
  static name: string;
8
- shortcutKeys: string[];
10
+ container: THREE.Group<THREE.Object3DEventMap>;
11
+ static shortcutKeys: string[];
9
12
  static commandName: string;
10
13
  onAddFromParent(parent: ComponentManager): void;
11
14
  /**
12
15
  * 进入命令约束
13
16
  */
14
- private constraint;
17
+ constraint(next: any, selectLines: LineSegment[]): void;
15
18
  /** 开始
16
19
  * @param next
17
20
  */
18
- private end;
19
- /**
20
- * 完成
21
- * @param list
21
+ verticalCorrection(next: any, selectLines: LineSegment[]): void;
22
+ /** 执行完成
23
+ * @param data
22
24
  */
23
25
  private completed;
24
26
  /** 回滚操作
@@ -5,7 +5,7 @@ import { ComponentManager } from '../../../../../ComponentManager';
5
5
  */
6
6
  export declare class VerticalReferenceLine extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
- shortcutKeys: string[];
8
+ static shortcutKeys: string[];
9
9
  static commandName: string;
10
10
  onAddFromParent(parent: ComponentManager): void;
11
11
  /**
@@ -5,7 +5,7 @@ import { ComponentManager } from '../../../../../ComponentManager';
5
5
  */
6
6
  export declare class ViewAngle extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
- shortcutKeys: string[];
8
+ static shortcutKeys: string[];
9
9
  static commandName: string;
10
10
  onAddFromParent(parent: ComponentManager): void;
11
11
  /**
@@ -3,4 +3,4 @@ export * from './CommandFlow/Default';
3
3
  export * from './CommandFlow/DrawDoorLine';
4
4
  export * from './CommandFlow/DrawLine';
5
5
  export * from './CommandFlow/DrawWindow';
6
- export * from './CommandFlow/VerticalCorrection';
6
+ export * from './CommandFlow/VerticalCorr';
@@ -45,6 +45,7 @@ export declare class Renderer extends Component<{
45
45
  html2DRenderer?: CSS2DRenderer;
46
46
  html3DRenderer?: CSS3DRenderer;
47
47
  container: THREE.Group<THREE.Object3DEventMap>;
48
+ container2: THREE.Group<THREE.Object3DEventMap>;
48
49
  onUpdate?: () => void;
49
50
  onResize?: (width: number, height: number) => void;
50
51
  width: number;
@@ -1,5 +1,4 @@
1
1
  import { DxfSystem } from '../../DxfSystem';
2
- import { default as Dxf3DView } from './pages/Dxf.vue';
3
2
  import * as components from "./components";
4
3
  import * as THREE from "three";
5
4
  type Option = {
@@ -11,4 +10,4 @@ declare function RenderPlugin_(dxfSystem: DxfSystem, option?: Option): void;
11
10
  declare const RenderPlugin: typeof RenderPlugin_ & {
12
11
  create(option?: Option): (dxfSystem: DxfSystem) => void;
13
12
  };
14
- export { components, RenderPlugin, Dxf3DView };
13
+ export { components, RenderPlugin };
@@ -137,6 +137,8 @@ export type SetDataOption = {
137
137
  trajectory?: Record<string, any>;
138
138
  onBoundExt?: (lines: LineSegment[], trajectory: any) => void;
139
139
  publicInfo?: IPublicInfoFile;
140
+ originalZ?: number;
141
+ minWidth?: number;
140
142
  };
141
143
  /**
142
144
  *
@@ -0,0 +1,36 @@
1
+ import { LineSegment } from '../../LineSegment';
2
+ import { LineUserData } from '../type';
3
+ import { PointVirtualGrid } from '../../PointVirtualGrid';
4
+ import { Quadtree } from '../../Quadtree';
5
+ import { Point } from '../../Point';
6
+ interface IDockInfo {
7
+ dockLine: LineSegment<LineUserData>;
8
+ dockPoint: Point<Record<string, any>>;
9
+ point: Point<Record<string, any>>;
10
+ pointType: string;
11
+ }
12
+ export declare class DoorFind {
13
+ lines: LineSegment[];
14
+ grid: PointVirtualGrid<LineSegment<LineUserData>>;
15
+ quadtree: Quadtree<LineSegment<LineUserData>>;
16
+ constructor(lines: LineSegment<LineUserData>[]);
17
+ /** 处理封闭门
18
+ * @param line
19
+ * @returns
20
+ */
21
+ private findCloseDoors;
22
+ /** 处理开门
23
+ * @param line
24
+ * @returns
25
+ */
26
+ findOpenDoors(line: LineSegment<LineUserData>): void;
27
+ /** 对门的两侧进行吸附
28
+ * @description
29
+ * @param dock
30
+ * @param line
31
+ * @returns
32
+ */
33
+ adsorpt(dock: IDockInfo, line: LineSegment): Point<Record<string, any>> | null;
34
+ getLines(): LineSegment<Record<string, any>>[];
35
+ }
36
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { Group } from 'three';
2
- import { LineSegment } from '../LineSegment';
2
+ import { LineSegment } from '../../LineSegment';
3
+ import { LineUserData } from '../type';
3
4
  import * as THREE from "three";
4
5
  export declare class SceneAutoGenerat {
5
6
  lines: LineSegment[];
@@ -10,6 +11,7 @@ export declare class SceneAutoGenerat {
10
11
  angle: number;
11
12
  constructor(lines: LineSegment[], itemList: any[], z: number, trajectory?: any);
12
13
  init(): Promise<void>;
14
+ buildPlane(lines: LineSegment<LineUserData>[]): void;
13
15
  wallGroup: Group | null;
14
16
  /** 构建墙壁
15
17
  */
@@ -5,8 +5,6 @@ export * from './lineSegmentClipping';
5
5
  export * from './DoubleWallHelper';
6
6
  export * from './clippingDoubleWall';
7
7
  export * from './clippingLineUserData';
8
- export * from './closedPathArea';
9
- export * from './findLargestCircle';
10
8
  export * from './findDiscretePointLine';
11
9
  export * from './findVerticalReference';
12
10
  export * from './mergeLineUserData';
@@ -14,8 +12,6 @@ export * from './originalDataToLineData';
14
12
  export * from './recomputedWindow';
15
13
  export * from './buildGroup';
16
14
  export * from './LineGroupType';
17
- export * from './findClosedPolygons';
18
15
  export * from './lineDataToThreeVJiaJson';
19
- export * from './mergeSmallestCircle';
20
- export * from './smallestCircle';
16
+ export * from './SceneAutoGenerat';
21
17
  export * as tools from './tools';
@@ -109,6 +109,10 @@ export declare class LineSegment<T = Record<string, any>> {
109
109
  */
110
110
  cachedLength: number | null;
111
111
  length(cached?: boolean): number;
112
+ /** 获取点距离线段的长度(直线距离)
113
+ * @param point
114
+ */
115
+ distancePoint(point: Point): number;
112
116
  /**
113
117
  * 计算一条线段在另一条直线上的投影,并裁剪超出目标线段的部分
114
118
  * @param line 要投影的线段
@@ -182,6 +186,11 @@ export declare class LineSegment<T = Record<string, any>> {
182
186
  * @param line
183
187
  */
184
188
  isParallel(line: LineSegment, errAngle?: number): boolean;
189
+ /** 获取点在线段上的叉积
190
+ * @param point
191
+ * @returns
192
+ */
193
+ cross(point: Point): number;
185
194
  /** 判断点在当前线段的左边还是右边,或者线段上
186
195
  * @param point
187
196
  */
@@ -14,6 +14,7 @@ export declare class MapEnhance<K, V> extends Map<K, V> {
14
14
  }
15
15
  export declare class ArrayMap<K, V> extends MapEnhance<K, V[]> {
16
16
  append(k: K, ...arr: V[]): this;
17
+ remove(k: K, ...arr: V[]): this;
17
18
  }
18
19
  export declare class SetMap<K, V> extends MapEnhance<K, Set<V>> {
19
20
  append(k: K, ...arr: V[]): this;
@@ -0,0 +1,13 @@
1
+ import { LineSegment } from './LineSegment';
2
+ import { MiniCircles } from './MiniCircles';
3
+ export declare class MaxiCircles extends MiniCircles {
4
+ mergeCircles(circles: LineSegment[][], test?: boolean): {
5
+ internalEdges: LineSegment<Record<string, any>>[];
6
+ circles: LineSegment<Record<string, any>>[][];
7
+ };
8
+ maxiCircles(lines: LineSegment[]): {
9
+ newLines: LineSegment<Record<string, any>>[];
10
+ circles: LineSegment<Record<string, any>>[][];
11
+ internalEdges: LineSegment<Record<string, any>>[];
12
+ };
13
+ }
@@ -0,0 +1,33 @@
1
+ import { LineSegment } from './LineSegment';
2
+ import { LineSegmentUndirectedGraph } from './UndirectedGraph';
3
+ import { ArrayMap } from './Map';
4
+ export declare enum Side {
5
+ ALL = 0,
6
+ OUT = 1,
7
+ IN = 2
8
+ }
9
+ export interface MiniCirclesOption {
10
+ side?: Side;
11
+ circleEdges?: LineSegment[];
12
+ }
13
+ export declare class MiniCircles {
14
+ /** 通过并查集,查找为环的一部分边
15
+ * @description
16
+ * @param lines
17
+ */
18
+ findCircleOneEdge(lineUG_: LineSegment[] | LineSegmentUndirectedGraph): LineSegment<Record<string, any>>[];
19
+ /** 环去重
20
+ * @param rings
21
+ */
22
+ deduplicate(rings: LineSegment[][]): LineSegment<Record<string, any>>[][];
23
+ /** 通过方向点查找环
24
+ * @description 通过 findCircleOneEdge 查找 到ringEdges,然后在一条条的找,类似迷宫算法的左右手原则
25
+ * @param lines
26
+ * @param ringEdges
27
+ */
28
+ miniCircle(lines: LineSegment[], option?: MiniCirclesOption): {
29
+ circles: LineSegment<Record<string, any>>[][];
30
+ setMap: ArrayMap<LineSegment<Record<string, any>>, Set<LineSegment<Record<string, any>>>>;
31
+ circleEdges: LineSegment<Record<string, any>>[];
32
+ };
33
+ }
@@ -144,7 +144,7 @@ export declare class Point<T = Record<string, any>> {
144
144
  * 克隆
145
145
  * @returns
146
146
  */
147
- clone(): Point<Record<string, any>>;
147
+ clone(template?: Point<Record<string, any>>): Point<Record<string, any>>;
148
148
  /**
149
149
  * 克隆
150
150
  * @returns
@@ -1,7 +1,7 @@
1
- import { Box2 } from '../Box2';
2
- import { Point } from '../Point';
3
- import { Polygon } from '../Polygon';
4
- import { Rectangle } from '../Rectangle';
1
+ import { Box2 } from './Box2';
2
+ import { Point } from './Point';
3
+ import { Polygon } from './Polygon';
4
+ import { Rectangle } from './Rectangle';
5
5
  type Target<T> = {
6
6
  point: Point;
7
7
  userData?: T;
@@ -67,7 +67,7 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
67
67
  * @param radius 半径
68
68
  * @returns 相交的节点数组
69
69
  */
70
- queryCircle(pos: Point, radius: number): {
70
+ queryCircle(pos: Point, radius: number, excludeOneself?: boolean): {
71
71
  point: Point;
72
72
  userData?: T;
73
73
  }[];
@@ -10,6 +10,10 @@ export declare class Polygon<T = any> extends Array<Point<T>> {
10
10
  * @returns
11
11
  */
12
12
  getBox2(): Box2;
13
+ /** 计算面积
14
+ * @returns
15
+ */
16
+ area(): number;
13
17
  /**
14
18
  * 获取点相对于多边形的位置
15
19
  * @param point
@@ -71,4 +75,11 @@ export declare class Polygon<T = any> extends Array<Point<T>> {
71
75
  * @param lines
72
76
  */
73
77
  static multipleFromByLines(lines: LineSegment[]): Polygon<any>[];
78
+ /** 通过线段路径创建
79
+ * @description 通过线段路径创建, 请确保线段路径正确无误
80
+ * @param lines
81
+ * @param polygon
82
+ * @returns
83
+ */
84
+ static fromByLinePath(lines: LineSegment[], polygon?: Polygon<any>): Polygon<any>;
74
85
  }
@@ -68,4 +68,8 @@ export declare class LineSegmentUndirectedGraph extends UndirectedGraph {
68
68
  * @param angle 角度
69
69
  */
70
70
  static rotate(lines: LineSegment[], angle: number, callbackFun?: (line: LineSegment, center: Point, angle: number) => void): LineSegment<Record<string, any>>[];
71
+ toJson(): {
72
+ points: readonly Point<Record<string, any>>[];
73
+ edges: [number, number][];
74
+ };
71
75
  }
@@ -1,7 +1,7 @@
1
1
  export * from './Box2';
2
2
  export * from './LineIndexGenerator';
3
3
  export * from './LineSegment';
4
- export * from './Lines';
4
+ export * from './DxfSystem/utils/Lines';
5
5
  export * from './Map';
6
6
  export * from './Point';
7
7
  export * from './Polygon';
@@ -16,4 +16,6 @@ export * from './DxfSystem';
16
16
  export * from './CommandManager';
17
17
  export * from './ComponentManager';
18
18
  export * from './Gltf';
19
- export * from './modelScenario/SceneAutoGenerat';
19
+ export * from './DxfSystem/utils/SceneAutoGenerat';
20
+ export * from './MaxiCircles';
21
+ export * from './MiniCircles';