mxdraw 0.1.22 → 0.1.26
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/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +1 -128
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -5
- package/dist/lib/MxModule/McGePoint3d/McGePoint3d.js +1 -0
- package/dist/lib/MxModule/McGePoint3d/index.js +1 -0
- package/dist/lib/MxModule/McGePoint3dArray/McGePoint3dArray.js +1 -0
- package/dist/lib/MxModule/McGePoint3dArray/index.js +1 -0
- package/dist/lib/MxModule/McGeTool/McGeTool.js +1 -0
- package/dist/lib/MxModule/McGeTool/index.js +1 -0
- package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +1 -3
- package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -2
- package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +1 -19
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -4
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +1 -31
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -5
- package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +1 -159
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
- package/dist/lib/MxModule/Mx3PointArc/Mx3PointArc.js +1 -0
- package/dist/lib/MxModule/Mx3PointArc/index.js +1 -0
- package/dist/lib/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.js +1 -0
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +1 -0
- package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
- package/dist/lib/MxModule/MxDbAnyLine/MxDbAnyLine.js +1 -0
- package/dist/lib/MxModule/MxDbAnyLine/index.js +1 -0
- package/dist/lib/MxModule/MxDbArea/MxDbArea.js +1 -0
- package/dist/lib/MxModule/MxDbArea/index.js +1 -0
- package/dist/lib/MxModule/MxDbCloudLine/MxDbCloudLine.js +1 -0
- package/dist/lib/MxModule/MxDbCloudLine/index.js +1 -0
- package/dist/lib/MxModule/MxDbCoord/MxDbCoord.js +1 -0
- package/dist/lib/MxModule/MxDbCoord/index.js +1 -0
- package/dist/lib/MxModule/MxDbEllipse/MxDbEllipse.js +1 -0
- package/dist/lib/MxModule/MxDbEllipse/index.js +1 -0
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -258
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
- package/dist/lib/MxModule/MxDbImage/index.js +1 -5
- package/dist/lib/MxModule/MxDbLeadComment/MxDbLeadComment.js +1 -0
- package/dist/lib/MxModule/MxDbLeadComment/index.js +1 -0
- package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
- package/dist/lib/MxModule/MxDbLine/index.js +1 -5
- package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +1 -97
- package/dist/lib/MxModule/MxDbPolyline/index.js +1 -5
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
- package/dist/lib/MxModule/MxDbRect/index.js +1 -4
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.js +1 -0
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.js +1 -0
- package/dist/lib/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.js +1 -0
- package/dist/lib/MxModule/MxDbRegularPolygon/index.js +1 -0
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -419
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -21
- package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
- package/dist/lib/MxModule/MxDbText/MxDbText.js +1 -0
- package/dist/lib/MxModule/MxDbText/index.js +1 -0
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -782
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
- package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
- package/dist/lib/MxModule/MxFilters/index.js +1 -4
- package/dist/lib/MxModule/MxFun/MxFun.js +1 -683
- package/dist/lib/MxModule/MxFun/index.js +1 -4
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -296
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -29
- package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
- package/dist/lib/MxModule/MxType/MxType.js +1 -27
- package/dist/lib/MxModule/MxType/index.js +1 -4
- package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -20
- package/dist/lib/MxModule/Mxassembly/index.js +1 -9
- package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -312
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7760
- package/dist/lib/MxModule/store/PubsubClass.js +1 -40
- package/dist/lib/MxModule/store/StoreClass.js +1 -73
- package/dist/lib/MxModule/store/index.js +1 -19
- package/dist/lib/MxModule/store/store.js +1 -25
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
- package/dist/lib/doc.js +1 -38
- package/dist/lib/mxdraw.js +1 -67
- package/dist/lib/tools/algorithm/math.js +1 -16
- package/dist/lib/tools/algorithm/random.js +1 -13
- package/dist/lib/tools/dom/create.js +1 -47
- package/dist/lib/tools/dynamicImport/index.js +1 -243
- package/dist/lib/tools/formatting/index.js +1 -20
- package/dist/lib/tools/proxy/index.js +1 -17
- package/dist/lib/tools/three/index.js +1 -124
- package/dist/mxdraw.es5.js +1 -0
- package/dist/mxdraw.umd.js +1 -0
- package/dist/types/MxModule/McGePoint3d/McGePoint3d.d.ts +11 -0
- package/dist/types/MxModule/McGePoint3d/index.d.ts +3 -0
- package/dist/types/MxModule/McGePoint3dArray/McGePoint3dArray.d.ts +14 -0
- package/dist/types/MxModule/McGePoint3dArray/index.d.ts +3 -0
- package/dist/types/MxModule/McGeTool/McGeTool.d.ts +38 -0
- package/dist/types/MxModule/McGeTool/index.d.ts +4 -0
- package/dist/types/MxModule/Mx3PointArc/Mx3PointArc.d.ts +19 -0
- package/dist/types/MxModule/Mx3PointArc/index.d.ts +3 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.d.ts +22 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbAnyLine/MxDbAnyLine.d.ts +18 -0
- package/dist/types/MxModule/MxDbAnyLine/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbArea/MxDbArea.d.ts +17 -0
- package/dist/types/MxModule/MxDbArea/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbCloudLine/MxDbCloudLine.d.ts +27 -0
- package/dist/types/MxModule/MxDbCloudLine/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbCoord/MxDbCoord.d.ts +19 -0
- package/dist/types/MxModule/MxDbCoord/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbEllipse/MxDbEllipse.d.ts +18 -0
- package/dist/types/MxModule/MxDbEllipse/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbLeadComment/MxDbLeadComment.d.ts +17 -0
- package/dist/types/MxModule/MxDbLeadComment/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.d.ts +19 -0
- package/dist/types/MxModule/MxDbRectBoxLeadComment/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.d.ts +18 -0
- package/dist/types/MxModule/MxDbRegularPolygon/index.d.ts +2 -0
- package/dist/types/MxModule/MxDbText/MxDbText.d.ts +20 -0
- package/dist/types/MxModule/MxDbText/index.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +11 -0
- package/dist/types/MxModule/MxFun/MxFun.d.ts +8 -33
- package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +9 -3
- package/dist/types/mxdraw.d.ts +27 -2
- package/dist/types/tools/three/index.d.ts +41 -2
- package/package.json +3 -2
- package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +0 -3
- package/dist/lib/MxModule/McGeVector3d/index.js +0 -3
- package/dist/types/MxModule/McGeVector3d/McGeVector3d.d.ts +0 -18
- package/dist/types/MxModule/McGeVector3d/index.d.ts +0 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @module McGePoint3dArray */
|
|
2
|
+
import McGePoint3d from '../McGePoint3d';
|
|
3
|
+
/**
|
|
4
|
+
* McGePoint3dArray
|
|
5
|
+
* @example ```typescript
|
|
6
|
+
* ```
|
|
7
|
+
*/
|
|
8
|
+
export default interface McGePoint3dArray {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
append(pt: McGePoint3d): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** @module McGeTool */
|
|
2
|
+
import McGePoint3d from '../McGePoint3d';
|
|
3
|
+
import McGePoint3dArray from '../McGePoint3dArray';
|
|
4
|
+
/**
|
|
5
|
+
* McGeTool
|
|
6
|
+
* @example ```typescript
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
export default class McGeTool {
|
|
10
|
+
private mxgeTool;
|
|
11
|
+
private initImp;
|
|
12
|
+
/**
|
|
13
|
+
* 计算闭合的区域面积
|
|
14
|
+
* @param
|
|
15
|
+
* @return number
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
calcArea(aryPoint: McGePoint3dArray | THREE.Vector3[]): number;
|
|
20
|
+
/**
|
|
21
|
+
* 判断点是否在一个闭合的多边形区域。
|
|
22
|
+
* @param p
|
|
23
|
+
* @return any
|
|
24
|
+
* @example
|
|
25
|
+
* ``` typescript
|
|
26
|
+
* let aryPoint:Array<THREE.Vector3> = [];
|
|
27
|
+
* aryPoint.push(new THREE.Vector3(0,0,0));
|
|
28
|
+
* aryPoint.push(new THREE.Vector3(0,100,0));
|
|
29
|
+
* aryPoint.push(new THREE.Vector3(100,100,0));
|
|
30
|
+
* aryPoint.push(new THREE.Vector3(100,0,0));
|
|
31
|
+
* let pt:THREE.Vector3 = new THREE.Vector3(150,150);
|
|
32
|
+
* if(McGeTool.pointInPolyline(pt,aryPoint) ){
|
|
33
|
+
* console.log("in");
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
pointInPolyline(pt: McGePoint3d, aryPoint: McGePoint3dArray | THREE.Vector3[]): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @module Mx3PointArc*/
|
|
2
|
+
import { Vector3 } from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
/**
|
|
6
|
+
* Mx3PointArc 对象.
|
|
7
|
+
*/
|
|
8
|
+
export default class Mx3PointArc extends MxDbEntity {
|
|
9
|
+
point1: Vector3;
|
|
10
|
+
point2: Vector3;
|
|
11
|
+
point3: Vector3;
|
|
12
|
+
getTypeName(): string;
|
|
13
|
+
create(): MxDbEntity;
|
|
14
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
15
|
+
getGripPoints(): Vector3[];
|
|
16
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
17
|
+
dwgIn(obj: any): boolean;
|
|
18
|
+
dwgOut(obj: any): object;
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @module MxDb2LineAngularDimension*/
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { Vector3 } from 'three';
|
|
4
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
5
|
+
import MxDbEntity from '../MxDbEntity';
|
|
6
|
+
/**
|
|
7
|
+
* MxDb2LineAngularDimension 对象.
|
|
8
|
+
*/
|
|
9
|
+
export default class MxDb2LineAngularDimension extends MxDbEntity {
|
|
10
|
+
point1: THREE.Vector3;
|
|
11
|
+
point2: THREE.Vector3;
|
|
12
|
+
point3: THREE.Vector3;
|
|
13
|
+
private calculateLineAngle;
|
|
14
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
15
|
+
getGripPoints(): Vector3[];
|
|
16
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
17
|
+
dwgIn(obj: any): boolean;
|
|
18
|
+
dwgOut(obj: any): object;
|
|
19
|
+
create(): MxDbEntity;
|
|
20
|
+
transformBy(mat: THREE.Matrix4): void;
|
|
21
|
+
getTypeName(): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @module MxDbAnyLine*/
|
|
2
|
+
import { Vector3 } from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
/**
|
|
6
|
+
* MxDbAnyLine 对象.
|
|
7
|
+
*/
|
|
8
|
+
export default class MxDbAnyLine extends MxDbEntity {
|
|
9
|
+
points: Vector3[];
|
|
10
|
+
getTypeName(): string;
|
|
11
|
+
create(): MxDbEntity;
|
|
12
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
13
|
+
getCenter(): Vector3;
|
|
14
|
+
getGripPoints(): Vector3[];
|
|
15
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
16
|
+
dwgIn(obj: any): boolean;
|
|
17
|
+
dwgOut(obj: any): object;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @module MxDbArea*/
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
export default class MxDbArea extends MxDbEntity {
|
|
6
|
+
points: Array<THREE.Vector3>;
|
|
7
|
+
getTypeName(): string;
|
|
8
|
+
create(): MxDbEntity;
|
|
9
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
10
|
+
getGripPoints(): Array<THREE.Vector3>;
|
|
11
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
12
|
+
dwgIn(obj: any): boolean;
|
|
13
|
+
dwgOut(obj: any): object;
|
|
14
|
+
addPoint(pt: THREE.Vector3): void;
|
|
15
|
+
getPoints(): Array<THREE.Vector3>;
|
|
16
|
+
clearPoint(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @module MxDbCloudLine*/
|
|
2
|
+
import { Vector3 } from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
/**
|
|
6
|
+
* MxDbCloudLine 对象.
|
|
7
|
+
*/
|
|
8
|
+
export default class MxDbCloudLine extends MxDbEntity {
|
|
9
|
+
private points;
|
|
10
|
+
private radius;
|
|
11
|
+
private drawGeometry;
|
|
12
|
+
getTypeName(): string;
|
|
13
|
+
create(): MxDbEntity;
|
|
14
|
+
setRadius(radius: number): void;
|
|
15
|
+
getRadius(): number;
|
|
16
|
+
private clacNewArcDiameterPoint;
|
|
17
|
+
private createCloudArcCurvePoints;
|
|
18
|
+
addPoint(pt: THREE.Vector3, isAddToDrawGeometry?: boolean): void;
|
|
19
|
+
addLine(pt1: THREE.Vector3, pt2: THREE.Vector3): void;
|
|
20
|
+
reCalculateDrawGeometry(): void;
|
|
21
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
22
|
+
getCenter(): Vector3;
|
|
23
|
+
getGripPoints(): Vector3[];
|
|
24
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
25
|
+
dwgIn(obj: any): boolean;
|
|
26
|
+
dwgOut(obj: any): object;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @module MxDbCoord*/
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
/**
|
|
6
|
+
* MxDbCoord 对象.
|
|
7
|
+
*/
|
|
8
|
+
export default class MxDbCoord extends MxDbEntity {
|
|
9
|
+
point1: THREE.Vector3;
|
|
10
|
+
point2: THREE.Vector3;
|
|
11
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
12
|
+
getGripPoints(): Array<THREE.Vector3>;
|
|
13
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
14
|
+
dwgIn(obj: any): boolean;
|
|
15
|
+
dwgOut(obj: any): object;
|
|
16
|
+
create(): MxDbEntity;
|
|
17
|
+
transformBy(mat: THREE.Matrix4): void;
|
|
18
|
+
getTypeName(): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @module MxDbEllipse*/
|
|
2
|
+
import { Vector3 } from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
/**
|
|
6
|
+
* MxDbEllipse
|
|
7
|
+
*/
|
|
8
|
+
export default class MxDbEllipse extends MxDbEntity {
|
|
9
|
+
point1: Vector3;
|
|
10
|
+
point2: Vector3;
|
|
11
|
+
getTypeName(): string;
|
|
12
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
13
|
+
getGripPoints(): Vector3[];
|
|
14
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
15
|
+
create(): MxDbEntity;
|
|
16
|
+
dwgIn(obj: any): boolean;
|
|
17
|
+
dwgOut(obj: any): object;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @module MxDbLeadComment*/
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
export default class MxDbLeadComment extends MxDbEntity {
|
|
6
|
+
point1: THREE.Vector3;
|
|
7
|
+
point2: THREE.Vector3;
|
|
8
|
+
text: string;
|
|
9
|
+
textHeight: number;
|
|
10
|
+
getTypeName(): string;
|
|
11
|
+
create(): MxDbEntity;
|
|
12
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
13
|
+
getGripPoints(): Array<THREE.Vector3>;
|
|
14
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
15
|
+
dwgIn(obj: any): boolean;
|
|
16
|
+
dwgOut(obj: any): object;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @module MxDbRectBoxLeadComment*/
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
export default class MxDbRectBoxLeadComment extends MxDbEntity {
|
|
6
|
+
point1: THREE.Vector3;
|
|
7
|
+
point2: THREE.Vector3;
|
|
8
|
+
point3: THREE.Vector3;
|
|
9
|
+
text: string;
|
|
10
|
+
textHeight: number;
|
|
11
|
+
radius: number;
|
|
12
|
+
getTypeName(): string;
|
|
13
|
+
create(): MxDbEntity;
|
|
14
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
15
|
+
getGripPoints(): Array<THREE.Vector3>;
|
|
16
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
17
|
+
dwgIn(obj: any): boolean;
|
|
18
|
+
dwgOut(obj: any): object;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import MxDbEntity from '../MxDbEntity';
|
|
2
|
+
import { Vector3 } from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
/**
|
|
5
|
+
* MxDbRegularPolygon
|
|
6
|
+
*/
|
|
7
|
+
export default class MxDbRegularPolygon extends MxDbEntity {
|
|
8
|
+
centerPoint: Vector3;
|
|
9
|
+
otherPoint: Vector3;
|
|
10
|
+
sidesNumber: number;
|
|
11
|
+
getTypeName(): string;
|
|
12
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
13
|
+
getGripPoints(): Vector3[];
|
|
14
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
15
|
+
create(): MxDbEntity;
|
|
16
|
+
dwgIn(obj: any): boolean;
|
|
17
|
+
dwgOut(obj: any): object;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @module MxDbText*/
|
|
2
|
+
import { Vector3 } from 'three';
|
|
3
|
+
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
|
+
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
/**
|
|
6
|
+
* MxDbText
|
|
7
|
+
*/
|
|
8
|
+
export default class MxDbText extends MxDbEntity {
|
|
9
|
+
position: Vector3;
|
|
10
|
+
text: string;
|
|
11
|
+
height: number;
|
|
12
|
+
angle: number;
|
|
13
|
+
getTypeName(): string;
|
|
14
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
15
|
+
getGripPoints(): Vector3[];
|
|
16
|
+
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
17
|
+
create(): MxDbEntity;
|
|
18
|
+
dwgIn(obj: any): boolean;
|
|
19
|
+
dwgOut(obj: any): object;
|
|
20
|
+
}
|
|
@@ -664,4 +664,15 @@ export default class MxDrawObject {
|
|
|
664
664
|
* ```
|
|
665
665
|
*/
|
|
666
666
|
updateCanvasSize(): void;
|
|
667
|
+
/**
|
|
668
|
+
* 新建图纸.
|
|
669
|
+
* @param ptin1,ptin2新建图纸的显示范围.
|
|
670
|
+
* @returns
|
|
671
|
+
* @example
|
|
672
|
+
* ```typescript
|
|
673
|
+
*
|
|
674
|
+
*
|
|
675
|
+
* ```
|
|
676
|
+
*/
|
|
677
|
+
newFile(ptin1: THREE.Vector3 | number, ptin2: THREE.Vector3 | number, x2?: number, y2?: number): boolean;
|
|
667
678
|
}
|
|
@@ -51,7 +51,7 @@ interface CmdMangerType {
|
|
|
51
51
|
getMrxDbgUiPrPointClass(): any;
|
|
52
52
|
}
|
|
53
53
|
export interface MxFunType {
|
|
54
|
-
createMxObject(canvasId: string, arg1: string, arg2: (mxDraw: MxDrawObjectType) => void, is2d: boolean | undefined, isNewCreate?: boolean, isStaticLoad?: boolean): void;
|
|
54
|
+
createMxObject(canvasId: string, arg1: string | string[], arg2: (mxDraw: MxDrawObjectType) => void, is2d: boolean | undefined, isNewCreate?: boolean, isStaticLoad?: boolean): void;
|
|
55
55
|
setMxServer(MXSERVER: string): void;
|
|
56
56
|
addCommand(cmdName: string, fun: Function): void;
|
|
57
57
|
sendStringToExecute(sCmd: string, ...params: any[]): boolean;
|
|
@@ -82,11 +82,9 @@ export interface MxFunType {
|
|
|
82
82
|
setStaticServer(server: string): void;
|
|
83
83
|
initUiDataObject(uiDataObj: any): void;
|
|
84
84
|
loadImageMaterial(imageUrlPath: string, callResult: (material: MeshLambertMaterial) => void): void;
|
|
85
|
-
pointInPolyline(pt: THREE.Vector3, vecPolyline: Array<THREE.Vector3>): boolean;
|
|
86
|
-
calcArea(aryPoint: Array<THREE.Vector3>): number;
|
|
87
85
|
initMxDbEntityType(userObject: any): void;
|
|
88
86
|
initDynamicCreate(dynCreate: any): void;
|
|
89
|
-
openFile(sFile: string, useWebsocket: boolean): boolean;
|
|
87
|
+
openFile(sFile: string | string[], useWebsocket: boolean): boolean;
|
|
90
88
|
getMxJigCmdManager(): CmdMangerType;
|
|
91
89
|
loadSVG(url: string, color?: ColorType, callResult?: any): void;
|
|
92
90
|
getTHREE(): any;
|
|
@@ -125,7 +123,7 @@ export default class MxFun {
|
|
|
125
123
|
*/
|
|
126
124
|
createMxObject({ canvasId, cadFile, callback, isNewFile, useWebsocket, isAutoResize }: {
|
|
127
125
|
canvasId?: string;
|
|
128
|
-
cadFile?: string;
|
|
126
|
+
cadFile?: string | string[];
|
|
129
127
|
callback?: (mxDraw: MxDrawObject, dom: {
|
|
130
128
|
canvas: HTMLCanvasElement;
|
|
131
129
|
canvasParent: CanvasParent;
|
|
@@ -502,33 +500,6 @@ export default class MxFun {
|
|
|
502
500
|
* ```
|
|
503
501
|
*/
|
|
504
502
|
loadImageMaterial(imageUrlPath: string, callResult: (material: MeshLambertMaterial) => void | null): Promise<MeshLambertMaterial | null>;
|
|
505
|
-
/**
|
|
506
|
-
* 判断点是否在一个闭合的多边形区域。
|
|
507
|
-
* @param p
|
|
508
|
-
* @return any
|
|
509
|
-
* @example
|
|
510
|
-
* ``` typescript
|
|
511
|
-
* let aryPoint:Array<THREE.Vector3> = [];
|
|
512
|
-
* aryPoint.push(new THREE.Vector3(0,0,0));
|
|
513
|
-
* aryPoint.push(new THREE.Vector3(0,100,0));
|
|
514
|
-
* aryPoint.push(new THREE.Vector3(100,100,0));
|
|
515
|
-
* aryPoint.push(new THREE.Vector3(100,0,0));
|
|
516
|
-
* let pt:THREE.Vector3 = new THREE.Vector3(150,150);
|
|
517
|
-
* if(MxFun.pointInPolyline(pt,aryPoint) ){
|
|
518
|
-
* console.log("in");
|
|
519
|
-
* }
|
|
520
|
-
* ```
|
|
521
|
-
*/
|
|
522
|
-
pointInPolyline(pt: THREE.Vector3, vecPolyline: Array<THREE.Vector3>): boolean;
|
|
523
|
-
/**
|
|
524
|
-
* 计算多边形区域的面积
|
|
525
|
-
* @param p
|
|
526
|
-
* @return any
|
|
527
|
-
* @example
|
|
528
|
-
* ``` typescript
|
|
529
|
-
* ```
|
|
530
|
-
*/
|
|
531
|
-
calcArea(aryPoint: Array<THREE.Vector3>): number;
|
|
532
503
|
/**
|
|
533
504
|
* 重新打开cad文件,该函数在控件创建完后,需要再次重新打开文件,调用。
|
|
534
505
|
* @param sFile 打的cad文件路径
|
|
@@ -537,7 +508,7 @@ export default class MxFun {
|
|
|
537
508
|
* ``` typescript
|
|
538
509
|
* ```
|
|
539
510
|
*/
|
|
540
|
-
openFile(sFile: string, useWebsocket?: boolean): boolean;
|
|
511
|
+
openFile(sFile: string | string[], useWebsocket?: boolean): boolean;
|
|
541
512
|
/**
|
|
542
513
|
* 添加一个MxDbEntity实体到当前绘图对象上。
|
|
543
514
|
* @param ent 实体对象
|
|
@@ -586,5 +557,9 @@ export default class MxFun {
|
|
|
586
557
|
* 返回mxfun.min.js中的THREE.JS对象,可以用它来创建mxfun.min.js中THREE对象。
|
|
587
558
|
* */
|
|
588
559
|
getMxFunTHREE(): any;
|
|
560
|
+
/**
|
|
561
|
+
* 返回mxfun.min.js中的ThreeJsTool对象
|
|
562
|
+
* */
|
|
563
|
+
getMxFunThreeTool(): any;
|
|
589
564
|
}
|
|
590
565
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import McGePoint3d from '../McGePoint3d';
|
|
2
|
+
import McGePoint3dArray from '../McGePoint3dArray';
|
|
2
3
|
export interface MxassemblyType {
|
|
3
|
-
|
|
4
|
+
McGePoint3d: any;
|
|
5
|
+
McGePoint3dArray: any;
|
|
6
|
+
McGeTool: any;
|
|
4
7
|
}
|
|
5
8
|
/**
|
|
6
9
|
* Mxassembly 模块
|
|
@@ -10,5 +13,8 @@ export interface MxassemblyType {
|
|
|
10
13
|
*/
|
|
11
14
|
export default class Mxassembly {
|
|
12
15
|
constructor();
|
|
13
|
-
|
|
16
|
+
private mxassembly;
|
|
17
|
+
private initImp;
|
|
18
|
+
NewMcGePoint3d(x?: number, y?: number, z?: number): McGePoint3d;
|
|
19
|
+
NewMcGePoint3dArray(aryPoint?: Array<THREE.Vector3>): McGePoint3dArray;
|
|
14
20
|
}
|
package/dist/types/mxdraw.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ import MxDbImage from './MxModule/MxDbImage';
|
|
|
11
11
|
import MxDbSVG from './MxModule/MxDbSVG';
|
|
12
12
|
import MxDbSVGText from './MxModule/MxDbSVGText';
|
|
13
13
|
import MxDbPolyline from './MxModule/MxDbPolyline';
|
|
14
|
+
import MxDb2LineAngularDimension from './MxModule/MxDb2LineAngularDimension';
|
|
15
|
+
import Mx3PointArc from './MxModule/Mx3PointArc';
|
|
16
|
+
import MxDbCoord from './MxModule/MxDbCoord';
|
|
14
17
|
import MxDbLine from './MxModule/MxDbLine';
|
|
15
18
|
import MxDbRect from './MxModule/MxDbRect';
|
|
16
19
|
import MxDbAlignedDimension from './MxModule/MxDbAlignedDimension';
|
|
@@ -19,11 +22,22 @@ import McGiWorldDraw from './MxModule/McGiWorldDraw';
|
|
|
19
22
|
import McGiWorldDrawType from './MxModule/McGiWorldDrawType';
|
|
20
23
|
import MxType from './MxModule/MxType';
|
|
21
24
|
import Mxassembly from './MxModule/Mxassembly';
|
|
22
|
-
import
|
|
23
|
-
|
|
25
|
+
import MxDbArea from './MxModule/MxDbArea';
|
|
26
|
+
import MxDbAnyLine from './MxModule/MxDbAnyLine';
|
|
27
|
+
import MxDbCloudLine from './MxModule/MxDbCloudLine';
|
|
28
|
+
import MxDbRegularPolygon from './MxModule/MxDbRegularPolygon';
|
|
29
|
+
import McGePoint3d from './MxModule/McGePoint3d';
|
|
30
|
+
import McGePoint3dArray from './MxModule/McGePoint3dArray';
|
|
31
|
+
import McGeTool from './MxModule/McGeTool';
|
|
32
|
+
import MxDbLeadComment from './MxModule/MxDbLeadComment';
|
|
33
|
+
import MxDbRectBoxLeadComment from './MxModule/MxDbRectBoxLeadComment';
|
|
34
|
+
import MxDbEllipse from './MxModule/MxDbEllipse';
|
|
35
|
+
import MxDbText from './MxModule/MxDbText';
|
|
36
|
+
export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea, MxDbAnyLine, MxDbCloudLine, MxDbLeadComment, MxDbRectBoxLeadComment, MxDbEllipse, MxDbText, MxDbRegularPolygon };
|
|
24
37
|
declare const _default: {
|
|
25
38
|
MxFun: import("./doc").MxFun;
|
|
26
39
|
Mxassembly: import("./MxModule/Mxassembly/Mxassembly").default;
|
|
40
|
+
McGeTool: import("./MxModule/McGeTool/McGeTool").default;
|
|
27
41
|
MxThreeJS: import("./doc").MxThreeJS;
|
|
28
42
|
McEdGetPointWorldDrawObject: typeof McEdGetPointWorldDrawObject;
|
|
29
43
|
MrxDbgUiPrPoint: typeof MrxDbgUiPrPoint;
|
|
@@ -34,6 +48,9 @@ declare const _default: {
|
|
|
34
48
|
MxDbSVG: typeof MxDbSVG;
|
|
35
49
|
MxDbSVGText: typeof MxDbSVGText;
|
|
36
50
|
MxDbPolyline: typeof MxDbPolyline;
|
|
51
|
+
Mx3PointArc: typeof Mx3PointArc;
|
|
52
|
+
MxDbCoord: typeof MxDbCoord;
|
|
53
|
+
MxDb2LineAngularDimension: typeof MxDb2LineAngularDimension;
|
|
37
54
|
MxDbRect: typeof MxDbRect;
|
|
38
55
|
MxDbAlignedDimension: typeof MxDbAlignedDimension;
|
|
39
56
|
useCanvasResizeListener: typeof useCanvasResizeListener;
|
|
@@ -46,5 +63,13 @@ declare const _default: {
|
|
|
46
63
|
}>;
|
|
47
64
|
MrxDbgUiPrBaseReturn: typeof MrxDbgUiPrBaseReturn;
|
|
48
65
|
McGiWorldDrawType: typeof McGiWorldDrawType;
|
|
66
|
+
MxDbArea: typeof MxDbArea;
|
|
67
|
+
MxDbAnyLine: typeof MxDbAnyLine;
|
|
68
|
+
MxDbCloudLine: typeof MxDbCloudLine;
|
|
69
|
+
MxDbLeadComment: typeof MxDbLeadComment;
|
|
70
|
+
MxDbRectBoxLeadComment: typeof MxDbRectBoxLeadComment;
|
|
71
|
+
MxDbEllipse: typeof MxDbEllipse;
|
|
72
|
+
MxDbText: typeof MxDbText;
|
|
73
|
+
MxDbRegularPolygon: typeof MxDbRegularPolygon;
|
|
49
74
|
};
|
|
50
75
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColorType } from '@/MxModule/MxType/MxType';
|
|
2
|
+
import { Vector3, Color, Line, Geometry, LineLoop } from 'three';
|
|
2
3
|
/**
|
|
3
4
|
* 移动geometry坐标。
|
|
4
5
|
* @param geometry Three的Geometry对象
|
|
@@ -14,7 +15,7 @@ export declare function setGeometrPostion(geometry: THREE.Geometry, pos: THREE.V
|
|
|
14
15
|
* 生成圆角时修复纹理对应的 uvs
|
|
15
16
|
* @param geometry 几何体
|
|
16
17
|
* */
|
|
17
|
-
export declare function repairGeometryFaceVertexUvs(geometry: THREE.Geometry):
|
|
18
|
+
export declare function repairGeometryFaceVertexUvs(geometry: THREE.Geometry): Geometry;
|
|
18
19
|
/**
|
|
19
20
|
* 获取生成圆角的points定点位置
|
|
20
21
|
* @param points 生成圆角前
|
|
@@ -28,3 +29,41 @@ export declare function getToGenerateRoundedCorners(points: THREE.Vector3[], cor
|
|
|
28
29
|
* @param pt3 点3
|
|
29
30
|
* */
|
|
30
31
|
export declare function computeRectPoints(pt1: Vector3, pt3: Vector3): Vector3[];
|
|
32
|
+
/**
|
|
33
|
+
* 计算圆弧任意点到原点的的各种角度
|
|
34
|
+
* @param pt1 圆弧任意一点
|
|
35
|
+
* @param origin 原点(圆心点)
|
|
36
|
+
* @param radius 半径
|
|
37
|
+
*/
|
|
38
|
+
export declare function calculateArcAngle(pt1: Vector3, origin: Vector3, radius: number): {
|
|
39
|
+
sin: number;
|
|
40
|
+
cos: number;
|
|
41
|
+
angle: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 三点创建圆弧
|
|
45
|
+
* @param pt1 开始点
|
|
46
|
+
* @param pt2 圆弧任意一点
|
|
47
|
+
* @param pt3 结束点
|
|
48
|
+
* @param isRule 默认 false pt1是圆弧起始点 pt2圆弧任意一点 pt3是圆弧结束点 否则 pt1是圆弧起始点 pt2是圆弧结束点 pt3是圆弧任意一点
|
|
49
|
+
* @param alwaysClockwise 默认 false 圆弧根据三个点的角度关系自动确定是顺时针渲染函数逆时针方向渲染 否则为true始终顺时针方向渲染
|
|
50
|
+
* @param color 颜色值
|
|
51
|
+
*/
|
|
52
|
+
export declare function createThreePointArc(pt1: Vector3, pt2: Vector3, pt3: Vector3, isRule?: boolean, alwaysClockwise?: boolean, color?: Color): {
|
|
53
|
+
arc: Line;
|
|
54
|
+
radius: number;
|
|
55
|
+
angle: number;
|
|
56
|
+
arcLength: number;
|
|
57
|
+
};
|
|
58
|
+
export declare function createAnyLine(points: Vector3[]): Line;
|
|
59
|
+
/**
|
|
60
|
+
* 绘制椭圆 */
|
|
61
|
+
export declare function createThreeEllipse(pt1: Vector3, pt3: Vector3, color: ColorType): Line;
|
|
62
|
+
export declare function computeRegularPolygonVertices(centerPt?: Vector3, pt?: Vector3, segments?: number): Vector3[];
|
|
63
|
+
/**
|
|
64
|
+
* 创建正多边形
|
|
65
|
+
* @param centerPt 中点
|
|
66
|
+
* @param pt 边角一点
|
|
67
|
+
* @param segments 边数
|
|
68
|
+
* */
|
|
69
|
+
export declare function createThreeRegularPolygon(centerPt: Vector3, pt: Vector3, segments: number, color: ColorType): LineLoop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mxdraw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/mxdraw.umd.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
|
|
26
26
|
"prebuild": "rimraf dist",
|
|
27
27
|
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs && node compress",
|
|
28
|
-
"builddebug": "tsc --module commonjs && rollup -c rollup.config.ts
|
|
28
|
+
"builddebug": "tsc --module commonjs && rollup -c rollup.config.ts",
|
|
29
29
|
"oldDocs": "typedoc --out docs --target es6 --theme minimal --mode file src",
|
|
30
30
|
"docs": "npm run patch && npm run doctoc && typedoc --out docs",
|
|
31
31
|
"start": "rollup -c rollup.config.ts -w",
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
"rollup-plugin-node-resolve": "^3.4.0",
|
|
118
118
|
"rollup-plugin-sizes": "^1.0.4",
|
|
119
119
|
"rollup-plugin-sourcemaps": "^0.4.2",
|
|
120
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
120
121
|
"rollup-plugin-typescript2": "^0.31.1",
|
|
121
122
|
"rollup-plugin-visualizer": "^5.5.2",
|
|
122
123
|
"semantic-release": "^15.9.16",
|