build-dxf 0.0.30 → 0.0.31

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.
@@ -143,10 +143,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
143
143
  * @param data
144
144
  */
145
145
  preprocessing(data: OriginalDataItem[], axisAlignmentCorrection?: boolean): {
146
- lineSegments: LineSegment<Record<string, any>>[];
147
- data: OriginalDataItem[];
148
- } | {
149
- lineSegments: LineSegment<LineUserData>[];
146
+ lineSegments: (LineSegment<Record<string, any>> | LineSegment<LineUserData>)[];
150
147
  data: OriginalDataItem[];
151
148
  };
152
149
  /**
@@ -257,5 +254,12 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
257
254
  * @returns
258
255
  */
259
256
  static createData(pointsGroups: Point[][], sealed?: boolean): OriginalDataItem[];
257
+ /**
258
+ * 轴对齐垂直修正
259
+ * @param lines 待调整线段组
260
+ * @param targettLine 轴线段
261
+ * @returns
262
+ */
263
+ static axisAlignmentCorrection(lines: LineSegment[], targettLine: LineSegment): (LineSegment<Record<string, any>> | LineSegment<LineUserData>)[];
260
264
  }
261
265
  export {};
@@ -1,6 +1,6 @@
1
1
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
2
- import { LineUserData } from '../RenderManager';
3
2
  import { CommandFlowComponent } from './CommandFlowComponent';
3
+ import { LineUserData } from '../../../../components/Dxf';
4
4
  import * as THREE from "three";
5
5
  export declare class Default extends CommandFlowComponent<{
6
6
  selectLineChange: {};
@@ -1,6 +1,6 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
- import { LineUserData } from '../RenderManager';
3
+ import { LineUserData } from '../../../../components/Dxf';
4
4
  import { ComponentManager } from '../../../../../ComponentManager';
5
5
  import * as THREE from "three";
6
6
  export declare class DrawWindow extends CommandFlowComponent<{
@@ -2,7 +2,7 @@ import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { ComponentManager } from '../../../../../ComponentManager';
3
3
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
4
4
  import { Point } from '../../../../../Quadtree/Point';
5
- import { LineUserData } from '../RenderManager';
5
+ import { LineUserData } from '../../../../components/Dxf';
6
6
  import * as THREE from "three";
7
7
  /**
8
8
  * 垂直纠正
@@ -55,8 +55,8 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
55
55
  * @returns
56
56
  */
57
57
  axisAlignmentCorrection(targettLine: LineSegment): {
58
- newLines: LineSegment<Record<string, any>>[];
59
- oldLines: LineSegment<import('../../../../components/Dxf').LineUserData>[];
58
+ newLines: (LineSegment<Record<string, any>> | LineSegment<LineUserData>)[];
59
+ oldLines: LineSegment<LineUserData>[];
60
60
  };
61
61
  /** 开始
62
62
  * @param next
@@ -50,7 +50,12 @@ export declare class RenderManager extends Component<{}> {
50
50
  point: THREE.Vector3;
51
51
  find: boolean;
52
52
  mode: string;
53
- line: LineSegment;
53
+ line: LineSegment<LineUserData>;
54
+ } | {
55
+ point: THREE.Vector3;
56
+ find: boolean;
57
+ mode: string;
58
+ line: LineSegment<Record<string, any>>;
54
59
  } | {
55
60
  point: THREE.Vector3;
56
61
  find: boolean;
@@ -14,7 +14,7 @@ export declare class WhiteModel extends Component<{
14
14
  whiteModelGroup: THREE.Group<THREE.Object3DEventMap>;
15
15
  whiteModelLineGroup: THREE.Group<THREE.Object3DEventMap>;
16
16
  originalWhiteMode: THREE.Group<THREE.Object3DEventMap>;
17
- material: THREE.MeshBasicMaterial;
17
+ material: THREE.MeshStandardMaterial;
18
18
  onAddFromParent(parent: ComponentManager): void;
19
19
  updateModel(): void;
20
20
  /**
@@ -29,6 +29,12 @@ export declare class LineSegment<T = Record<string, any>> {
29
29
  * @returns
30
30
  */
31
31
  getSameEndpoint(line: LineSegment): Point<Record<string, any>>[] | null;
32
+ /**
33
+ * 判断一个点是否在当前线段上(包含端点)
34
+ * @param point 要判断的点
35
+ * @returns 如果点在当前线段上则返回 true,否则返回 false
36
+ */
37
+ isPointOnSegment(point: Point): boolean;
32
38
  /**
33
39
  * 相同端点是否为结束
34
40
  * @param line
@@ -145,16 +151,9 @@ export declare class LineSegment<T = Record<string, any>> {
145
151
  */
146
152
  areLinesCoincident(line: LineSegment): boolean;
147
153
  clone(): LineSegment<T>;
148
- /**
149
- * 轴对齐垂直修正
150
- * @param lines 待调整线段组
151
- * @param targettLine 轴线段
152
- * @returns
153
- */
154
- static axisAlignmentCorrection(lines: LineSegment[], targettLine: LineSegment): LineSegment<Record<string, any>>[];
155
154
  /**
156
155
  * 获取最长线段
157
156
  * @param lines
158
157
  */
159
- static maxLengthLineIndex(lines: LineSegment[]): number;
158
+ static maxLengthLineIndex(lines: LineSegment[], excludeCallBack?: (line: LineSegment) => boolean): number;
160
159
  }