build-dxf 0.1.12 → 0.1.14

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,6 +1,7 @@
1
1
  export declare const API_BASE_URL = "";
2
2
  export declare const VITE_OSS_BASEURL: any;
3
3
  export declare const DEFAULT_WALL_WIDTH = 0.12;
4
+ export declare const DEFAULT_WALL_HEIGHT = 2.8;
4
5
  export declare const DOUBLE_WALL_FIND_WIDTH = 0.4;
5
6
  export declare const DEFAULT_DOOR_HEIGHT = 2.1;
6
7
  export declare const DOOR_GROUND_CLEARANCE_HEIGHT = 0;
package/src/index3.js CHANGED
@@ -7427,6 +7427,7 @@ class ViewAngle extends CommandFlowComponent {
7427
7427
  }
7428
7428
  if (end.sameEndpointAsStart(start)) point2 = end.end;
7429
7429
  else point2 = end.start;
7430
+ console.log(point1.direction(center).angleBetween(point2.direction(center), "angle", "360"));
7430
7431
  function getAngle(center2, p) {
7431
7432
  const dx = p.x - center2.x;
7432
7433
  const dy = p.y - center2.y;
@@ -14,13 +14,11 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
14
14
  originalData: OriginalDataItem[];
15
15
  data: DataItem[];
16
16
  cad: CAD;
17
+ options: SetDataOption;
17
18
  };
18
19
  cadChange: {
19
20
  cad: CAD;
20
- };
21
- preprocessing: {
22
- data: OriginalDataItem[];
23
- setData(data: OriginalDataItem[]): void;
21
+ options: SetDataOption;
24
22
  };
25
23
  } & TEventMap> {
26
24
  static name: string;
@@ -35,8 +33,6 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
35
33
  verticalReferenceLine?: LineSegment<LineUserData>;
36
34
  originalZAverage: number;
37
35
  private _preProcessorSet;
38
- trajectory: Record<string, any> | null;
39
- onBoundExt?: (lines: LineSegment[], trajectory: any) => void;
40
36
  /** 原始数据组
41
37
  */
42
38
  get lines(): LineSegment<LineUserData>[];
@@ -44,19 +40,6 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
44
40
  * @param width 墙体宽度
45
41
  */
46
42
  constructor(width?: number);
47
- setTrajectory(trajectory: Record<string, any> | null, onBoundExt?: (lines: LineSegment[], trajectory: any) => void): this;
48
- /** 完整线段数据
49
- * @returns
50
- */
51
- getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
52
- /**
53
- * 预处理数据
54
- * @param data
55
- */
56
- protected preprocessing(data: OriginalDataItem[], options: SetDataOption): {
57
- lineSegments: LineSegment<LineUserData>[];
58
- data: OriginalDataItem[];
59
- };
60
43
  /** 添加预处理
61
44
  * @param handler
62
45
  */
@@ -69,6 +52,18 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
69
52
  * @returns
70
53
  */
71
54
  clearPreProcessor(): this;
55
+ /** 完整线段数据
56
+ * @returns
57
+ */
58
+ getLineSegments(clone?: boolean): LineSegment<LineUserData>[];
59
+ /**
60
+ * 预处理数据
61
+ * @param data
62
+ */
63
+ protected preprocessing(data: OriginalDataItem[], options: SetDataOption): {
64
+ lineSegments: LineSegment<LineUserData>[];
65
+ data: OriginalDataItem[];
66
+ };
72
67
  /** 设置
73
68
  * @param data 房屋结构数据,node环境可以为路径
74
69
  * @param width 墙体宽度
@@ -77,6 +72,7 @@ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
77
72
  * @param option
78
73
  * @returns
79
74
  */
75
+ options: SetDataOption;
80
76
  set(data: OriginalDataItem[] | string, options?: SetDataOption): Promise<any>;
81
77
  /**
82
78
  * 线段数据转为原始json数据
@@ -1,6 +1,7 @@
1
- import { QuadtreeNode } from '../Quadtree';
1
+ import { Quadtree, QuadtreeNode } from '../Quadtree';
2
2
  import { Point } from '../Point';
3
3
  import { LineSegment } from '../LineSegment';
4
+ import { Polygon } from '../Polygon';
4
5
  export type Unit = "Unitless" | "Inches" | "Feet" | "Miles" | "Millimeters" | "Centimeters" | "Meters" | "Kilometers" | "Microinches" | "Mils" | "Yards" | "Angstroms" | "Nanometers" | "Microns" | "Decimeters" | "Decameters" | "Hectometers" | "Gigameters" | "Astronomical units" | "Light years" | "Parsecs";
5
6
  export interface GroupItem {
6
7
  id: string;
@@ -64,6 +65,7 @@ export type LineUserData = {
64
65
  isVerticalReferenceLine?: boolean;
65
66
  wallWidth?: number;
66
67
  rooftopPz?: number;
68
+ height?: number;
67
69
  groupId?: string;
68
70
  groupType?: string;
69
71
  groups?: GroupItem[];
@@ -134,6 +136,7 @@ export type SetDataOption = {
134
136
  wallGroup?: boolean;
135
137
  trajectory?: Record<string, any>;
136
138
  onBoundExt?: (lines: LineSegment[], trajectory: any) => void;
139
+ publicInfo?: IPublicInfoFile;
137
140
  };
138
141
  /**
139
142
  *
@@ -142,3 +145,17 @@ export interface PointGroup {
142
145
  points: Point[];
143
146
  indices: number[];
144
147
  }
148
+ export type Contour = {
149
+ contour: [number, number][];
150
+ polygon?: Polygon;
151
+ averagePz: number;
152
+ };
153
+ export type CootTopContourInfo = {
154
+ contours: Contour[];
155
+ maxContourIndex: number;
156
+ quadtree?: Quadtree;
157
+ };
158
+ export interface IPublicInfoFile {
159
+ itemInfo: any[];
160
+ rootTopContourInfo?: CootTopContourInfo;
161
+ }
@@ -0,0 +1,9 @@
1
+ import { LineSegment } from '../../LineSegment';
2
+ import { CootTopContourInfo } from '../type';
3
+ export declare class HeightQuery {
4
+ static query(line: LineSegment, rootTopContourInfo: CootTopContourInfo): number;
5
+ static whichContourContainsPoint(points: [number, number][], rootTopContourInfo: CootTopContourInfo): {
6
+ i: number;
7
+ averagePz: number;
8
+ }[];
9
+ }
@@ -14,6 +14,14 @@ export declare class LineSegment<T = Record<string, any>> {
14
14
  constructor(p1?: Point, p2?: Point);
15
15
  set(p1: Point, p2: Point): this;
16
16
  getAnotherPoint(point: Point): Point<Record<string, any>>;
17
+ /** 开始点向线段内收缩 width
18
+ * @param width
19
+ */
20
+ startShrink(width: number): this;
21
+ /** 结束点向线段内收缩 width
22
+ * @param width
23
+ */
24
+ endShrink(width: number): this;
17
25
  /**
18
26
  * 是否有相同端点
19
27
  * @param line
@@ -33,14 +33,15 @@ export default class Scenario {
33
33
  waterCoolerModel: any;
34
34
  height: any;
35
35
  expandedList: any;
36
+ wallHeight: any;
36
37
  private static _instance?;
37
38
  static get Instance(): Scenario | undefined;
38
39
  constructor(scene: THREE.Scene, camera: THREE.PerspectiveCamera, renderer: THREE.WebGLRenderer, controls: OrbitControls);
39
40
  drawGraphics(lines: LineSegment[], z: number, trajectoryJson: any): Promise<any>;
40
41
  splitProcessData(lines: LineSegment[], texture: THREE.DataTexture): void;
41
- drawTheModel(data: any, num: number, index: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
42
- executionOffset(data: any, index: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | undefined;
43
- windowTreatment(dblWin: any, mesh: any): Brush;
42
+ drawTheModel(data: any, num: number, index: number, wallHeight: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
43
+ executionOffset(data: any, index: number, wallHeight: number): THREE.Mesh<THREE.ExtrudeGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap> | undefined;
44
+ windowTreatment(dblWin: any, mesh: any, wallHeight: number): Brush;
44
45
  TheHandlingOfTheDoor1(data: LineSegment<LineUserData>): THREE.Vector3[];
45
46
  TheHandlingOfTheDoor(data: LineSegment<LineUserData>[]): void;
46
47
  doorCenterOffset(distanceFromB: number, point: any, pointc: THREE.Vector3): THREE.Vector3;
@@ -49,16 +50,18 @@ export default class Scenario {
49
50
  installTable(): void;
50
51
  installchair(): void;
51
52
  winHoleOpening(data: any, mesh: any, winGroundHeight?: number, Height?: number): Brush;
52
- doorHoleOpening(data: any, data1: any, groundHeight?: number, Height?: number, distance?: number, center?: THREE.Vector3, angleRad?: any, index?: string): void;
53
+ doorHoleOpening(wallHeight: number, data: any, data1: any, groundHeight?: number, Height?: number, distance?: number, center?: THREE.Vector3, angleRad?: any, index?: string): void;
53
54
  angleToXAxisDegrees(x1: number, y1: number, x2: number, y2: number, wide: number, cd: boolean): number;
54
- xinLine(x: number, y: number, point: THREE.Vector3 | Point, num: number): THREE.Vector3[];
55
- xinLine1(x: number, y: number, pointa: THREE.Vector3, pointb: THREE.Vector3, num: number): THREE.Vector3[];
55
+ xinLine(x: number, y: number, point: THREE.Vector3 | Point, wallHeight: number): THREE.Vector3[];
56
+ xinLine1(x: number, y: number, pointa: THREE.Vector3, pointb: THREE.Vector3, num: number, wallHeight: number): THREE.Vector3[];
56
57
  createParallelepipedFromBase(points: any, height: number): THREE.ExtrudeGeometry;
57
58
  correctionSorting(bitem: any): {
58
59
  dian: THREE.Vector3;
59
60
  zhong: string;
61
+ wallHeight: any;
60
62
  }[];
61
63
  overallTreatmentOfSingleLineWalls(data: any): void;
64
+ createAPlane(lines: LineSegment<Record<string, any>>[], menList: LineSegment<Record<string, any>>[]): void;
62
65
  modelLoader(): Promise<void>;
63
66
  windowModelLoader(): Promise<void>;
64
67
  damian(): void;