build-dxf 0.0.47 → 0.0.48

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.
@@ -1,13 +1,17 @@
1
1
  import { LineSegment } from '../../LineSegment';
2
2
  import { Point } from '../../Point';
3
- import { OriginalDataItem } from '../type';
3
+ import { LineUserData, OriginalDataItem } from '../type';
4
4
  export declare class BoundExt {
5
5
  /** 通过轨迹点查找外墙
6
6
  * @param lines
7
7
  * @param trajectoryPoints
8
8
  * @returns
9
9
  */
10
- static findExtWallByTraj(lines: LineSegment[], trajectoryPoints: Point[], minWidth?: number): LineSegment<Record<string, any>>[];
10
+ static findExtWallByTraj(lines: LineSegment<LineUserData & {
11
+ expandDirect?: 'left' | 'right' | 'on';
12
+ }>[], trajectoryPoints: Point[], minWidth?: number): LineSegment<LineUserData & {
13
+ expandDirect?: "left" | "right" | "on";
14
+ }>[];
11
15
  /** 通过轨迹点外扩边线
12
16
  * @param lines
13
17
  * @param trajectoryPoints
@@ -0,0 +1,16 @@
1
+ import { LineSegment } from '../../LineSegment';
2
+ import { Point } from '../../Point';
3
+ import { OriginalDataItem } from '../type';
4
+ export declare class BoundExt {
5
+ /** 通过轨迹点查找外墙
6
+ * @param lines
7
+ * @param trajectoryPoints
8
+ * @returns
9
+ */
10
+ static findExtWallByTraj(lines: LineSegment[], trajectoryPoints: Point[], minWidth?: number): LineSegment<Record<string, any>>[];
11
+ /** 通过轨迹点外扩边线
12
+ * @param lines
13
+ * @param trajectoryPoints
14
+ */
15
+ static boundExtbyTraj(data: OriginalDataItem[], trajectory: any, wallWidth?: number, findCallBack?: (lines: LineSegment[], trajectory: Point[]) => void): OriginalDataItem[];
16
+ }
@@ -0,0 +1,29 @@
1
+ import { LineSegment } from '../../LineSegment';
2
+ import { Point } from '../../Point';
3
+ export declare class TrajectoryHelper {
4
+ mainAxis: LineSegment;
5
+ verticalAxis: LineSegment;
6
+ verticalAxisValue: {
7
+ value: number;
8
+ target: LineSegment | Point;
9
+ }[];
10
+ mainAxisValue: {
11
+ value: number;
12
+ target: LineSegment | Point;
13
+ }[];
14
+ constructor(points: Point[], lines: LineSegment[]);
15
+ /** 添加到主轴
16
+ * @param trajectoryPoints
17
+ */
18
+ private addMainAxis;
19
+ /** 添加到垂直轴
20
+ * @param trajectoryPoints
21
+ */
22
+ private addVerticalAxis;
23
+ /** 排序投影
24
+ */
25
+ private sortProjections;
26
+ /** 查找
27
+ */
28
+ find(): void;
29
+ }
@@ -11,7 +11,7 @@ export declare function removeNotRingLine(lines: LineSegment[], removeLines?: Se
11
11
  /** 查找线段组成的最大环
12
12
  * @param lines
13
13
  */
14
- export declare function findMaxRing(lines: LineSegment[], grid?: PointVirtualGrid<LineSegment>): LineSegment<Record<string, any>>[];
14
+ export declare function findMaxRing(lines: LineSegment[]): LineSegment<Record<string, any>>[];
15
15
  /**
16
16
  * 从线段集合中提取所有闭合多边形
17
17
  */
@@ -0,0 +1,10 @@
1
+ import { LineSegment } from './LineSegment';
2
+ export declare class LineIndexGenerator {
3
+ private index;
4
+ next(): number;
5
+ reset(): void;
6
+ map: Map<LineSegment<Record<string, any>>, number>;
7
+ lineMap: Map<number, LineSegment<Record<string, any>>>;
8
+ getIndex(key: LineSegment): number;
9
+ getLine(index: number): LineSegment | undefined;
10
+ }
@@ -65,6 +65,10 @@ export declare class LineSegment<T = Record<string, any>> {
65
65
  * @param size
66
66
  */
67
67
  directionMove(direct: Point, size: number): this;
68
+ /** 旋转
69
+ * @param angle 弧度
70
+ */
71
+ rotate(angle: number): this;
68
72
  /** 膨胀为矩形
69
73
  *
70
74
  * @param width
@@ -103,6 +107,9 @@ export declare class LineSegment<T = Record<string, any>> {
103
107
  * @returns 投影并裁剪后的线段
104
108
  */
105
109
  projectPoint(p1: Point, clip?: boolean): Point | null;
110
+ /** 获取点的投影值
111
+ */
112
+ projectValue(point: Point): number;
106
113
  /**
107
114
  * 判断两条线段,是否在同一直线上:
108
115
  * - 返回 -1:不在同一直线(不共线)
@@ -0,0 +1,6 @@
1
+ import { LineSegment } from './LineSegment';
2
+ import { Point } from './Point';
3
+ export declare class Path {
4
+ points: Point[];
5
+ intersectLineSegment(line: LineSegment): void;
6
+ }
@@ -6,6 +6,10 @@ type Target<T> = {
6
6
  userData?: T;
7
7
  };
8
8
  type NodeSet<T> = Set<Target<T>>;
9
+ export declare class PVGQueryList<T = any> extends Array<Target<T>> {
10
+ userDataList(): (T | undefined)[];
11
+ points(): Point<Record<string, any>>[];
12
+ }
9
13
  export declare class PointVirtualGrid<T = Record<string, any>> {
10
14
  map: Map<string, NodeSet<T>>;
11
15
  gridSize: number;
@@ -29,13 +33,17 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
29
33
  * @param point
30
34
  */
31
35
  remove(point: Point): void;
32
- update(point: Point): void;
36
+ update(point: Point): boolean;
33
37
  /**
34
38
  * 获取通过坐标,获取唯一网格索引
35
39
  * @param point
36
40
  * @returns
37
41
  */
38
42
  getGridId(point: Point): string;
43
+ /**
44
+ * 清空所有数据
45
+ */
46
+ clear(): void;
39
47
  /**
40
48
  *
41
49
  * @param gridId
@@ -71,10 +79,7 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
71
79
  * 查找相同点
72
80
  * @param point
73
81
  */
74
- queryPoint(point: Point, excludeOneself?: boolean): {
75
- point: Point;
76
- userData?: T;
77
- }[];
82
+ queryPoint(point: Point, excludeOneself?: boolean): PVGQueryList<T>;
78
83
  /**
79
84
  * 查找点自己
80
85
  * @param point
@@ -31,6 +31,7 @@ export declare class Quadtree<T = any> {
31
31
  * @param node
32
32
  */
33
33
  update(node: QuadtreeNode<T> | LineSegment): void;
34
+ clear(): void;
34
35
  /**
35
36
  * 获取线段所属的象限
36
37
  * @param line 线段