mxcad 1.0.162 → 1.0.164
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 +87 -7
- package/dist/mxcad.es.js +593 -353
- package/dist/mxcad.umd.js +2 -2
- package/dist/wasm/2d/mxdrawassembly_min.js +976 -976
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +975 -975
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +1 -1
package/dist/mxcad.d.ts
CHANGED
|
@@ -307,6 +307,7 @@ export declare class McGeVector3d {
|
|
|
307
307
|
* @param dZ Z 坐标。
|
|
308
308
|
*/
|
|
309
309
|
constructor(dX?: number | object, dY?: number, dZ?: number);
|
|
310
|
+
/** 转换为THREE.Vector3 */
|
|
310
311
|
toVector3(): THREE.Vector3;
|
|
311
312
|
/**
|
|
312
313
|
* 复制对象的值
|
|
@@ -317,18 +318,34 @@ export declare class McGeVector3d {
|
|
|
317
318
|
*/
|
|
318
319
|
clone(): McGeVector3d;
|
|
319
320
|
c(): McGeVector3d;
|
|
321
|
+
/** 旋转
|
|
322
|
+
* @param ang 旋转角度。
|
|
323
|
+
* @param axis 旋转轴向量
|
|
324
|
+
* */
|
|
320
325
|
rotateBy(ang: number, axis?: McGeVector3d): this;
|
|
326
|
+
/** 向量取反 */
|
|
321
327
|
negate(): this;
|
|
328
|
+
/** 垂直的向量 */
|
|
322
329
|
perpVector(): this;
|
|
330
|
+
/** 计算角度 */
|
|
323
331
|
angleTo1(vec: McGeVector3d): number;
|
|
332
|
+
/** 计算角度 */
|
|
324
333
|
angleTo2(vec: McGeVector3d, refVec: McGeVector3d): number;
|
|
334
|
+
/** 归一化操作 */
|
|
325
335
|
normalize(): this;
|
|
336
|
+
/** 向量长度 */
|
|
326
337
|
length(): number;
|
|
338
|
+
/** 是否为单位向量 */
|
|
327
339
|
isUnitLength(): boolean;
|
|
340
|
+
/** 是否为零向量 */
|
|
328
341
|
isZeroLength(): boolean;
|
|
342
|
+
/** 点积 */
|
|
329
343
|
dotProduct(vec: McGeVector3d): number;
|
|
344
|
+
/** 交叉积 */
|
|
330
345
|
crossProduct(vec: McGeVector3d): McGeVector3d;
|
|
346
|
+
/** 判断比较向量是否相等 */
|
|
331
347
|
isEqualTo(vec: McGeVector3d): boolean;
|
|
348
|
+
/** 向量与某个值相乘 */
|
|
332
349
|
mult(val: number): this;
|
|
333
350
|
/**
|
|
334
351
|
* X 坐标。
|
|
@@ -2185,26 +2202,53 @@ export declare class McDbHatch extends McDbEntity {
|
|
|
2185
2202
|
* @param imp 内部对象。
|
|
2186
2203
|
*/
|
|
2187
2204
|
constructor(x?: object);
|
|
2205
|
+
/** 循环次数 */
|
|
2188
2206
|
get numLoops(): number;
|
|
2207
|
+
/** 某次循环索引中的类型 */
|
|
2189
2208
|
loopTypeAt(loopIndex: number): number;
|
|
2209
|
+
/** 获取索引的值
|
|
2210
|
+
* @param loopIndex index 循环的索引
|
|
2211
|
+
* @returns { Object } ret 是否成功获取 | lootype 类型 | vertices 坐标集合 | bulges凸度集合
|
|
2212
|
+
* @example
|
|
2213
|
+
* ```ts
|
|
2214
|
+
* import { McDbHatch } from "mxcad"
|
|
2215
|
+
* const hatch = new McDbHatch()
|
|
2216
|
+
* const numLoops = hatch.numLoops;
|
|
2217
|
+
* for (let i = 0; i < numLoops; i++) {
|
|
2218
|
+
* const loop = hatch.getLoopAt(i);
|
|
2219
|
+
* console.log(loop)
|
|
2220
|
+
* };
|
|
2221
|
+
* ```
|
|
2222
|
+
* */
|
|
2190
2223
|
getLoopAt(loopIndex: number): {
|
|
2191
2224
|
ret: boolean;
|
|
2192
2225
|
lootype: number;
|
|
2193
2226
|
vertices: McGePoint3d[];
|
|
2194
2227
|
bulges: number[];
|
|
2195
2228
|
};
|
|
2229
|
+
/** 填充图案类型 */
|
|
2196
2230
|
patternType(): number;
|
|
2231
|
+
/** 填充图案名称 */
|
|
2197
2232
|
patternName(): string;
|
|
2233
|
+
/** 设置填充图案 */
|
|
2198
2234
|
setPattern(type: number, patName: string): void;
|
|
2235
|
+
/** 填充图案角度 */
|
|
2199
2236
|
get patternAngle(): number;
|
|
2200
2237
|
set patternAngle(angle: number);
|
|
2238
|
+
/** 填充图案缩放比例 */
|
|
2201
2239
|
get patternScale(): number;
|
|
2202
2240
|
set patternScale(scale: number);
|
|
2241
|
+
/** 填充图案空间 */
|
|
2203
2242
|
get patternSpace(): number;
|
|
2204
2243
|
set patternSpace(space: number);
|
|
2205
2244
|
get patternDouble(): boolean;
|
|
2206
2245
|
set patternDouble(isDouble: boolean);
|
|
2246
|
+
/** 图案定义的数量 */
|
|
2207
2247
|
get numPatternDefinitions(): number;
|
|
2248
|
+
/** 获取对应图案定义的数据
|
|
2249
|
+
* @param index 索引
|
|
2250
|
+
* @returns { Object } ret 是否成功获取 | angle 角度 | baseX, baseY 基点位置 | offsetX, offsetY 偏移位置 | aryDashes 短划线数据
|
|
2251
|
+
* */
|
|
2208
2252
|
getPatternDefinitionAt(index: number): {
|
|
2209
2253
|
ret: boolean;
|
|
2210
2254
|
angle: number;
|
|
@@ -2214,14 +2258,45 @@ export declare class McDbHatch extends McDbEntity {
|
|
|
2214
2258
|
offsetY: number;
|
|
2215
2259
|
aryDashes: number[];
|
|
2216
2260
|
};
|
|
2261
|
+
/** 添加图案定义
|
|
2262
|
+
* @param angle 角度 如 45
|
|
2263
|
+
* @param baseX 基点x坐标
|
|
2264
|
+
* @param baseY 基点y坐标
|
|
2265
|
+
* @param offsetX 偏移x坐标
|
|
2266
|
+
* @param offsetY 偏移y坐标
|
|
2267
|
+
* @param dashes 短划线数据
|
|
2268
|
+
* @example
|
|
2269
|
+
* ```ts
|
|
2270
|
+
* import { McDbHatch } from "mxcad"
|
|
2271
|
+
* const hatch = new McDbHatch()
|
|
2272
|
+
* hatch.addPatternDefinition(45, 0, 0, 0, 0.25, [45, 0.17677695, 0, 0, 0.25, 0.125, -0.0625])
|
|
2273
|
+
* ```
|
|
2274
|
+
* @returns { Boolean } 是否成功添加图案定义
|
|
2275
|
+
* */
|
|
2217
2276
|
addPatternDefinition(angle: number, baseX: number, baseY: number, offsetX: number, offsetY: number, dashes: number[]): boolean;
|
|
2277
|
+
/** 清空图案定义 */
|
|
2218
2278
|
clearPatternDefinition(): boolean;
|
|
2279
|
+
/** 填充样式 */
|
|
2219
2280
|
hatchStyle(): McDb.HatchStyle;
|
|
2281
|
+
/** 设置填充样式 */
|
|
2220
2282
|
setHatchStyle(val: McDb.HatchStyle): void;
|
|
2221
2283
|
evaluateHatch(): boolean;
|
|
2284
|
+
/** 追加循环
|
|
2285
|
+
* @param loopType 循环类型
|
|
2286
|
+
* @param vertices 坐标集合
|
|
2287
|
+
* @param bulges 凸度集合
|
|
2288
|
+
* */
|
|
2222
2289
|
appendLoop(loopType: number, vertices: McGePoint3dArray, bulges: number[]): boolean;
|
|
2290
|
+
/** 删除某个索引下的循环 */
|
|
2223
2291
|
removeLoopAt(loopIndex: number): boolean;
|
|
2292
|
+
/** 删除所有循环 */
|
|
2224
2293
|
removeAllLoop(): boolean;
|
|
2294
|
+
/** 设置某个索引下的循环数据
|
|
2295
|
+
* @param loopIndex 循环索引
|
|
2296
|
+
* @param loopType 循环类型
|
|
2297
|
+
* @param vertices 坐标集合
|
|
2298
|
+
* @param bulges 凸度集合
|
|
2299
|
+
* */
|
|
2225
2300
|
setLoopAt(loopIndex: number, loopType: number, vertices: McGePoint3dArray, bulges: number[]): boolean;
|
|
2226
2301
|
isSolid(): boolean;
|
|
2227
2302
|
}
|
|
@@ -2826,7 +2901,7 @@ export declare class McObject {
|
|
|
2826
2901
|
/** 监听对象选择事件
|
|
2827
2902
|
* @example
|
|
2828
2903
|
* ```ts
|
|
2829
|
-
* import { MxCpp } from
|
|
2904
|
+
* import { MxCpp } from "mxcad"
|
|
2830
2905
|
* MxCpp.getCurrentMxCAD().on("selectChange", (ids)=> {
|
|
2831
2906
|
* let ent = id.getMcDbEntity()
|
|
2832
2907
|
* if(!ent) return
|
|
@@ -2929,7 +3004,7 @@ export declare class McObject {
|
|
|
2929
3004
|
* @param fetchAttributes 1:EMSCRIPTEN_FETCH_LOAD_TO_MEMORY,把图纸数据加载内存中,0:EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_PERSIST_FILE | EMSCRIPTEN_FETCH_APPEND,把图纸数据加到IndexedDB。
|
|
2930
3005
|
* @returns 是否成功打开文件
|
|
2931
3006
|
*/
|
|
2932
|
-
openWebFile(sFileUrl: string, retCall?: (iRet: number) => void, isWorkThread?: boolean, initialParameter?: object, fetchAttributes?: number): boolean;
|
|
3007
|
+
openWebFile(sFileUrl: string, retCall?: (iRet: number) => void, isWorkThread?: boolean, initialParameter?: object, fetchAttributes?: number, isFetchTzFile?: boolean): boolean;
|
|
2933
3008
|
/**
|
|
2934
3009
|
*清空当前图上内容,新建一个文件
|
|
2935
3010
|
*/
|
|
@@ -3909,12 +3984,17 @@ export declare class Color extends ObjectInheritance {
|
|
|
3909
3984
|
}
|
|
3910
3985
|
export interface Color extends McCmColor {
|
|
3911
3986
|
}
|
|
3912
|
-
/** 绘制文字
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3987
|
+
/** 绘制文字
|
|
3988
|
+
* @param height 文字高度
|
|
3989
|
+
* @param text 文字内容
|
|
3990
|
+
* @param position 文字位置
|
|
3991
|
+
* @param angle 文件角度
|
|
3992
|
+
* @param color 文字颜色
|
|
3993
|
+
*/
|
|
3994
|
+
export declare function drawText(): Promise<McObjectId | undefined>;
|
|
3995
|
+
export declare function drawCircle(): Promise<McObjectId | undefined>;
|
|
3916
3996
|
export declare function drawLine(): Promise<void>;
|
|
3917
|
-
export declare function drawMText(): Promise<
|
|
3997
|
+
export declare function drawMText(): Promise<McObjectId | undefined>;
|
|
3918
3998
|
export declare function drawPolyLine(): Promise<void>;
|
|
3919
3999
|
export declare function drawPolygon(): Promise<void>;
|
|
3920
4000
|
export declare function drawArc(): Promise<void>;
|