build-dxf 0.1.80 → 0.1.82

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.1.80",
3
+ "version": "0.1.82",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -107,7 +107,7 @@ const _Renderer = class _Renderer extends Component {
107
107
  this.description = description;
108
108
  const {
109
109
  scene = new THREE.Scene(),
110
- camera = new THREE.PerspectiveCamera(45, 1, 0.01, 1e3)
110
+ camera = new THREE.PerspectiveCamera(45, 1, 1e-4, 1e3)
111
111
  } = description;
112
112
  this.camera = camera;
113
113
  this.scene = scene;
@@ -0,0 +1,22 @@
1
+ import { IRegion, ISpace } from './type';
2
+ export declare function getSpaceListApi(): Promise<ISpace[]>;
3
+ /** 获取区域列表api
4
+ * @param idSpace
5
+ * @returns
6
+ */
7
+ export declare function getRegionListApi(idSpace: String): Promise<IRegion[]>;
8
+ /** 获取名下所有区域列表 api
9
+ */
10
+ export declare function getRegionListAllApi(): Promise<{
11
+ regionList: IRegion[][];
12
+ spaceList: ISpace[];
13
+ }>;
14
+ /**
15
+ * 更新三维家json
16
+ */
17
+ export declare function updateThreeJiaJsonApi(body: {
18
+ schemeContent: string;
19
+ idRegion: string;
20
+ models: string;
21
+ dxf: string;
22
+ }): Promise<boolean>;
@@ -0,0 +1,30 @@
1
+ export type ModelItemType = "dxf" | "gltf" | "jpg" | "glb" | "originalJson" | "json" | "obj" | "threeVJiaJson" | "publicInfoJson" | "trajectory";
2
+ export interface IModelItem {
3
+ type: ModelItemType;
4
+ url: string;
5
+ data?: any;
6
+ }
7
+ export interface IRegion {
8
+ idRegion: string;
9
+ regionName: string;
10
+ type: string;
11
+ active: string;
12
+ createTime: string;
13
+ updateTime: number;
14
+ url: string;
15
+ idSpace: string;
16
+ username: string;
17
+ nickName: string;
18
+ headerImg: string;
19
+ dxf: string;
20
+ models: IModelItem[];
21
+ ext: string;
22
+ progress: number;
23
+ }
24
+ export interface ISpace {
25
+ idSpace: string;
26
+ spaceName: string;
27
+ accountRole: number;
28
+ active: number;
29
+ regionList: IRegion[];
30
+ }
@@ -0,0 +1,93 @@
1
+ import { DxfSystem } from './utils/DxfSystem';
2
+ import { LineUserData, OriginalDataItem, SetDataOption } from './utils/DxfSystem/type';
3
+ import { WhiteModel } from './utils/DxfSystem/plugin/ModelDataPlugin/components/WhiteModel';
4
+ import { LineSegment } from './utils';
5
+ import * as THREE from "three";
6
+ export { Dxf } from './utils/DxfSystem/components/Dxf';
7
+ export * from './utils/DxfSystem/DxfSystem';
8
+ export * as ModelDataPlugin from './utils/DxfSystem/plugin/ModelDataPlugin';
9
+ export * as utils from './utils';
10
+ /** 快捷创建编辑器
11
+ * @param dom
12
+ * @param camera
13
+ * @returns
14
+ */
15
+ export declare function createEditor(dom: HTMLDivElement, camera?: THREE.Camera, orbitControls?: boolean, viewPermission?: 'admin'): Promise<{
16
+ dxfSystem: DxfSystem;
17
+ getFileAll: () => Promise<{
18
+ dxf: File;
19
+ obj: File;
20
+ glb: File;
21
+ gltf: File;
22
+ json: File;
23
+ jpg: File;
24
+ correctionDxf: File;
25
+ }>;
26
+ }>;
27
+ /**
28
+ * @param originData
29
+ * @param trajectory
30
+ * @deprecated 已废弃,请勿使用
31
+ */
32
+ export declare function getModels(originData: OriginalDataItem[], trajectory: any, itemList: any): Promise<{
33
+ glb: File;
34
+ gltf: File;
35
+ }>;
36
+ type HandleJsonOption = {
37
+ /** json数据或路径 */
38
+ json: string | OriginalDataItem[];
39
+ trajectory?: string | Record<string, any>;
40
+ itemInfo?: string | Record<string, any>;
41
+ axisAlignCorr?: boolean;
42
+ axisAlignCorrOption?: SetDataOption;
43
+ doorFind?: boolean;
44
+ download?: {
45
+ json?: string;
46
+ dxf?: string;
47
+ image?: string;
48
+ correctionJson?: string;
49
+ correctionDxf?: string;
50
+ correctionImage?: string;
51
+ gltf?: string;
52
+ glb?: string;
53
+ obj?: string;
54
+ };
55
+ };
56
+ /** 快捷构建需要的json文件
57
+ * @param opt
58
+ * @returns
59
+ */
60
+ export declare function buildJson(opt: HandleJsonOption): Promise<{
61
+ dxfSystem: DxfSystem;
62
+ threeVJia: import('./utils').Component<{}> | null;
63
+ whiteModel: WhiteModel | null;
64
+ }>;
65
+ /** 获取所有文件数据
66
+ * @param dxfSystem
67
+ */
68
+ export declare function getFileAll(dxfSystem?: DxfSystem): Promise<{
69
+ dxf: File;
70
+ obj: File;
71
+ glb: File;
72
+ gltf: File;
73
+ json: File;
74
+ jpg: File;
75
+ correctionDxf: File;
76
+ }>;
77
+ /** 获取全局DxfSystem
78
+ * @returns
79
+ */
80
+ export declare function getGlobalDxfSystem(): DxfSystem | null;
81
+ /** 检测原始数据线段一侧是否属于环
82
+ * @param lineData
83
+ * @param startIndex
84
+ * @param direction
85
+ * @returns
86
+ */
87
+ export declare function hasCircle(lineData: OriginalDataItem[], startIndex: number, direction: any): {
88
+ readonly originalIndices: number[];
89
+ readonly indices: number[];
90
+ circle: LineSegment<Record<string, any>>[];
91
+ originalLines: LineSegment<LineUserData>[];
92
+ lines: LineSegment<Record<string, any>>[];
93
+ } | null;
package/src/build.d.ts CHANGED
@@ -84,7 +84,7 @@ export declare function getGlobalDxfSystem(): DxfSystem | null;
84
84
  * @param direction
85
85
  * @returns
86
86
  */
87
- export declare function hasCircle(lineData: OriginalDataItem[], startIndex: number, direction: any): {
87
+ export declare function hasCircle(lineData: OriginalDataItem[], startIndex: number, direction?: any): {
88
88
  readonly originalIndices: number[];
89
89
  readonly indices: number[];
90
90
  circle: LineSegment<Record<string, any>>[];