build-dxf 0.0.50 → 0.0.51

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.
@@ -92,5 +92,5 @@ export declare class Box2 {
92
92
  * @param points
93
93
  * @returns
94
94
  */
95
- static fromByLineSegment(...lines: LineSegment[]): Box2;
95
+ static fromByLineSegment<T = any>(...lines: LineSegment<T>[]): Box2;
96
96
  }
@@ -34,7 +34,7 @@ export declare class ThreeVJia extends Component<{
34
34
  * 处理没有分组
35
35
  */
36
36
  handle(): void;
37
- toJson(): {
37
+ toJson(name?: string, communityName?: string): {
38
38
  version: string;
39
39
  name: string;
40
40
  communityName: string;
@@ -26,6 +26,10 @@ export declare class LineGroupType {
26
26
  * @returns
27
27
  */
28
28
  static replace(line: LineSegment<LineUserData>, id: string, type: string): boolean;
29
+ /** 有组
30
+ * @param line
31
+ */
32
+ static hasGroup(line: LineSegment<LineUserData>): boolean;
29
33
  /**
30
34
  * 检查线段是否包含指定的分组ID
31
35
  * @param line
@@ -67,12 +71,19 @@ export declare class LineGroupType {
67
71
  */
68
72
  static getUnionTypes(lines: LineSegment<LineUserData>[]): string[];
69
73
  /**
70
- * 获取所有线段的交集类型(所有线段都包含的类型)
74
+ *
71
75
  * @param line
72
76
  * @param id
73
77
  * @returns
74
78
  */
75
79
  static remove(line: LineSegment<LineUserData>, id: string): boolean;
80
+ /**
81
+ * 获取所有线段的交集类型(所有线段都包含的类型)
82
+ * @param line
83
+ * @param id
84
+ * @returns
85
+ */
86
+ static removeByType(line: LineSegment<LineUserData>, type: string): boolean;
76
87
  /**
77
88
  * 清空线段的所有分组信息
78
89
  * @param line
@@ -4,3 +4,8 @@ import { LineSegment } from '../../LineSegment';
4
4
  * @returns
5
5
  */
6
6
  export declare function clippingDoubleWall(lines: LineSegment[]): LineSegment<Record<string, any>>[][];
7
+ /** 分割多边形环为长方形
8
+ * @param lines
9
+ * @returns
10
+ */
11
+ export declare function clippingDoubleWall2(lines: LineSegment[]): void;
@@ -5,10 +5,10 @@ import { LineSegment } from '../../LineSegment';
5
5
  * @param grid
6
6
  * @returns
7
7
  */
8
- export declare function findDiscretePointLine<T = any>(lines: LineSegment<T>[], grid0?: PointVirtualGrid<LineSegment<T>>, removeLines?: Set<LineSegment<T>>, deep?: boolean): Set<LineSegment<T>>;
8
+ export declare function findDiscretePointLine<T = any>(lines: LineSegment<T>[], grid0?: PointVirtualGrid<LineSegment<T>>, lineSet?: Set<LineSegment<T>>, deep?: boolean): Set<LineSegment<T>>;
9
9
  /** 查找有游离的点的线段, 通过点的统计,而不是虚拟网格
10
10
  * @param lines
11
11
  * @param grid
12
12
  * @returns
13
13
  */
14
- export declare function findDiscretePointLine2<T = any>(lines: LineSegment<T>[], removeLines?: Set<LineSegment<T>> | null, deep?: boolean): Set<LineSegment<T>>;
14
+ export declare function findDiscretePointLine2<T = any>(lines: LineSegment<T>[], lineSet?: Set<LineSegment<T>> | null, deep?: boolean): Set<LineSegment<T>>;
@@ -6,7 +6,7 @@ export * from './DoubleWallHelper';
6
6
  export * from './clippingDoubleWall';
7
7
  export * from './clippingLineUserData';
8
8
  export * from './closedPathArea';
9
- export * from './createPointVirtualGrid';
9
+ export * from './tools';
10
10
  export * from './findLargestCircle';
11
11
  export * from './findDiscretePointLine';
12
12
  export * from './findVerticalReference';
@@ -8,7 +8,7 @@ export declare function ringsDeduplication(rings: LineSegment[][]): LineSegment<
8
8
  * @param lines
9
9
  * @param ringEdges
10
10
  */
11
- export declare function mergeSmallestCircle(rings: LineSegment[][]): {
11
+ export declare function mergeSmallestCircle(rings: LineSegment[][], test?: boolean): {
12
12
  internalEdges: LineSegment<Record<string, any>>[];
13
13
  rings: LineSegment<Record<string, any>>[][];
14
14
  };
@@ -10,3 +10,7 @@ export declare function recomputedWindow(...windowLines: LineSegment<LineUserDat
10
10
  * @param windowLines
11
11
  */
12
12
  export declare function recomputedWindowCenter(...windowLines: LineSegment<LineUserData>[]): void;
13
+ /**
14
+ * @param windowLines
15
+ */
16
+ export declare function mergeWindow(...windowLines: LineSegment<LineUserData>[]): void;
@@ -1,3 +1,5 @@
1
1
  import { PointVirtualGrid } from '../../PointVirtualGrid';
2
2
  import { LineSegment } from '../../LineSegment';
3
+ import { Quadtree } from '../../Quadtree';
3
4
  export declare function createPointVirtualGrid<T = any>(lines: LineSegment<T>[]): PointVirtualGrid<LineSegment<T>>;
5
+ export declare function createQuadtree<T = any>(lines: LineSegment<T>[]): Quadtree<LineSegment<T>>;
@@ -95,10 +95,11 @@ export declare class LineSegment<T = Record<string, any>> {
95
95
  */
96
96
  normal(): Point<Record<string, any>>;
97
97
  /**
98
- * 线段长度
98
+ * 线段长度(缓存优化)
99
99
  * @returns
100
100
  */
101
- length(): number;
101
+ cachedLength: number | null;
102
+ length(cached?: boolean): number;
102
103
  /**
103
104
  * 计算一条线段在另一条直线上的投影,并裁剪超出目标线段的部分
104
105
  * @param line 要投影的线段
@@ -1,5 +1,6 @@
1
1
  import { Box2 } from '../Box2';
2
2
  import { Point } from '../Point';
3
+ import { Polygon } from '../Polygon';
3
4
  import { Rectangle } from '../Rectangle';
4
5
  type Target<T> = {
5
6
  point: Point;
@@ -56,7 +57,10 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
56
57
  * @param rectangle 矩形
57
58
  * @returns 相交的节点数组
58
59
  */
59
- queryRect(rectangle: Rectangle): void;
60
+ queryRect(rectangle: Rectangle): {
61
+ point: Point;
62
+ userData?: T;
63
+ }[];
60
64
  /**
61
65
  * 查询与圆形区域相交的点
62
66
  * @param pos 圆心
@@ -81,6 +85,13 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
81
85
  * @param point
82
86
  */
83
87
  queryPoint(point: Point, excludeOneself?: boolean): PvgList<T>;
88
+ /** 获取多边形内的点
89
+ * @param polygon
90
+ */
91
+ queryPolygon(polygon: Polygon): {
92
+ point: Point;
93
+ userData?: T;
94
+ }[];
84
95
  /**
85
96
  * 查找点自己
86
97
  * @param point
@@ -1,13 +1,18 @@
1
+ import { Box2 } from './Box2';
1
2
  import { LineSegment } from './LineSegment';
2
3
  import { Point } from './Point';
3
4
  export declare class Polygon<T = any> extends Array<Point<T>> {
4
5
  constructor(points?: Point<T>[]);
6
+ /** 计算二维包围盒
7
+ * @returns
8
+ */
9
+ getBox2(): Box2;
5
10
  /**
6
11
  * 获取点相对于多边形的位置
7
12
  * @param point
8
13
  * @returns 'on' 边上,'inside' 内部,'outside' 外部
9
14
  */
10
- pointPosition(point: Point): "on" | "outside" | "inside";
15
+ pointPosition(point: Point): "outside" | "on" | "inside";
11
16
  /** 点在多边形上:包括路径和内部
12
17
  * @param point
13
18
  * @returns