mxdraw 0.1.87 → 0.1.91

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.
@@ -32,6 +32,7 @@ export default class MxCADObject {
32
32
  openFile(file: string, retfun?: (ret: Object) => void): void;
33
33
  /**
34
34
  * 保存CAD文件
35
+ * 文件保存路径,在bin/release/ini.json, 中server.savepath设置。默认保存到,bin/release/public/save目录下。
35
36
  * @example
36
37
  * ```typescript
37
38
  *
@@ -81,12 +81,4 @@ export default class MxDbDatabase {
81
81
  * ```
82
82
  */
83
83
  deleteGroup(sName: string): MxDbGroup;
84
- /**
85
- *通过id得到对象.
86
- * @example
87
- * ```typescript
88
- *
89
- * ```
90
- */
91
- getEntity(id: number): MxDbEntity;
92
84
  }
@@ -141,6 +141,12 @@ export default abstract class MxDbEntity {
141
141
  * @returns void
142
142
  */
143
143
  transformBy(mat: THREE.Matrix4): void;
144
+ /**
145
+ * 返回对象最小外包.
146
+ * @param
147
+ * @returns void
148
+ */
149
+ getGeomExtents(): THREE.Box3 | null;
144
150
  private getImp;
145
151
  /**
146
152
  * 更新显示
@@ -222,43 +228,64 @@ export default abstract class MxDbEntity {
222
228
  */
223
229
  getRenderOrder(): number;
224
230
  /**
225
- * 设置虚线数据
231
+ * 设置线宽是否随像素
226
232
  * @returns number
227
233
  */
228
- setDash(dDashArray: number, dDashRatio: number): void;
234
+ setLineWidthByPixels(isPixels: boolean): void;
229
235
  /**
230
- * 得到虚线数据
236
+ * 线宽是否随像素
231
237
  * @returns number
232
238
  */
233
- getDash(): any;
239
+ getLineWidthByPixels(): boolean;
234
240
  /**
235
- * 设置虚线显示。并初始化一个默认值。
241
+ * 设置线宽
236
242
  * @returns number
237
243
  */
238
- setDashLineDisplay(isDashLine: boolean): void;
244
+ setLineWidth(dLineWidth: number): void;
239
245
  /**
240
- * 是否虚线显示
246
+ * 得到线宽
241
247
  * @returns number
242
248
  */
243
- isDashLineDisplay(): boolean;
249
+ getLineWidth(): number;
244
250
  /**
245
- * 设置线宽是否随像素
251
+ * 返回曲线长度
246
252
  * @returns number
247
253
  */
248
- setLineWidthByPixels(isPixels: boolean): void;
254
+ getGetLength(): number;
249
255
  /**
250
- * 线宽是否随像素
256
+ * 设置虚线 +实线的长度.
257
+ * dDashRatio确定虚线,与实线的比率.
251
258
  * @returns number
252
259
  */
253
- getLineWidthByPixels(): boolean;
260
+ setDashLen(dashLen: number): void;
254
261
  /**
255
- * 设置线宽
262
+ * 设置虚线,与实线的比率
256
263
  * @returns number
257
264
  */
258
- setLineWidth(dLineWidth: number): void;
265
+ setDashRatio(dDashRatio: number): void;
259
266
  /**
260
- * 得到线宽
267
+ * 设置实线虚线总段数 = 1 / dashArray
261
268
  * @returns number
262
269
  */
263
- getLineWidth(): number;
270
+ setDashArray(dDashArray: number): void;
271
+ /**
272
+ * 设置虚线数据
273
+ * @returns number
274
+ */
275
+ setDash(dDashArray: number, dDashRatio: number): void;
276
+ /**
277
+ * 得到虚线数据
278
+ * @returns number
279
+ */
280
+ getDash(): any;
281
+ /**
282
+ * 设置虚线显示。并初始化一个默认值。
283
+ * @returns number
284
+ */
285
+ setDashLineDisplay(isDashLine: boolean): void;
286
+ /**
287
+ * 是否虚线显示
288
+ * @returns number
289
+ */
290
+ isDashLineDisplay(): boolean;
264
291
  }
@@ -23,4 +23,10 @@ export default class MxDbLine extends MxDbEntity {
23
23
  dwgIn(obj: any): boolean;
24
24
  dwgOut(obj: any): object;
25
25
  create(): MxDbEntity;
26
+ getGeomExtents(): THREE.Box3 | null;
27
+ /**
28
+ * 返回曲线长度.
29
+ * @returns number
30
+ */
31
+ getGetLength(): number;
26
32
  }
@@ -1,5 +1,4 @@
1
- /** @module MxDbText*/
2
- import { Vector3 } from 'three';
1
+ import THREE, { Vector3 } from 'three';
3
2
  import McGiWorldDraw from '../McGiWorldDraw';
4
3
  import MxDbEntity from '../MxDbEntity';
5
4
  /**
@@ -7,7 +6,7 @@ import MxDbEntity from '../MxDbEntity';
7
6
  */
8
7
  export default class MxDbText extends MxDbEntity {
9
8
  /** 文字所在位置*/
10
- position: Vector3;
9
+ position: THREE.Vector3;
11
10
  /** 文字内容*/
12
11
  text: string;
13
12
  /** 文字高度*/
@@ -21,4 +20,5 @@ export default class MxDbText extends MxDbEntity {
21
20
  create(): MxDbEntity;
22
21
  dwgIn(obj: any): boolean;
23
22
  dwgOut(obj: any): object;
23
+ getGeomExtents(): THREE.Box3 | null;
24
24
  }
@@ -771,4 +771,26 @@ export default class MxDrawObject {
771
771
  * @example
772
772
  */
773
773
  closeWebSocket(): any;
774
+ /**
775
+ * CAD坐标到文档坐标.
776
+ * 默认情况下,cad等于doc,当前m_isCorrectLargeCoordinates为true时,doc变成了把cad图纸修改到小范围坐标系下的坐标。
777
+ * @returns number
778
+ * @example
779
+ * ```typescript
780
+ *
781
+ *
782
+ * ```
783
+ */
784
+ cadCoord2Doc(x: number, y: number, z: number): THREE.Vector3;
785
+ /**
786
+ * 文档坐标坐标到CAD.
787
+ * 默认情况下,cad等于doc,当前m_isCorrectLargeCoordinates为true时,doc变成了把cad图纸修改到小范围坐标系下的坐标。
788
+ * @returns number
789
+ * @example
790
+ * ```typescript
791
+ *
792
+ *
793
+ * ```
794
+ */
795
+ docCoord2Cad(x: number, y: number, z: number): THREE.Vector3;
774
796
  }
@@ -556,5 +556,27 @@ export default class MxFun {
556
556
  * 调用服务器后台CAD命令.
557
557
  * */
558
558
  callCommand(cmd: string, param: string, retCall?: (param: any) => void): any;
559
+ /**
560
+ * CAD坐标到文档坐标.
561
+ * 默认情况下,cad等于doc,当前m_isCorrectLargeCoordinates为true时,doc变成了把cad图纸修改到小范围坐标系下的坐标。
562
+ * @returns number
563
+ * @example
564
+ * ```typescript
565
+ *
566
+ *
567
+ * ```
568
+ */
569
+ cadCoord2Doc(x: number, y: number, z: number): THREE.Vector3;
570
+ /**
571
+ * 文档坐标坐标到CAD.
572
+ * 默认情况下,cad等于doc,当前m_isCorrectLargeCoordinates为true时,doc变成了把cad图纸修改到小范围坐标系下的坐标。
573
+ * @returns number
574
+ * @example
575
+ * ```typescript
576
+ *
577
+ *
578
+ * ```
579
+ */
580
+ docCoord2Cad(x: number, y: number, z: number): THREE.Vector3;
559
581
  }
560
582
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxdraw",
3
- "version": "0.1.87",
3
+ "version": "0.1.91",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/mxdraw.umd.js",