@manycore/custom-sdk 3.1.5 → 3.1.6

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 (3) hide show
  1. package/index.d.ts +131 -3
  2. package/index.js +20 -20
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { CSSProperties } from 'react';
1
2
  import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
2
3
  import { IServClientService } from 'servkit';
3
4
  import { Number2 as Number2_2 } from '@manycore/custom-miniapp-sdk';
@@ -990,6 +991,33 @@ export declare enum EProductDirection {
990
991
  XZ = 2
991
992
  }
992
993
 
994
+ /**
995
+ * | z
996
+ * | / y
997
+ * | /
998
+ * | /
999
+ * | / x
1000
+ * /— — — — — —
1001
+ * 空间方向
1002
+ */
1003
+ export declare enum ESpaceDirection {
1004
+ /**
1005
+ * X轴向
1006
+ * 一般对应模型的宽度
1007
+ */
1008
+ X = 'DirectionX',
1009
+ /**
1010
+ * Y轴向
1011
+ * 一般对应模型的深度
1012
+ */
1013
+ Y = 'DirectionY',
1014
+ /**
1015
+ * Z轴向
1016
+ * 一般对应模型的高度
1017
+ */
1018
+ Z = 'DirectionZ',
1019
+ }
1020
+
993
1021
  /**
994
1022
  * 定制行业工具线
995
1023
  */
@@ -1050,7 +1078,6 @@ export declare enum ETriggerType {
1050
1078
  DB_CLICK = 'double_click',
1051
1079
  }
1052
1080
 
1053
- /** @ignore */
1054
1081
  export declare enum Face {
1055
1082
  Bottom = 'bottom',
1056
1083
  Front = 'front',
@@ -2474,6 +2501,11 @@ export declare class FittingDesignService extends BaseService {
2474
2501
  plankFace?: IHintBase;
2475
2502
  }
2476
2503
 
2504
+ export declare interface IModelFields {
2505
+ id: string;
2506
+ prodCatId: number;
2507
+ }
2508
+
2477
2509
  /**
2478
2510
  * 设置模型高亮时的配置信息
2479
2511
  * @example
@@ -3478,6 +3510,27 @@ export declare class FittingDesignService extends BaseService {
3478
3510
 
3479
3511
  export declare type IRoundCornerGrooveDataWithId = IRoundCornerGrooveData & IGrooveId;
3480
3512
 
3513
+ export declare interface IRulerLineOption {
3514
+ /**
3515
+ * 线条风格
3516
+ */
3517
+ lineStyle: Partial<{
3518
+ /**
3519
+ * 颜色
3520
+ */
3521
+ color: string | number;
3522
+ /**
3523
+ * 不透明度
3524
+ * @default 1
3525
+ */
3526
+ opacity: number;
3527
+ }>;
3528
+ /**
3529
+ * 字体风格
3530
+ */
3531
+ textStyle: CSSProperties;
3532
+ }
3533
+
3481
3534
  /**
3482
3535
  * 高亮模型描述
3483
3536
  */
@@ -3965,13 +4018,11 @@ export declare class FittingDesignService extends BaseService {
3965
4018
  /**
3966
4019
  * 相机视角调整
3967
4020
  * @param face
3968
- * @ignore
3969
4021
  */
3970
4022
  focusFace(face: Face): void;
3971
4023
  /**
3972
4024
  * 更新相机类型
3973
4025
  * @param type
3974
- * @ignore
3975
4026
  */
3976
4027
  updateCameraType(type: CameraType): void;
3977
4028
  /**
@@ -4419,6 +4470,83 @@ export declare class FittingDesignService extends BaseService {
4419
4470
  ? R
4420
4471
  : T;
4421
4472
 
4473
+ /**
4474
+ * 模型尺寸线、间距线服务,支持对指定模型的尺寸以及间距进行标记
4475
+ */
4476
+ export declare class RulerLineService extends BaseService {
4477
+ /**
4478
+ * 绘制尺寸线
4479
+ * 默认X轴方向线条为红色,Y轴方向为绿色,Z轴方向为蓝色
4480
+ * @param param.modelIds 需要绘制尺寸线的模型集合(若需要合并多个模型做展示 可使用数组完成)
4481
+ * @param param.direction 尺寸线方向
4482
+ * @param option.lineStyle 可选的线条风格选项 可定制线条颜色透明度
4483
+ * @param option.textStyle 可选的字体风格选项 可定制字体样式
4484
+ * @returns {string} 返回代表线段的唯一id 可用于清除该接口产生的线段
4485
+ * @example
4486
+ * ```ts
4487
+ * const rulerLineService = application.getService(RulerLineService);
4488
+ * const lineXId = rulerLineService.drawDimensionLine({ modelIds: ['3BA0609E-FBCF-4AE1-A8D2-89F202BB81A9'], direction: ESpaceDirection.X });
4489
+ * const lineYId = rulerLineService.drawDimensionLine({ modelIds: ['3BA0609E-FBCF-4AE1-A8D2-89F202BB81A9'], direction: ESpaceDirection.Y });
4490
+ * const lineZId = rulerLineService.drawDimensionLine({ modelIds: ['3BA0609E-FBCF-4AE1-A8D2-89F202BB81A9'], direction: ESpaceDirection.Z });
4491
+ * ```
4492
+ */
4493
+ drawDimensionLine: (param: {
4494
+ modelIds: string[];
4495
+ direction: ESpaceDirection;
4496
+ }, option?: Partial<IRulerLineOption> | undefined) => string;
4497
+ /**
4498
+ * 去除尺寸线
4499
+ * @example
4500
+ * ```ts
4501
+ * const rulerLineService = application.getService(RulerLineService);
4502
+ * rulerLineService.removeDimensionLine(lineXId);
4503
+ * ```
4504
+ */
4505
+ removeDimensionLine(lineId: string): void;
4506
+ /**
4507
+ * 清空尺寸线
4508
+ * @example
4509
+ * ```ts
4510
+ * const rulerLineService = application.getService(RulerLineService);
4511
+ * rulerLineService.clearDimensionLine();
4512
+ * ```
4513
+ */
4514
+ clearDimensionLine(): void;
4515
+ /**
4516
+ * 绘制间距线
4517
+ * @param param.modelFilter 模型过滤函数返回true的为参与计算的对象,可根据id/prodCatId/brandGoodId等过滤出需要参与计算间距线的对象
4518
+ * @param option[ESpaceDirection.X] 可选的接近X方向的风格选项 可自定义线条颜色透明度以及字体样式
4519
+ * @param option[ESpaceDirection.Y] 可选的接近Y方向的风格选项 可自定义线条颜色透明度以及字体样式
4520
+ * @param option[ESpaceDirection.Z] 可选的接近Z方向的风格选项 可自定义线条颜色透明度以及字体样式
4521
+ * @returns 返回代表间距线段的唯一id 可用于清除该接口产生的间距线
4522
+ * @example 产生板件之间的距离尺寸线
4523
+ * ```ts
4524
+ * const rulerLineService = application.getService(RulerLineService);
4525
+ * const lineId = rulerLineService.drawSpacingDistanceLine({ modelFilter: (data)=>data.prodCatId === 713});
4526
+ * ```
4527
+ */
4528
+ drawSpacingDistanceLine(param: {
4529
+ modelFilter: (modelFields: IModelFields) => boolean;
4530
+ }, option?: Partial<Record<ESpaceDirection, Partial<IRulerLineOption>>>): string;
4531
+ /**
4532
+ * 去除间距线
4533
+ * @example
4534
+ * ```ts
4535
+ * const rulerLineService = application.getService(RulerLineService);
4536
+ * rulerLineService.removeSpacingDistanceLine(lineId);
4537
+ * ```
4538
+ */
4539
+ removeSpacingDistanceLine(lineId: string): void;
4540
+ /**
4541
+ * 清空间距线
4542
+ * ```ts
4543
+ * const rulerLineService = application.getService(RulerLineService);
4544
+ * rulerLineService.clearSpacingDistanceLine();
4545
+ * ```
4546
+ */
4547
+ clearSpacingDistanceLine(): void;
4548
+ }
4549
+
4422
4550
  /**
4423
4551
  * 提供渲染场景的控制
4424
4552
  *