mxdraw 0.1.121 → 0.1.123

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.
Files changed (31) hide show
  1. package/dist/index.d.ts +194 -116
  2. package/dist/lib/MxModule/MxDbArcShape/index.d.ts +1 -2
  3. package/dist/lib/MxModule/MxDbArcShape/index.js +1 -1
  4. package/dist/lib/MxModule/MxDbArcShapeDraw/index.d.ts +1 -1
  5. package/dist/lib/MxModule/MxDbArrow/index.d.ts +20 -0
  6. package/dist/lib/MxModule/MxDbArrow/index.js +1 -0
  7. package/dist/lib/MxModule/MxDbCircleArc/index.d.ts +1 -1
  8. package/dist/lib/MxModule/MxDbEllipseArc/index.d.ts +2 -5
  9. package/dist/lib/MxModule/MxDbEllipseArc/index.js +1 -1
  10. package/dist/lib/MxModule/MxDbEllipseShape/index.d.ts +3 -0
  11. package/dist/lib/MxModule/MxDbEllipseShape/index.js +1 -1
  12. package/dist/lib/MxModule/MxDbLineShape/index.d.ts +21 -0
  13. package/dist/lib/MxModule/MxDbLineShape/index.js +1 -0
  14. package/dist/lib/MxModule/MxDbRegularPolygon/index.d.ts +6 -8
  15. package/dist/lib/MxModule/MxDbRegularPolygon/index.js +1 -1
  16. package/dist/lib/MxModule/MxDbRegularPolygonShape/index.d.ts +2 -1
  17. package/dist/lib/MxModule/MxDbRegularPolygonShape/index.js +1 -1
  18. package/dist/lib/MxModule/MxDbShape/index.d.ts +25 -3
  19. package/dist/lib/MxModule/MxDbShape/index.js +1 -1
  20. package/dist/lib/MxModule/MxDbStarShape/index.d.ts +3 -0
  21. package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +1 -1
  22. package/dist/lib/MxModule/MxDrawObject/index.d.ts +1 -1
  23. package/dist/lib/MxModule/MxFilters/index.d.ts +4 -0
  24. package/dist/lib/MxModule/MxFilters/index.js +1 -1
  25. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
  26. package/dist/lib/index.d.ts +6 -0
  27. package/dist/lib/mxdraw.d.ts +2 -0
  28. package/dist/lib/mxdraw.js +1 -1
  29. package/dist/mxdraw.es.js +1 -1
  30. package/dist/mxdraw.umd.js +1 -1
  31. package/package.json +3 -1
package/dist/index.d.ts CHANGED
@@ -1754,7 +1754,7 @@ declare class MxDrawObject {
1754
1754
  */
1755
1755
  isMxCAD(): boolean;
1756
1756
  /**
1757
- * 得到实执行的内部MxObject对象.
1757
+ * 得执行的内部MxObject对象.
1758
1758
  * @example
1759
1759
  * ```typescript
1760
1760
  *
@@ -3375,13 +3375,113 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
3375
3375
  getTypeName(): string;
3376
3376
  }
3377
3377
 
3378
+ /** 简单颜色滤镜矩阵 */
3379
+ interface ChannelParamTypes {
3380
+ r?: number;
3381
+ g?: number;
3382
+ b?: number;
3383
+ }
3384
+ declare class MxFilters {
3385
+ private uniformObj;
3386
+ private filtersStr;
3387
+ private filtersTypes;
3388
+ private VSHADER_SOURCE;
3389
+ private FSHADER_SOURCE;
3390
+ private _matrix;
3391
+ /**
3392
+ * 过滤或增强某个颜色通道
3393
+ * @param {ChannelParamTypes}
3394
+ * */
3395
+ channel({ r, g, b }: ChannelParamTypes): this;
3396
+ /**
3397
+ * 改变亮度
3398
+ * @param {number} p
3399
+ * p = 0 全暗,p > 0 且 p < 1 调暗,p = 1 原色, p > 1 调亮
3400
+ * */
3401
+ brightness(p: number): this;
3402
+ /**
3403
+ * 饱和度
3404
+ * @param {number} p
3405
+ * p = 0 完全灰度化,p = 1 原色,p > 1 增强饱和度
3406
+ * */
3407
+ saturate(p: number): this;
3408
+ /**
3409
+ * 对比度
3410
+ * @param {number} p
3411
+ * p = 1 原色, p < 1 减弱对比度,p > 1 增强对比度
3412
+ * */
3413
+ contrast(p: number): this;
3414
+ /**
3415
+ * 透明度
3416
+ * @param {number} p
3417
+ * p = 0 全透明,p = 1 原色
3418
+ * */
3419
+ opacity(p: number): this;
3420
+ /**
3421
+ * 反色
3422
+ * @param {number} p
3423
+ * p = 0 原色, p = 1 完全反色
3424
+ * */
3425
+ invert(p: number): this;
3426
+ /**
3427
+ * 灰度
3428
+ * @param {number} p 0~1
3429
+ * */
3430
+ grayscale(p?: number): this;
3431
+ /**
3432
+ * 深褐色
3433
+ * @param {number} p 0~1
3434
+ * */
3435
+ sepia(p?: number): this;
3436
+ /**
3437
+ * 色相旋转,将色调沿极坐标转过deg角度
3438
+ * @param {number} deg 0~360
3439
+ * */
3440
+ hueRotate(deg: number): this;
3441
+ /**
3442
+ * 色相旋转,将色调沿极坐标转过deg角度
3443
+ * @param {number} deg 0~360
3444
+ * */
3445
+ /**
3446
+ * 卷积
3447
+ * @param {Matrix3} cKernel 3*3的矩阵
3448
+ * @param {number} stStep 1 / 9
3449
+ * @param {number} scaleFactor 521
3450
+ * */
3451
+ convolution(cKernel: THREE.Matrix3, stStep?: number, scaleFactor?: number): this;
3452
+ /**
3453
+ * 重置所有滤镜效果
3454
+ * */
3455
+ reset(): this;
3456
+ _getFilterShaderData(texture: THREE.Texture): {
3457
+ uniforms: {
3458
+ e_Texture: {
3459
+ value: three.Texture;
3460
+ };
3461
+ colorMatrix: {
3462
+ value: three.Matrix4;
3463
+ };
3464
+ };
3465
+ vertexShader: string;
3466
+ fragmentShader: string;
3467
+ };
3468
+ _getFilterColor(color?: string | number | THREE.Color, opacity?: number): three.Color;
3469
+ /** 转成JSON字符串 */
3470
+ toJSON(): string;
3471
+ /** 还原序列化的数据 */
3472
+ static fromJSON(json: string): MxFilters;
3473
+ }
3474
+
3378
3475
  /** 动态绘制形状
3379
- * 基于THREE.Shape计算实现的2d形状 通过extrude3dConfig 配置可挤压缓冲为3d形状
3476
+ * 基于THREE.Shape计算实现的形状
3477
+ * 通过扩展可以实现各种2d 3d形状
3380
3478
  * **/
3381
3479
  declare class MxDbShape extends MxDbEntity {
3382
3480
  protected _paths: THREE.CurvePath<THREE.Vector3 | THREE.Vector2>;
3383
3481
  protected points: THREE.Vector3[];
3384
3482
  protected closedLine: THREE.Curve<THREE.Vector3>;
3483
+ protected isLoadMaterialFromPath: boolean;
3484
+ protected material: THREE.MeshLambertMaterial | null;
3385
3485
  /** 描边颜色 */
3386
3486
  stroke: UnstableColor;
3387
3487
  setStroke(stroke: UnstableColor): this;
@@ -3394,12 +3494,30 @@ declare class MxDbShape extends MxDbEntity {
3394
3494
  /** 填充 */
3395
3495
  isFill: boolean;
3396
3496
  setIsFill(isFill: boolean): this;
3497
+ /** 填充图片路径 */
3498
+ protected _fillImageSrc: string | false | null;
3499
+ get fillImageSrc(): string | false | null;
3500
+ set fillImageSrc(src: string | false | null);
3501
+ setFillImageSrc(fillImageSrc: string): this;
3502
+ /**
3503
+ * fillImageParam 填充背景图片的参数设置(如果使用了滤镜则部分参数功能失效)
3504
+ * */
3505
+ fillImageParam: {
3506
+ offset?: THREE.Vector2;
3507
+ repeat?: THREE.Vector2;
3508
+ rotation?: number;
3509
+ center?: THREE.Vector2;
3510
+ } | undefined;
3397
3511
  /** 线段细分数值 */
3398
3512
  curveSegments: number;
3399
3513
  setCurveSegments(curveSegments: number): this;
3400
3514
  /** 闭合 */
3401
3515
  closed: boolean;
3402
3516
  setClosed(closed: boolean): this;
3517
+ /**
3518
+ * 设置滤镜对象{@link MxFilters} 默认为undefined | null 则不使用该滤镜效果
3519
+ * */
3520
+ filter: MxFilters | undefined | null;
3403
3521
  /** 圆角半径 (一个向量点对应一个角的半径值)*/
3404
3522
  cornerRadius: number[] | number;
3405
3523
  /**
@@ -3422,13 +3540,13 @@ declare class MxDbShape extends MxDbEntity {
3422
3540
  _drawStoreLine(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[], draw?: (pWorldDraw: McGiWorldDraw) => void): void;
3423
3541
  /** 获取线段闭合后的曲线点数 */
3424
3542
  getClosedPoints(points: THREE.Vector3[]): three.Vector3[];
3425
- /** 获取闭合线段 */
3426
- getClosedLine(points: THREE.Vector3[]): THREE.Curve<THREE.Vector3>;
3427
3543
  /** 获取长度 */
3428
3544
  getTotalLength(): number;
3429
3545
  /** 获取面积 */
3430
3546
  getArea(): number;
3431
3547
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3548
+ /** 图片填充 */
3549
+ _fillImg(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[]): void;
3432
3550
  getGripPoints(): THREE.Vector3[];
3433
3551
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3434
3552
  dwgIn(obj: any): boolean;
@@ -3475,6 +3593,9 @@ declare class MxDbEllipseShape extends MxDbShape {
3475
3593
  };
3476
3594
  /** 创建圆弧 */
3477
3595
  createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): three.EllipseCurve;
3596
+ /** 获取圆角的点集合(椭圆不需要) */
3597
+ getCornerRadiusPoints(points: THREE.Vector3[]): three.Vector3[];
3598
+ getClosedPoints(points: THREE.Vector3[]): THREE.Vector3[];
3478
3599
  getClosedLine(points: THREE.Vector3[]): three.CatmullRomCurve3;
3479
3600
  getGripPoints(): three.Vector3[];
3480
3601
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
@@ -3565,99 +3686,6 @@ declare class MxDbLine extends MxDbEntity {
3565
3686
  getGetLength(): number;
3566
3687
  }
3567
3688
 
3568
- /** 简单颜色滤镜矩阵 */
3569
- interface ChannelParamTypes {
3570
- r?: number;
3571
- g?: number;
3572
- b?: number;
3573
- }
3574
- declare class MxFilters {
3575
- private uniformObj;
3576
- private filtersStr;
3577
- private filtersTypes;
3578
- private VSHADER_SOURCE;
3579
- private FSHADER_SOURCE;
3580
- private _matrix;
3581
- /**
3582
- * 过滤或增强某个颜色通道
3583
- * @param {ChannelParamTypes}
3584
- * */
3585
- channel({ r, g, b }: ChannelParamTypes): this;
3586
- /**
3587
- * 改变亮度
3588
- * @param {number} p
3589
- * p = 0 全暗,p > 0 且 p < 1 调暗,p = 1 原色, p > 1 调亮
3590
- * */
3591
- brightness(p: number): this;
3592
- /**
3593
- * 饱和度
3594
- * @param {number} p
3595
- * p = 0 完全灰度化,p = 1 原色,p > 1 增强饱和度
3596
- * */
3597
- saturate(p: number): this;
3598
- /**
3599
- * 对比度
3600
- * @param {number} p
3601
- * p = 1 原色, p < 1 减弱对比度,p > 1 增强对比度
3602
- * */
3603
- contrast(p: number): this;
3604
- /**
3605
- * 透明度
3606
- * @param {number} p
3607
- * p = 0 全透明,p = 1 原色
3608
- * */
3609
- opacity(p: number): this;
3610
- /**
3611
- * 反色
3612
- * @param {number} p
3613
- * p = 0 原色, p = 1 完全反色
3614
- * */
3615
- invert(p: number): this;
3616
- /**
3617
- * 灰度
3618
- * @param {number} p 0~1
3619
- * */
3620
- grayscale(p?: number): this;
3621
- /**
3622
- * 深褐色
3623
- * @param {number} p 0~1
3624
- * */
3625
- sepia(p?: number): this;
3626
- /**
3627
- * 色相旋转,将色调沿极坐标转过deg角度
3628
- * @param {number} deg 0~360
3629
- * */
3630
- hueRotate(deg: number): this;
3631
- /**
3632
- * 色相旋转,将色调沿极坐标转过deg角度
3633
- * @param {number} deg 0~360
3634
- * */
3635
- /**
3636
- * 卷积
3637
- * @param {Matrix3} cKernel 3*3的矩阵
3638
- * @param {number} stStep 1 / 9
3639
- * @param {number} scaleFactor 521
3640
- * */
3641
- convolution(cKernel: THREE.Matrix3, stStep?: number, scaleFactor?: number): this;
3642
- /**
3643
- * 重置所有滤镜效果
3644
- * */
3645
- reset(): this;
3646
- _getFilterShaderData(texture: THREE.Texture): {
3647
- uniforms: {
3648
- e_Texture: {
3649
- value: three.Texture;
3650
- };
3651
- colorMatrix: {
3652
- value: three.Matrix4;
3653
- };
3654
- };
3655
- vertexShader: string;
3656
- fragmentShader: string;
3657
- };
3658
- _getFilterColor(color?: string | number | THREE.Color, opacity?: number): three.Color;
3659
- }
3660
-
3661
3689
  /**
3662
3690
  * MxRectEntity 矩形对象.
3663
3691
  */
@@ -3898,10 +3926,7 @@ declare class MxDbCloudLine extends MxDbEntity {
3898
3926
  dwgOut(obj: any): object;
3899
3927
  }
3900
3928
 
3901
- /**
3902
- * MxDbRegularPolygon 正多边形
3903
- */
3904
- declare class MxDbRegularPolygon extends MxDbEntity {
3929
+ declare class MxDbRegularPolygon extends MxDbShape {
3905
3930
  /** 正多边形的中心点位置 */
3906
3931
  centerPoint: three.Vector3;
3907
3932
  /** 正多边形两条边之间的交点位置 */
@@ -3909,12 +3934,13 @@ declare class MxDbRegularPolygon extends MxDbEntity {
3909
3934
  /** 正多边形边的数量 */
3910
3935
  sidesNumber: number;
3911
3936
  getTypeName(): string;
3937
+ /**
3938
+ * MxDbRegularPolygon 正多边形
3939
+ */
3940
+ constructor();
3912
3941
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3913
3942
  getGripPoints(): THREE.Vector3[];
3914
3943
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3915
- create(): MxDbEntity;
3916
- dwgIn(obj: any): boolean;
3917
- dwgOut(obj: any): object;
3918
3944
  }
3919
3945
 
3920
3946
  /** @module MxDbLeadComment*/
@@ -4021,7 +4047,7 @@ declare class SpriteText extends THREE.Sprite {
4021
4047
  underline: boolean;
4022
4048
  fontStyle: TextFontStyle;
4023
4049
  fontVariant: string;
4024
- private _genCanvas;
4050
+ _genCanvas(): void;
4025
4051
  dispose(): void;
4026
4052
  }
4027
4053
  interface SpriteTextOptions {
@@ -4268,8 +4294,8 @@ declare class MxDbGradientLine extends MxDbEntity {
4268
4294
  }
4269
4295
 
4270
4296
  /**
4271
- * 根据中心点、椭圆开始点和结束点确定椭圆弧
4272
- * */
4297
+ * 根据中心点、椭圆开始点和结束点确定椭圆弧
4298
+ * */
4273
4299
  declare class MxDbEllipseArc extends MxDbEllipseShape {
4274
4300
  getTypeName(): string;
4275
4301
  constructor();
@@ -4279,16 +4305,13 @@ declare class MxDbEllipseArc extends MxDbEllipseShape {
4279
4305
  /** 椭圆弧决定结束点 控制y轴半径和结束角度*/
4280
4306
  endPoint: THREE.Vector3;
4281
4307
  setEndPoint(endPoint: THREE.Vector3): this;
4282
- /** 控制椭圆弧旋转角度的点 */
4283
- rotationPoint: THREE.Vector3;
4284
- setRotationPoint(rotationPoint: THREE.Vector3): this;
4285
4308
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4286
4309
  getGripPoints(): three.Vector3[];
4287
4310
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4288
4311
  }
4289
4312
 
4290
- /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
4291
4313
  declare class MxDbCircleArc extends MxDbCircleShape {
4314
+ /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
4292
4315
  constructor();
4293
4316
  getTypeName(): string;
4294
4317
  /** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
@@ -4303,11 +4326,10 @@ declare class MxDbCircleArc extends MxDbCircleShape {
4303
4326
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4304
4327
  }
4305
4328
 
4306
- /** 弧形 */
4307
4329
  declare class MxDbArcShape extends MxDbCircleArc {
4330
+ /** 环形 */
4308
4331
  constructor();
4309
4332
  getTypeName(): string;
4310
- create(): MxDbArcShape;
4311
4333
  center: three.Vector3;
4312
4334
  innerRadius: number;
4313
4335
  outerRadius: number;
@@ -4317,9 +4339,9 @@ declare class MxDbArcShape extends MxDbCircleArc {
4317
4339
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4318
4340
  }
4319
4341
 
4320
- /** 绘制弧形 */
4321
4342
  declare class MxDbArcShapeDraw extends MxDbArcShape {
4322
4343
  getTypeName(): string;
4344
+ /** 绘制弧形 */
4323
4345
  constructor();
4324
4346
  outerRadiusPoint: three.Vector3;
4325
4347
  interRadiusPoint: three.Vector3;
@@ -4339,8 +4361,11 @@ declare class MxDbStarShape extends MxDbShape {
4339
4361
  getTypeName(): string;
4340
4362
  constructor();
4341
4363
  center: three.Vector3;
4364
+ /** 顶点数量 */
4342
4365
  numPoints: number;
4366
+ /** 内部半径 */
4343
4367
  innerRadius: number;
4368
+ /** 外部半径 */
4344
4369
  outerRadius: number;
4345
4370
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4346
4371
  getGripPoints(): THREE.Vector3[];
@@ -4350,11 +4375,12 @@ declare class MxDbStarShape extends MxDbShape {
4350
4375
  /** 等边多边形 */
4351
4376
  declare class MxDbRegularPolygonShape extends MxDbShape {
4352
4377
  center: three.Vector3;
4353
- sides: number;
4378
+ sidesNumber: number;
4354
4379
  radius: number;
4355
4380
  getTypeName(): string;
4356
4381
  constructor();
4357
4382
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4383
+ _drawPolygonShape(pWorldDraw: McGiWorldDraw): void;
4358
4384
  _getPoints(): {
4359
4385
  x: number;
4360
4386
  y: number;
@@ -4363,6 +4389,45 @@ declare class MxDbRegularPolygonShape extends MxDbShape {
4363
4389
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4364
4390
  }
4365
4391
 
4392
+ declare class MxDbArrow extends MxDbShape {
4393
+ /** 箭头图形 */
4394
+ constructor();
4395
+ /** 开始是否为尖角 */
4396
+ isSharpCorner: boolean;
4397
+ /** 内部偏移量 */
4398
+ innerOffset: number;
4399
+ /** 外部偏移量 */
4400
+ outerOffset: number;
4401
+ /** 顶部偏移量 */
4402
+ topOffset: number;
4403
+ startPoint: three.Vector3;
4404
+ endPoint: three.Vector3;
4405
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
4406
+ getArrowVertex(p1: THREE.Vector3, p2: THREE.Vector3, isSharpCorner?: boolean): three.Vector3[] | undefined;
4407
+ getGripPoints(): THREE.Vector3[];
4408
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4409
+ }
4410
+
4411
+ /** 线形状 */
4412
+ declare class MxDbLineShape extends MxDbShape {
4413
+ points: THREE.Vector3[];
4414
+ setPoints(points: THREE.Vector3[]): this;
4415
+ addPoint(point: THREE.Vector3): this;
4416
+ removePoint(index: number): this;
4417
+ constructor();
4418
+ getTypeName(): string;
4419
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
4420
+ getGripPoints(): Array<THREE.Vector3>;
4421
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4422
+ /** 获取包围盒 */
4423
+ getGeomExtents(): THREE.Box3 | null;
4424
+ /**
4425
+ * 返回曲线长度.
4426
+ * @returns number
4427
+ */
4428
+ getGetLength(): number;
4429
+ }
4430
+
4366
4431
  declare const Mx_loadCoreCode: typeof loadCoreCode;
4367
4432
  declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
4368
4433
  declare const Mx_store: typeof store;
@@ -4455,6 +4520,10 @@ type Mx_MxDbStarShape = MxDbStarShape;
4455
4520
  declare const Mx_MxDbStarShape: typeof MxDbStarShape;
4456
4521
  type Mx_MxDbRegularPolygonShape = MxDbRegularPolygonShape;
4457
4522
  declare const Mx_MxDbRegularPolygonShape: typeof MxDbRegularPolygonShape;
4523
+ type Mx_MxDbArrow = MxDbArrow;
4524
+ declare const Mx_MxDbArrow: typeof MxDbArrow;
4525
+ type Mx_MxDbLineShape = MxDbLineShape;
4526
+ declare const Mx_MxDbLineShape: typeof MxDbLineShape;
4458
4527
  declare namespace Mx {
4459
4528
  export {
4460
4529
  Mx_loadCoreCode as loadCoreCode,
@@ -4510,7 +4579,16 @@ declare namespace Mx {
4510
4579
  Mx_MxDbRingShape as MxDbRingShape,
4511
4580
  Mx_MxDbStarShape as MxDbStarShape,
4512
4581
  Mx_MxDbRegularPolygonShape as MxDbRegularPolygonShape,
4582
+ Mx_MxDbArrow as MxDbArrow,
4583
+ Mx_MxDbLineShape as MxDbLineShape,
4513
4584
  };
4514
4585
  }
4515
4586
 
4516
- export { McEdGetPointWorldDrawObject, McGePoint3d, McGePoint3dArray, McGeTool, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MrxDbgUtils, Mx3PointArc, MxCADObject, MxDb2LineAngularDimension, MxDbAlignedDimension, MxDbAnyLine, MxDbArcShapeDraw, MxDbArea, MxDbCircleArc, MxDbCircleShape, MxDbCloudLine, MxDbCoord, MxDbDatabase, MxDbEllipse, MxDbEllipseArc, MxDbEllipseShape, MxDbEntity, MxDbGradientLine, MxDbGroup, MxDbHatch, MxDbImage, MxDbLayerTableRecord, MxDbLeadComment, MxDbLeadTag, MxDbLine, MxDbPolyline, MxDbRect, MxDbRectBoxLeadComment, MxDbRegularPolygon, MxDbRegularPolygonShape, MxDbRingShape, MxDbSVG, MxDbSVGText, MxDbShape, MxDbStarShape, MxDbText, MxDrawObject, MxFilters, MxFun, MxThreeJS, MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
4587
+ declare global {
4588
+ type THREE = typeof THREE;
4589
+ interface Window {
4590
+ THREE: typeof THREE;
4591
+ }
4592
+ }
4593
+
4594
+ export { McEdGetPointWorldDrawObject, McGePoint3d, McGePoint3dArray, McGeTool, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MrxDbgUtils, Mx3PointArc, MxCADObject, MxDb2LineAngularDimension, MxDbAlignedDimension, MxDbAnyLine, MxDbArcShapeDraw, MxDbArea, MxDbArrow, MxDbCircleArc, MxDbCircleShape, MxDbCloudLine, MxDbCoord, MxDbDatabase, MxDbEllipse, MxDbEllipseArc, MxDbEllipseShape, MxDbEntity, MxDbGradientLine, MxDbGroup, MxDbHatch, MxDbImage, MxDbLayerTableRecord, MxDbLeadComment, MxDbLeadTag, MxDbLine, MxDbLineShape, MxDbPolyline, MxDbRect, MxDbRectBoxLeadComment, MxDbRegularPolygon, MxDbRegularPolygonShape, MxDbRingShape, MxDbSVG, MxDbSVGText, MxDbShape, MxDbStarShape, MxDbText, MxDrawObject, MxFilters, MxFun, MxThreeJS, MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
@@ -1,10 +1,9 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbCircleArc from "../MxDbCircleArc";
3
- /** 弧形 */
4
3
  export default class MxDbArcShape extends MxDbCircleArc {
4
+ /** 环形 */
5
5
  constructor();
6
6
  getTypeName(): string;
7
- create(): MxDbArcShape;
8
7
  center: import("three").Vector3;
9
8
  innerRadius: number;
10
9
  outerRadius: number;
@@ -1 +1 @@
1
- import MxDbCircleArc from"../MxDbCircleArc";export default class MxDbArcShape extends MxDbCircleArc{constructor(){super(),this.center=new THREE.Vector3,this.innerRadius=10,this.outerRadius=20,this._propertyDbKeys=[...this._propertyDbKeys,"center","innerRadius","outerRadius"]}getTypeName(){return"MxDbArcShape"}create(){return new MxDbArcShape}worldDraw(e){this.drawArcShape(e)}drawArcShape(e){const{center:t,startAngle:r,endAngle:s,clockwise:i}=this,{x:n,y:a}=t;this.isClosedToCenter=!1;const c=this.createEllipseCurve(n,a,this.innerRadius,this.innerRadius,r,s,i),h=this.createEllipseCurve(n,a,this.outerRadius,this.outerRadius,s,r,!i),o=this.createPaths([c,h]);let u=this.getShapePoints(o);this._draw(e,u),this._drawStoreLine(e,u)}getGripPoints(){return[this.center]}moveGripPointsAt(e,t){return 0===e&&this.center.add(t),!0}};
1
+ import McGiWorldDrawType from"../McGiWorldDrawType";import MxDbCircleArc from"../MxDbCircleArc";export default class MxDbArcShape extends MxDbCircleArc{constructor(){super(),this.center=new THREE.Vector3,this.innerRadius=10,this.outerRadius=20,this._propertyDbKeys=[...this._propertyDbKeys,"center","innerRadius","outerRadius"]}getTypeName(){return"MxDbArcShape"}worldDraw(e){e.getType()===McGiWorldDrawType.kDynDragDraw?(e.drawCircle(this.center,this.innerRadius),e.drawCircle(this.center,this.outerRadius)):this.drawArcShape(e)}drawArcShape(e){const{center:r,startAngle:t,endAngle:i,clockwise:s}=this,{x:a,y:n}=r;this.isClosedToCenter=!1;const c=this.createEllipseCurve(a,n,this.innerRadius,this.innerRadius,t,i,s),h=this.createEllipseCurve(a,n,this.outerRadius,this.outerRadius,i,t,!s),o=this.createPaths([c,h]);let d=this.getShapePoints(o);this._draw(e,d),this._drawStoreLine(e,d)}getGripPoints(){return[this.center]}moveGripPointsAt(e,r){return 0===e&&this.center.add(r),!0}};
@@ -1,8 +1,8 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbArcShape from "../MxDbArcShape";
3
- /** 绘制弧形 */
4
3
  export default class MxDbArcShapeDraw extends MxDbArcShape {
5
4
  getTypeName(): string;
5
+ /** 绘制弧形 */
6
6
  constructor();
7
7
  outerRadiusPoint: import("three").Vector3;
8
8
  interRadiusPoint: import("three").Vector3;
@@ -0,0 +1,20 @@
1
+ import McGiWorldDraw from "../McGiWorldDraw";
2
+ import MxDbShape from "../MxDbShape";
3
+ export default class MxDbArrow extends MxDbShape {
4
+ /** 箭头图形 */
5
+ constructor();
6
+ /** 开始是否为尖角 */
7
+ isSharpCorner: boolean;
8
+ /** 内部偏移量 */
9
+ innerOffset: number;
10
+ /** 外部偏移量 */
11
+ outerOffset: number;
12
+ /** 顶部偏移量 */
13
+ topOffset: number;
14
+ startPoint: import("three").Vector3;
15
+ endPoint: import("three").Vector3;
16
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
17
+ getArrowVertex(p1: THREE.Vector3, p2: THREE.Vector3, isSharpCorner?: boolean): import("three").Vector3[] | undefined;
18
+ getGripPoints(): THREE.Vector3[];
19
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
20
+ }
@@ -0,0 +1 @@
1
+ import MxDbShape from"../MxDbShape";export default class MxDbArrow extends MxDbShape{constructor(){super(),this.isSharpCorner=!0,this.innerOffset=10,this.outerOffset=22,this.topOffset=36,this.startPoint=new THREE.Vector3,this.endPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"outerOffset","topOffset","innerOffset","isSharpCorner","startPoint","endPoint"]}worldDraw(t){const e=this.getArrowVertex(this.startPoint,this.endPoint);e&&(this._draw(t,e),this._drawStoreLine(t,e))}getArrowVertex(t,e,r=this.isSharpCorner){let{innerOffset:s,topOffset:n,outerOffset:o}=this;const i=[];i[3]=e;const x=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y));if(0===x)return;const h=-(e.x-t.x)/x,y=(e.y-t.y)/x,a=t.x+s,f=t.y+x-n,d=t.x+o,E=t.y+x-n,p=t.x-s,c=t.y+x-n,w=t.x-o,P=t.y+x-n;return r?(i[0]=t,i[6]=i[0]):(i[0]=new THREE.Vector3(t.x-(p-t.x)*y,t.y-(p-t.x)*h),i[6]=new THREE.Vector3(t.x+(p-t.x)*y,t.y+(p-t.x)*h),i[7]=i[0]),i[1]=new THREE.Vector3(t.x+(a-t.x)*y-(f-t.y)*h,t.y+(a-t.x)*h+(f-t.y)*y),i[2]=new THREE.Vector3(t.x+(d-t.x)*y-(E-t.y)*h,t.y+(d-t.x)*h+(E-t.y)*y),i[4]=new THREE.Vector3(t.x+(w-t.x)*y-(P-t.y)*h,t.y+(w-t.x)*h+(P-t.y)*y),i[5]=new THREE.Vector3(t.x+(p-t.x)*y-(c-t.y)*h,t.y+(p-t.x)*h+(c-t.y)*y),i}getGripPoints(){const t=new THREE.Vector3;return new THREE.Line3(this.startPoint,this.endPoint).getCenter(t),[this.startPoint,t,this.endPoint]}moveGripPointsAt(t,e){return 0===t&&this.startPoint.add(e),1===t&&(this.startPoint.add(e),this.endPoint.add(e)),2===t&&this.endPoint.add(e),!0}};
@@ -1,7 +1,7 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbCircleShape from "../MxDbCircleShape";
3
- /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
4
3
  export default class MxDbCircleArc extends MxDbCircleShape {
4
+ /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
5
5
  constructor();
6
6
  getTypeName(): string;
7
7
  /** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
@@ -1,8 +1,8 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbEllipseShape from "../MxDbEllipseShape";
3
3
  /**
4
- * 根据中心点、椭圆开始点和结束点确定椭圆弧
5
- * */
4
+ * 根据中心点、椭圆开始点和结束点确定椭圆弧
5
+ * */
6
6
  export default class MxDbEllipseArc extends MxDbEllipseShape {
7
7
  getTypeName(): string;
8
8
  constructor();
@@ -12,9 +12,6 @@ export default class MxDbEllipseArc extends MxDbEllipseShape {
12
12
  /** 椭圆弧决定结束点 控制y轴半径和结束角度*/
13
13
  endPoint: THREE.Vector3;
14
14
  setEndPoint(endPoint: THREE.Vector3): this;
15
- /** 控制椭圆弧旋转角度的点 */
16
- rotationPoint: THREE.Vector3;
17
- setRotationPoint(rotationPoint: THREE.Vector3): this;
18
15
  worldDraw(pWorldDraw: McGiWorldDraw): void;
19
16
  getGripPoints(): import("three").Vector3[];
20
17
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
@@ -1 +1 @@
1
- import{calculateArcAngle}from"../../tools/three";import MxDbEllipseShape from"../MxDbEllipseShape";export default class MxDbEllipseArc extends MxDbEllipseShape{constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint","rotationPoint"]}getTypeName(){return"MxDbEllipseArc"}setStartPoint(t){return this.startPoint=t,this}setEndPoint(t){return this.endPoint=t,this}setRotationPoint(t){return this.rotationPoint=t,this}worldDraw(t){let{center:i,startPoint:e,endPoint:s,rotationPoint:n}=this;e&&(this.xRadius=i.distanceTo(e),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(e,i,this.xRadius).angle)),s&&(this.yRadius=i.distanceTo(s),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(s,i,this.yRadius).angle)),n&&(this.rotation=THREE.MathUtils.degToRad(calculateArcAngle(n,i,i.distanceTo(n)).angle)),this.drawEllipseShape(t)}getGripPoints(){return[this.center,this.startPoint,this.endPoint,this.rotationPoint]}moveGripPointsAt(t,i){return 0===t&&(this.center.add(i),this.startPoint.add(i),this.endPoint.add(i),this.rotationPoint.add(i)),1===t&&this.startPoint.add(i),2===t&&this.endPoint.add(i),3===t&&this.rotationPoint.add(i),!0}};
1
+ import{calculateArcAngle}from"../../tools/three";import MxDbEllipseShape from"../MxDbEllipseShape";export default class MxDbEllipseArc extends MxDbEllipseShape{constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint"]}getTypeName(){return"MxDbEllipseArc"}setStartPoint(t){return this.startPoint=t,this}setEndPoint(t){return this.endPoint=t,this}worldDraw(t){let{center:e,startPoint:i,endPoint:s}=this;i&&(this.xRadius=e.distanceTo(i),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(i,e,this.xRadius).angle)),s&&(this.yRadius=e.distanceTo(s),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(s,e,this.yRadius).angle)),this.drawEllipseShape(t)}getGripPoints(){return[this.center,this.startPoint,this.endPoint]}moveGripPointsAt(t,e){return 0===t&&(this.center.add(e),this.startPoint.add(e),this.endPoint.add(e)),1===t&&this.startPoint.add(e),2===t&&this.endPoint.add(e),!0}};
@@ -40,6 +40,9 @@ export default class MxDbEllipseShape extends MxDbShape {
40
40
  };
41
41
  /** 创建圆弧 */
42
42
  createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): import("three").EllipseCurve;
43
+ /** 获取圆角的点集合(椭圆不需要) */
44
+ getCornerRadiusPoints(points: THREE.Vector3[]): import("three").Vector3[];
45
+ getClosedPoints(points: THREE.Vector3[]): THREE.Vector3[];
43
46
  getClosedLine(points: THREE.Vector3[]): import("three").CatmullRomCurve3;
44
47
  getGripPoints(): import("three").Vector3[];
45
48
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
@@ -1 +1 @@
1
- import MxDbShape from"../MxDbShape";export default class MxDbEllipseShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.xRadius=10,this.yRadius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!1,this.rotation=0,this.isClosedToCenter=!0,this._propertyDbKeys=[...this._propertyDbKeys,"center","xRadius","yRadius","startAngle","endAngle","clockwise","rotation","isClosedToCenter"]}getTypeName(){return"MxDbEllipseShape"}setCenter(t){return this.center=t,this}setXRadius(t){return this.xRadius=t,this}setYRadius(t){return this.yRadius=t,this}setStartAngle(t){return this.startAngle=t,this}setEndAngle(t){return this.endAngle=t,this}setClockwise(t){return this.clockwise=t,this}setRotation(t){return this.rotation=t,this}setIsClosedToCenter(t){return this.isClosedToCenter=t,this}worldDraw(t){this.drawEllipseShape(t)}drawEllipseShape(t){let{startAngle:e,endAngle:s,clockwise:r}=this;const i=this.createEllipseCurve(),n=this.createPaths(i);let a,l=this.getShapePoints(n);return this._draw(t,l),this._drawStoreLine(t,l),{centralAngle:a=r?s>e?THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle)):e>s?Math.abs(THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle)):360-THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle),curve:i,points:l}}createEllipseCurve(t=this.center.x,e=this.center.y,s=this.xRadius,r=this.yRadius,i=this.startAngle,n=this.endAngle,a=this.clockwise,l=this.rotation){return new THREE.EllipseCurve(t,e,s,r,i,n,a,l)}getClosedLine(t){const{isClosedToCenter:e,center:s}=this;let r=e?[t[t.length-1],s,t[0]]:[t[t.length-1],t[0]];return new THREE.CatmullRomCurve3(r,!1,"catmullrom",.01)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}};
1
+ import MxDbShape from"../MxDbShape";export default class MxDbEllipseShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.xRadius=10,this.yRadius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!1,this.rotation=0,this.isClosedToCenter=!0,this._propertyDbKeys=[...this._propertyDbKeys,"center","xRadius","yRadius","startAngle","endAngle","clockwise","rotation","isClosedToCenter"]}getTypeName(){return"MxDbEllipseShape"}setCenter(t){return this.center=t,this}setXRadius(t){return this.xRadius=t,this}setYRadius(t){return this.yRadius=t,this}setStartAngle(t){return this.startAngle=t,this}setEndAngle(t){return this.endAngle=t,this}setClockwise(t){return this.clockwise=t,this}setRotation(t){return this.rotation=t,this}setIsClosedToCenter(t){return this.isClosedToCenter=t,this}worldDraw(t){this.drawEllipseShape(t)}drawEllipseShape(t){let{startAngle:e,endAngle:s,clockwise:i}=this;const r=this.createEllipseCurve(),n=this.createPaths(r);let a,h=this.getShapePoints(n);return this._draw(t,h),this._drawStoreLine(t,h),{centralAngle:a=i?s>e?THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle)):e>s?Math.abs(THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle)):360-THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle),curve:r,points:h}}createEllipseCurve(t=this.center.x,e=this.center.y,s=this.xRadius,i=this.yRadius,r=this.startAngle,n=this.endAngle,a=this.clockwise,h=this.rotation){return new THREE.EllipseCurve(t,e,s,i,r,n,a,h)}getCornerRadiusPoints(t){return t}getClosedPoints(t){try{let e=(this._paths||new THREE.CatmullRomCurve3(t,!1,"catmullrom",0)).getLength();this.closedLine=this.getClosedLine(t);const s=this.closedLine.getLength();let i=this.curveSegments/e,r=2.5*(e>this.curveSegments?s*i:1);if(r>20*this.curveSegments&&(r=20*this.curveSegments),r<=0)return t;const n=this.closedLine.getPoints(r);return[...t,...n]}catch(e){return[...t,t[0]]}}getClosedLine(t){const{isClosedToCenter:e,center:s}=this;let i=e?[t[t.length-1],s,t[0]]:[t[t.length-1],t[0]];return new THREE.CatmullRomCurve3(i,!1,"catmullrom",.01)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}};
@@ -0,0 +1,21 @@
1
+ import McGiWorldDraw from "../McGiWorldDraw";
2
+ import MxDbShape from "../MxDbShape";
3
+ /** 线形状 */
4
+ export default class MxDbLineShape extends MxDbShape {
5
+ points: THREE.Vector3[];
6
+ setPoints(points: THREE.Vector3[]): this;
7
+ addPoint(point: THREE.Vector3): this;
8
+ removePoint(index: number): this;
9
+ constructor();
10
+ getTypeName(): string;
11
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
12
+ getGripPoints(): Array<THREE.Vector3>;
13
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
14
+ /** 获取包围盒 */
15
+ getGeomExtents(): THREE.Box3 | null;
16
+ /**
17
+ * 返回曲线长度.
18
+ * @returns number
19
+ */
20
+ getGetLength(): number;
21
+ }
@@ -0,0 +1 @@
1
+ import MxDbShape from"../MxDbShape";export default class MxDbLineShape extends MxDbShape{constructor(){super(),this.points=[],this._propertyDbKeys=[...this._propertyDbKeys,"points"]}setPoints(t){return this.points=t,this}addPoint(t){return this.points.push(t),this}removePoint(t){return this.points.splice(t,1),this}getTypeName(){return"MxDbLineShape"}worldDraw(t){this._draw(t,this.points),this._drawStoreLine(t,this.points)}getGripPoints(){return this.points}moveGripPointsAt(t,s){return this.points[t].add(s),!0}getGeomExtents(){return(new THREE.Box3).setFromPoints(this.points)}getGetLength(){let t=0;for(let s=0;s++;s<this.points.length)this.points[s+1]&&(t+=this.points[s].distanceTo(this.points[s+1]));return t}};
@@ -1,9 +1,6 @@
1
- import MxDbEntity from '../MxDbEntity';
2
1
  import McGiWorldDraw from '../McGiWorldDraw';
3
- /**
4
- * MxDbRegularPolygon 正多边形
5
- */
6
- export default class MxDbRegularPolygon extends MxDbEntity {
2
+ import MxDbShape from '../MxDbShape';
3
+ export default class MxDbRegularPolygon extends MxDbShape {
7
4
  /** 正多边形的中心点位置 */
8
5
  centerPoint: import("three").Vector3;
9
6
  /** 正多边形两条边之间的交点位置 */
@@ -11,10 +8,11 @@ export default class MxDbRegularPolygon extends MxDbEntity {
11
8
  /** 正多边形边的数量 */
12
9
  sidesNumber: number;
13
10
  getTypeName(): string;
11
+ /**
12
+ * MxDbRegularPolygon 正多边形
13
+ */
14
+ constructor();
14
15
  worldDraw(pWorldDraw: McGiWorldDraw): void;
15
16
  getGripPoints(): THREE.Vector3[];
16
17
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
17
- create(): MxDbEntity;
18
- dwgIn(obj: any): boolean;
19
- dwgOut(obj: any): object;
20
18
  }
@@ -1 +1 @@
1
- import MxDbEntity from"../MxDbEntity";import MxFun from"../MxFun";import McGiWorldDrawType from"../McGiWorldDrawType";import{createThreeRegularPolygon}from"../../tools/three/index";export default class MxDbRegularPolygon extends MxDbEntity{constructor(){super(...arguments),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=createThreeRegularPolygon(this.centerPoint,this.otherPoint,this.sidesNumber,t.getColor());if(e.geometry.computeBoundingBox(),t.getType()===McGiWorldDrawType.kSelectDraw){const r=new THREE.Vector3;e.geometry.boundingBox.getSize(r),r.addScalar(MxFun.screenCoordLong2Doc(10));const o=r.x/2,n=r.y/2,i={x:this.centerPoint.x-o,y:this.centerPoint.y-n},s={x:this.centerPoint.x+o,y:this.centerPoint.y-n},h={x:this.centerPoint.x+o,y:this.centerPoint.y+n},c={x:this.centerPoint.x-o,y:this.centerPoint.y+n};t.drawLine(i.x,i.y,s.x,s.y),t.drawLine(s.x,s.y,h.x,h.y),t.drawLine(h.x,h.y,c.x,c.y),t.drawLine(c.x,c.y,i.x,i.y)}t.drawEntity(e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}create(){return new MxDbRegularPolygon}dwgIn(t){return this.onDwgIn(t),this.centerPoint.copy(t.centerPoint),this.otherPoint.copy(t.otherPoint),this.sidesNumber=t.sidesNumber,!0}dwgOut(t){return this.onDwgOut(t),t.centerPoint=this.centerPoint,t.otherPoint=this.otherPoint,t.sidesNumber=this.sidesNumber,t}};
1
+ import{computeRegularPolygonVertices}from"../../tools/three/index";import MxDbShape from"../MxDbShape";export default class MxDbRegularPolygon extends MxDbShape{constructor(){super(),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5,this._propertyDbKeys=[...this._propertyDbKeys,"centerPoint","otherPoint","sidesNumber"]}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=computeRegularPolygonVertices(this.centerPoint,this.otherPoint,this.sidesNumber);this.closed=!1,e.push(e[0]),this._draw(t,e),this._drawStoreLine(t,e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}};
@@ -3,11 +3,12 @@ import MxDbShape from "../MxDbShape";
3
3
  /** 等边多边形 */
4
4
  export default class MxDbRegularPolygonShape extends MxDbShape {
5
5
  center: import("three").Vector3;
6
- sides: number;
6
+ sidesNumber: number;
7
7
  radius: number;
8
8
  getTypeName(): string;
9
9
  constructor();
10
10
  worldDraw(pWorldDraw: McGiWorldDraw): void;
11
+ _drawPolygonShape(pWorldDraw: McGiWorldDraw): void;
11
12
  _getPoints(): {
12
13
  x: number;
13
14
  y: number;