mxcad 1.0.272 → 1.0.273
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/mxcad.d.ts +154 -38
- package/dist/mxcad.es.js +936 -343
- package/dist/mxcad.umd.js +2 -2
- package/dist/wasm/2d/mxdrawassembly_min.js +1922 -1860
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +1890 -1828
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +1 -1
package/dist/mxcad.d.ts
CHANGED
|
@@ -920,6 +920,13 @@ export declare class McGePoint3d {
|
|
|
920
920
|
*/
|
|
921
921
|
export declare class McGeVector3d {
|
|
922
922
|
/**
|
|
923
|
+
* 0长度向量
|
|
924
|
+
* @example
|
|
925
|
+
* ```ts
|
|
926
|
+
* ```
|
|
927
|
+
* */
|
|
928
|
+
static kIdentity: McGeVector3d;
|
|
929
|
+
/**
|
|
923
930
|
* X轴单位向量, 指向正 X 轴方向
|
|
924
931
|
* @example
|
|
925
932
|
* ```ts
|
|
@@ -1434,6 +1441,13 @@ export declare class McGeMatrix3d {
|
|
|
1434
1441
|
* ```
|
|
1435
1442
|
*/
|
|
1436
1443
|
scale(): number;
|
|
1444
|
+
/**
|
|
1445
|
+
* 获取矩阵在XY平面的旋转角度因子。
|
|
1446
|
+
* @returns旋转角度因子。
|
|
1447
|
+
* @example
|
|
1448
|
+
* ```
|
|
1449
|
+
*/
|
|
1450
|
+
angleXYPlane(): number;
|
|
1437
1451
|
/**
|
|
1438
1452
|
* 获取矩阵中指定位置的元素值。
|
|
1439
1453
|
* @param row 行索引。
|
|
@@ -1754,7 +1768,7 @@ export declare class McGePoint3dArray {
|
|
|
1754
1768
|
const myArray2 = new McGePoint3dArray(initialValues);
|
|
1755
1769
|
* ```
|
|
1756
1770
|
*/
|
|
1757
|
-
constructor(imp?: object);
|
|
1771
|
+
constructor(imp?: object, isDestroyImp?: boolean);
|
|
1758
1772
|
/**
|
|
1759
1773
|
* 复制对象的值
|
|
1760
1774
|
* @param val 三维点的数组
|
|
@@ -1895,7 +1909,7 @@ export declare class McGeDoubleArray {
|
|
|
1895
1909
|
const array = new McGeDoubleArray();
|
|
1896
1910
|
* ```
|
|
1897
1911
|
*/
|
|
1898
|
-
constructor(imp?: object);
|
|
1912
|
+
constructor(imp?: object, isDestroyImp?: boolean);
|
|
1899
1913
|
/**
|
|
1900
1914
|
* 复制对象的值
|
|
1901
1915
|
* @param val 双精度浮点数数组
|
|
@@ -4073,7 +4087,15 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4073
4087
|
* let ent:McDbEntity = id.getMcDbEntity();
|
|
4074
4088
|
* if (ent === null) return;
|
|
4075
4089
|
* // 打碎对象
|
|
4076
|
-
*
|
|
4090
|
+
* let retExplode: MxCADResbuf = ent.explode();
|
|
4091
|
+
* if (retExplode.GetCount() == 0) return;
|
|
4092
|
+
* let iExplodeConut = retExplode.GetCount();
|
|
4093
|
+
* for (let j = 0; j < iExplodeConut; j++) {
|
|
4094
|
+
* let tmpobj = retExplode.AtObject(j).val;
|
|
4095
|
+
* if(tmpobj instanceof McDbEntity ){
|
|
4096
|
+
* mxcad.drawEntity(tmpobj);
|
|
4097
|
+
* }
|
|
4098
|
+
* }
|
|
4077
4099
|
* ```
|
|
4078
4100
|
*/
|
|
4079
4101
|
explode(): MxCADResbuf;
|
|
@@ -5534,13 +5556,14 @@ export declare class McDbAttribute extends McDbText {
|
|
|
5534
5556
|
*/
|
|
5535
5557
|
get isInvisible(): boolean;
|
|
5536
5558
|
/**
|
|
5537
|
-
*
|
|
5559
|
+
* 设置块属性文字是否不可见
|
|
5538
5560
|
* @example
|
|
5539
5561
|
* ```ts
|
|
5540
5562
|
* import { McDbAttribute } from "mxcad";
|
|
5541
5563
|
*
|
|
5542
5564
|
* const attrib = new McDbAttribute();
|
|
5543
|
-
* attrib.isInvisible =
|
|
5565
|
+
* attrib.isInvisible = false;// 设置属性可见
|
|
5566
|
+
* attrib.isInvisible = true;// 设置属性不可见
|
|
5544
5567
|
*/
|
|
5545
5568
|
set isInvisible(val: boolean);
|
|
5546
5569
|
}
|
|
@@ -5581,6 +5604,7 @@ export declare class McDbAttributeDefinition extends McDbText {
|
|
|
5581
5604
|
*
|
|
5582
5605
|
* const attribute = new McDbAttributeDefinition();
|
|
5583
5606
|
* attribute.isInvisible = true; // 设置属性为不可见
|
|
5607
|
+
* attribute.isInvisible = false; // 设置属性为可见
|
|
5584
5608
|
* console.log(attribute.isInvisible); // 获取属性是否可见
|
|
5585
5609
|
* ```
|
|
5586
5610
|
*/
|
|
@@ -8275,6 +8299,76 @@ export declare class McDbBackgroundEntity extends McDbEntity {
|
|
|
8275
8299
|
*/
|
|
8276
8300
|
clearDwg(sDwgFile: string): boolean;
|
|
8277
8301
|
}
|
|
8302
|
+
/**
|
|
8303
|
+
* 样条线对象
|
|
8304
|
+
*/
|
|
8305
|
+
export declare class McDbSpline extends McDbCurve {
|
|
8306
|
+
/**
|
|
8307
|
+
* 构造函数
|
|
8308
|
+
* @param imp 实现对象
|
|
8309
|
+
* @example
|
|
8310
|
+
* ```
|
|
8311
|
+
*/
|
|
8312
|
+
constructor(imp?: any);
|
|
8313
|
+
/**
|
|
8314
|
+
* 得到样条线的数据.
|
|
8315
|
+
* @example
|
|
8316
|
+
* ```
|
|
8317
|
+
*/
|
|
8318
|
+
getNurbsData(): {
|
|
8319
|
+
degree: number;
|
|
8320
|
+
rational: boolean;
|
|
8321
|
+
closed: boolean;
|
|
8322
|
+
periodic: boolean;
|
|
8323
|
+
controlPoints: McGePoint3dArray;
|
|
8324
|
+
knots: McGeDoubleArray;
|
|
8325
|
+
weights: McGeDoubleArray;
|
|
8326
|
+
controlPtTol: number;
|
|
8327
|
+
knotTol: number;
|
|
8328
|
+
};
|
|
8329
|
+
/**
|
|
8330
|
+
* 设置样条线的数据.
|
|
8331
|
+
* @example
|
|
8332
|
+
* ```
|
|
8333
|
+
*/
|
|
8334
|
+
setNurbsData(data: {
|
|
8335
|
+
degree: number;
|
|
8336
|
+
rational: boolean;
|
|
8337
|
+
closed: boolean;
|
|
8338
|
+
periodic: boolean;
|
|
8339
|
+
controlPoints: McGePoint3dArray;
|
|
8340
|
+
knots: McGeDoubleArray;
|
|
8341
|
+
weights: McGeDoubleArray;
|
|
8342
|
+
controlPtTol: number;
|
|
8343
|
+
knotTol: number;
|
|
8344
|
+
}): boolean;
|
|
8345
|
+
/**
|
|
8346
|
+
* 得到样条线的拟合数据.
|
|
8347
|
+
* @example
|
|
8348
|
+
* ```
|
|
8349
|
+
*/
|
|
8350
|
+
getFitPoints(): {
|
|
8351
|
+
degree: number;
|
|
8352
|
+
fitTolerance: number;
|
|
8353
|
+
tangentsExist: boolean;
|
|
8354
|
+
startTangent: McGeVector3d;
|
|
8355
|
+
endTangent: McGeVector3d;
|
|
8356
|
+
fitPoints: McGePoint3dArray;
|
|
8357
|
+
};
|
|
8358
|
+
/**
|
|
8359
|
+
*设置样条线的拟合数据.
|
|
8360
|
+
* @example
|
|
8361
|
+
* ```
|
|
8362
|
+
*/
|
|
8363
|
+
setFitPoints(data: {
|
|
8364
|
+
degree: number;
|
|
8365
|
+
fitTolerance: number;
|
|
8366
|
+
tangentsExist: boolean;
|
|
8367
|
+
startTangent: McGeVector3d;
|
|
8368
|
+
endTangent: McGeVector3d;
|
|
8369
|
+
fitPoints: McGePoint3dArray;
|
|
8370
|
+
}): boolean;
|
|
8371
|
+
}
|
|
8278
8372
|
/**
|
|
8279
8373
|
* Dxf组码
|
|
8280
8374
|
* @public
|
|
@@ -9758,6 +9852,16 @@ export declare class McDbDatabase extends McRxObject {
|
|
|
9758
9852
|
* @param imp 内部实现对象。
|
|
9759
9853
|
*/
|
|
9760
9854
|
constructor(imp?: any);
|
|
9855
|
+
/**
|
|
9856
|
+
* 得到UCS用户坐标系变换矩阵
|
|
9857
|
+
* @example
|
|
9858
|
+
*/
|
|
9859
|
+
get ucsMatrix(): McGeMatrix3d;
|
|
9860
|
+
/**
|
|
9861
|
+
* 设置UCS用户坐标系变换矩阵
|
|
9862
|
+
* @example
|
|
9863
|
+
*/
|
|
9864
|
+
set ucsMatrix(val: McGeMatrix3d);
|
|
9761
9865
|
/**
|
|
9762
9866
|
* 获取层表。
|
|
9763
9867
|
* @returns 层表。
|
|
@@ -11019,10 +11123,10 @@ export declare class McObject {
|
|
|
11019
11123
|
*/
|
|
11020
11124
|
protected creaeCallId(): number;
|
|
11021
11125
|
/**
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11126
|
+
* 设置对象的一些属性设置
|
|
11127
|
+
* @param val 属性设置内容.
|
|
11128
|
+
* 1. DisplayPrecision 显示精度设置,默认为0,可以取0 ~1000,1000为最高精度了
|
|
11129
|
+
* 2. EnableUndo 启用undo功能,默认是没有启动的
|
|
11026
11130
|
* @example
|
|
11027
11131
|
* ```ts
|
|
11028
11132
|
* 启用undo
|
|
@@ -11043,8 +11147,8 @@ export declare class McObject {
|
|
|
11043
11147
|
*/
|
|
11044
11148
|
getMxDrawObject(): MxDrawObject;
|
|
11045
11149
|
/**
|
|
11046
|
-
|
|
11047
|
-
|
|
11150
|
+
* 返回与MxCAD对象绑定的MxDraw对象。
|
|
11151
|
+
* @returns MxDraw对象
|
|
11048
11152
|
* @example
|
|
11049
11153
|
* ```ts
|
|
11050
11154
|
* import { McObject } from 'mxcad'
|
|
@@ -11052,7 +11156,7 @@ export declare class McObject {
|
|
|
11052
11156
|
* const mxcad = new McObject()
|
|
11053
11157
|
* const mxdraw = mxcad.mxdraw
|
|
11054
11158
|
* ```
|
|
11055
|
-
|
|
11159
|
+
*/
|
|
11056
11160
|
get mxdraw(): MxDrawObject;
|
|
11057
11161
|
/**
|
|
11058
11162
|
* 获取内部实现对象
|
|
@@ -11071,19 +11175,19 @@ export declare class McObject {
|
|
|
11071
11175
|
* @example
|
|
11072
11176
|
* ```ts
|
|
11073
11177
|
* import { McObject } from "mxcad"
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11178
|
+
*
|
|
11179
|
+
* // 创建mxcad示例对象
|
|
11180
|
+
* const mxcad = new McObject()
|
|
11181
|
+
* mxcad.create({
|
|
11182
|
+
* // canvas元素的id
|
|
11183
|
+
* canvas: "#myCanvas",
|
|
11184
|
+
* // 获取加载wasm相关文件(wasm/js/worker.js)路径位置
|
|
11185
|
+
* locateFile: (fileName)=> new URL(`/node_modules/mxcad/dist/wasm/2d/${fileName}`, import.meta.url).href,
|
|
11186
|
+
* // 需要初始化打开的文件url路径
|
|
11187
|
+
* fileUrl: new URL("../src/assets/test.mxweb", import.meta.url).href,
|
|
11188
|
+
* // 提供加载字体的目录路径
|
|
11189
|
+
* fontspath: new URL("node_modules/mxcad/dist/fonts", import.meta.url).href,
|
|
11190
|
+
* })
|
|
11087
11191
|
* ```
|
|
11088
11192
|
*/
|
|
11089
11193
|
create(config: MxCadConfig): void;
|
|
@@ -11132,7 +11236,8 @@ export declare class McObject {
|
|
|
11132
11236
|
* import { MxCpp, McObject } from "mxcad"
|
|
11133
11237
|
*
|
|
11134
11238
|
* const mxcad:McObject = MxCpp.getCurrentMxCAD();
|
|
11135
|
-
* mxcad.
|
|
11239
|
+
* // e:事件函数,这里指代在mxcad.on("selectChange", e)中注册的函数
|
|
11240
|
+
* mxcad.off("selectChange", e);
|
|
11136
11241
|
* ```
|
|
11137
11242
|
*/
|
|
11138
11243
|
off(name: string, fun?: Function): void;
|
|
@@ -11209,21 +11314,27 @@ export declare class McObject {
|
|
|
11209
11314
|
addCurrentSelect(id: McObjectId | McObjectId[], isDisplayGrid?: boolean): void;
|
|
11210
11315
|
/**
|
|
11211
11316
|
* 清除当前所有选择
|
|
11317
|
+
* @example
|
|
11318
|
+
* ```ts
|
|
11319
|
+
* import { MxCpp, McObject } from "mxcad"
|
|
11320
|
+
*
|
|
11321
|
+
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
|
|
11322
|
+
* mxcad.clearCurrentSelect();
|
|
11212
11323
|
* ```
|
|
11213
11324
|
*/
|
|
11214
11325
|
clearMxCurrentSelect(): void;
|
|
11215
11326
|
/**
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11327
|
+
* 把当前显示范围移到指定的显示范围
|
|
11328
|
+
* @param minPt 坐标1 McGePoint3d
|
|
11329
|
+
* @param maxPt 坐标2 McGePoint3d
|
|
11330
|
+
* @param isWorld 默认为felse DWG图纸坐标,设置为true是THREEJS坐标
|
|
11331
|
+
* @returns void
|
|
11332
|
+
* @example
|
|
11333
|
+
* ```typescript
|
|
11334
|
+
* import { MxApp, McGePoint3d, McObject } from "mxcad"
|
|
11335
|
+
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
|
|
11336
|
+
* mxcad.zoomW(new McGePoint3d(0, 0), new McGePoint3d(30, 30))
|
|
11337
|
+
* ```
|
|
11227
11338
|
*/
|
|
11228
11339
|
zoomW(minPt: McGePoint3d, maxPt: McGePoint3d): void;
|
|
11229
11340
|
/**
|
|
@@ -11899,7 +12010,7 @@ export declare class McObject {
|
|
|
11899
12010
|
* @param dPosY 图片 Y 坐标
|
|
11900
12011
|
* @param dWidth 图片宽度
|
|
11901
12012
|
* @param dHeight 图片高度
|
|
11902
|
-
* @param dAng
|
|
12013
|
+
* @param dAng 图片角度,单位是度
|
|
11903
12014
|
* @param imageUrl 图片路径
|
|
11904
12015
|
*/
|
|
11905
12016
|
drawImage(dPosX: number, dPosY: number, dWidth: number, dHeight: number, dAng: number, imageUrl: string, isConvertBase64?: boolean, dwgImageSizeWidth?: number, dwgImageSizeHeight?: number): McObjectId;
|
|
@@ -12700,6 +12811,11 @@ export declare class McAppType {
|
|
|
12700
12811
|
* ```
|
|
12701
12812
|
*/
|
|
12702
12813
|
getVersionString(): string;
|
|
12814
|
+
/**
|
|
12815
|
+
* 得当前程序的数字日期版本信息
|
|
12816
|
+
* @return 数字日期版本信息
|
|
12817
|
+
*/
|
|
12818
|
+
GetVersionDateString(): string;
|
|
12703
12819
|
}
|
|
12704
12820
|
/**
|
|
12705
12821
|
* MxCppType 类封装了一系列与 CAD 相关的操作,包括创建点、向量、获取当前对象等
|