build-dxf 0.0.20-9 → 0.0.21

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 (38) hide show
  1. package/README.md +3 -0
  2. package/package.json +6 -4
  3. package/src/build.d.ts +4 -0
  4. package/src/build.js +1403 -1922
  5. package/src/index.css +1 -649
  6. package/src/index.js +7 -7
  7. package/src/index2.js +327 -516
  8. package/src/index3.js +1798 -1841
  9. package/src/selectLocalFile.js +1960 -3146
  10. package/src/utils/CommandManager/CommandFlow.d.ts +17 -4
  11. package/src/utils/CommandManager/CommandManager.d.ts +11 -2
  12. package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +10 -0
  13. package/src/utils/DxfSystem/components/Dxf.d.ts +35 -5
  14. package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -1
  15. package/src/utils/DxfSystem/index.d.ts +2 -0
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +45 -0
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +15 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +9 -0
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +15 -1
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +22 -4
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +25 -2
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +14 -0
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +33 -0
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +14 -1
  26. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +13 -0
  27. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection copy.d.ts +82 -0
  28. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +43 -7
  29. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +21 -0
  30. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{mergeLine.d.ts → ViewAngle.d.ts} +5 -3
  31. package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +4 -1
  32. package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +4 -1
  33. package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +3 -0
  34. package/src/utils/PointVirtualGrid/index.d.ts +8 -0
  35. package/src/utils/Quadtree/LineSegment.d.ts +34 -1
  36. package/src/utils/Quadtree/Point.d.ts +7 -1
  37. package/src/utils/Quadtree/Quadtree.d.ts +1 -1
  38. package/src/utils/deepClone.d.ts +6 -0
@@ -0,0 +1,21 @@
1
+ import { CommandFlowComponent } from './CommandFlowComponent';
2
+ import { ComponentManager } from '../../../../../ComponentManager';
3
+ /**
4
+ * 设置y轴垂直基准线段
5
+ */
6
+ export declare class VerticalReferenceLine extends CommandFlowComponent<{}> {
7
+ static name: string;
8
+ shortcutKeys: string[];
9
+ static commandName: string;
10
+ onAddFromParent(parent: ComponentManager): void;
11
+ /**
12
+ * 进入命令约束
13
+ */
14
+ private constraint;
15
+ /**
16
+ *
17
+ * @param next
18
+ * @param selectLines
19
+ */
20
+ private verticalReferenceLine;
21
+ }
@@ -3,7 +3,7 @@ import { ComponentManager } from '../../../../../ComponentManager';
3
3
  /**
4
4
  * 合并同向线段
5
5
  */
6
- export declare class MergeLine extends CommandFlowComponent<{}> {
6
+ export declare class ViewAngle extends CommandFlowComponent<{}> {
7
7
  static name: string;
8
8
  shortcutKeys: string[];
9
9
  static commandName: string;
@@ -12,8 +12,10 @@ export declare class MergeLine extends CommandFlowComponent<{}> {
12
12
  * 进入命令约束
13
13
  */
14
14
  private constraint;
15
- /** 开始
15
+ /**
16
+ *
16
17
  * @param next
18
+ * @param selectLines
17
19
  */
18
- private mergeLine;
20
+ private viewAngle;
19
21
  }
@@ -5,6 +5,7 @@ import { DomContainer, DomEventRegister, EventInput, Renderer } from '../../Rend
5
5
  import { RenderManager } from './RenderManager';
6
6
  import { CommandManager } from '../../../../CommandManager';
7
7
  import { App } from 'vue';
8
+ import { DxfSystem } from '../../../../../build';
8
9
  import * as THREE from "three";
9
10
  export declare class Editor extends Component<{
10
11
  pointerPositionChange: {
@@ -26,8 +27,10 @@ export declare class Editor extends Component<{
26
27
  app?: App<Element>;
27
28
  domElement: HTMLDivElement;
28
29
  viewPermission?: "admin";
30
+ imgEl: HTMLImageElement;
31
+ imgWidth: number;
29
32
  constructor(viewPermission?: "admin");
30
- onAddFromParent(): void;
33
+ onAddFromParent(parent: DxfSystem): void;
31
34
  /**
32
35
  * 取消命令,由其他命令组件监听事件后注册事件监听实现
33
36
  */
@@ -12,11 +12,13 @@ export type LineUserData = {
12
12
  doorDirectConnection?: boolean;
13
13
  isDoor?: boolean;
14
14
  isWindow?: boolean;
15
- drawDoorData?: {
15
+ isVerticalReferenceLine?: boolean;
16
+ drawWindow?: {
16
17
  p: THREE.Vector3;
17
18
  width: number;
18
19
  full: boolean;
19
20
  }[];
21
+ drawDoorData?: any;
20
22
  quadtreeNode?: QuadtreeNode;
21
23
  };
22
24
  export declare class RenderManager extends Component<{}> {
@@ -29,6 +31,7 @@ export declare class RenderManager extends Component<{}> {
29
31
  type: "addLine" | "removeLine";
30
32
  data: any;
31
33
  }>;
34
+ verticalReferenceLineFlag: THREE.Mesh<THREE.PlaneGeometry, THREE.MeshBasicMaterial, THREE.Object3DEventMap>;
32
35
  onAddFromParent(): void;
33
36
  private updatedMode;
34
37
  /** 重新设置数据
@@ -46,8 +46,11 @@ export declare class Renderer extends Component<{
46
46
  container: THREE.Group<THREE.Object3DEventMap>;
47
47
  onUpdate?: () => void;
48
48
  onResize?: (width: number, height: number) => void;
49
+ width: number;
50
+ height: number;
49
51
  private tweenTaskList;
50
52
  constructor(description: RendererDescription);
53
+ render(): void;
51
54
  /**
52
55
  * 世界坐标转屏幕坐标
53
56
  * @param worldPosition
@@ -72,5 +72,13 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
72
72
  point: Point;
73
73
  userData?: T;
74
74
  }[];
75
+ /**
76
+ * 查找点自己
77
+ * @param point
78
+ */
79
+ queryPointSelf(point: Point): {
80
+ point: Point;
81
+ userData: T;
82
+ } | null;
75
83
  }
76
84
  export {};
@@ -11,6 +11,31 @@ export declare class LineSegment<T = Record<string, any>> {
11
11
  get start(): Point<Record<string, any>>;
12
12
  get end(): Point<Record<string, any>>;
13
13
  constructor(p1?: Point, p2?: Point);
14
+ set(p1: Point, p2: Point): this;
15
+ /**
16
+ * 是否有相同端点
17
+ * @param line
18
+ * @returns
19
+ */
20
+ sameEndpoint(line: LineSegment): boolean;
21
+ /**
22
+ * 相同端点是否为开始
23
+ * @param line
24
+ * @returns
25
+ */
26
+ sameEndpointAsStart(line: LineSegment): boolean;
27
+ /**
28
+ * 获取共线点
29
+ * @param line
30
+ * @returns
31
+ */
32
+ getSameEndpoint(line: LineSegment): Point<Record<string, any>>[] | null;
33
+ /**
34
+ * 相同端点是否为结束
35
+ * @param line
36
+ * @returns
37
+ */
38
+ sameEndpointAsEnd(line: LineSegment): boolean;
14
39
  /** 膨胀
15
40
  * @description 向线段的两个端点分别膨胀 width
16
41
  * @param width
@@ -73,8 +98,16 @@ export declare class LineSegment<T = Record<string, any>> {
73
98
  /**
74
99
  * 判断线段是否与另一条线段相交(包含共用端点或部分重合的情况)
75
100
  * @param line
101
+ * @param endpoint 是否包含端点相交
102
+ * @returns
103
+ */
104
+ intersectLineSegment(line: LineSegment, endpoint?: boolean): boolean;
105
+ /**
106
+ * 判断一个点是否在线段上(含端点)
107
+ * @param pt 要判断的点
108
+ * @returns 如果点在当前线段上返回 true,否则返回 false
76
109
  */
77
- intersectLineSegment(line: LineSegment): boolean;
110
+ containsPoint(pt: Point): boolean;
78
111
  /**
79
112
  * 获取交点
80
113
  * @param line
@@ -54,6 +54,12 @@ export declare class Point<T = Record<string, any>> {
54
54
  * @returns
55
55
  */
56
56
  add(point: Point): this;
57
+ /**
58
+ * 绕point旋转angle
59
+ * @param point
60
+ * @param angle 旋转角度,单位为弧度
61
+ */
62
+ rotate(point: Point, angle: number): this;
57
63
  /**
58
64
  * 保留小数位数
59
65
  * @param count
@@ -124,7 +130,7 @@ export declare class Point<T = Record<string, any>> {
124
130
  copy(p: {
125
131
  x: number;
126
132
  y: number;
127
- }): void;
133
+ }): this;
128
134
  toJson(z?: number): {
129
135
  x: number;
130
136
  y: number;
@@ -60,7 +60,7 @@ export declare class Quadtree<T = any> {
60
60
  * @param lineSegment 线段
61
61
  * @returns 相交的节点数组
62
62
  */
63
- queryLineSegment(lineSegment: LineSegment): QuadtreeNode<T>[];
63
+ queryLineSegment(lineSegment: LineSegment, endpoint?: boolean): QuadtreeNode<T>[];
64
64
  /**
65
65
  * 包围盒转换为数组
66
66
  * @param array
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 实现深度克隆函数
3
+ * @param value 要克隆的值
4
+ * @returns 克隆后的新对象
5
+ */
6
+ export declare function deepClone<T>(value: T): T;