@realsee/dnalogel 3.73.5 → 3.74.0-alpha.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.74.0-alpha.0
4
+
5
+ - feat(Sculpt): 多边形添加事件 `polygon.experimental_self_intersect` 和 `polygon.experimental_point_will_add`
6
+ - feat(Sculpt): 多边形添加 `experimental_max_point_count` 控制最多能绘制的点数
7
+
3
8
  ## 3.73.5
4
9
 
5
10
  - fix(Object3DHelper): 修复垂直拖拽位置不准
@@ -14,11 +14,24 @@ export type PolygonCreateConfig = Partial<PolygonStyle & CreateLimitConfig & Pol
14
14
  onPointPlaced?: (points: THREE.Vector3[]) => void;
15
15
  onUndo?: () => void;
16
16
  onRedo?: () => void;
17
+ /**
18
+ * @description 检测到自相交时的回调
19
+ * @param point 尝试添加但被拒绝的点坐标
20
+ */
21
+ __onSelfIntersect?: (point: THREE.Vector3) => void;
22
+ /**
23
+ * @description 将要添加的下一个点
24
+ */
25
+ __onWillAddPoint?: (point: THREE.Vector3) => void;
17
26
  /**
18
27
  * @description 检测是否自相交,如果自交,禁止添加下一个点
19
28
  * @default false
20
29
  */
21
30
  experimental_self_intersect_check?: boolean;
31
+ /**
32
+ * 最多允许能添加的点数
33
+ */
34
+ experimental_max_point_count?: number;
22
35
  };
23
36
  export declare class Polygon extends BaseObject<PolygonImportData> {
24
37
  readonly type = "Polygon";
@@ -53,6 +53,18 @@ type Event = {
53
53
  * 返回 false 来禁用 Five 默认行为
54
54
  */
55
55
  click: (e: MouseEvent, item: BuiltInItem) => void | false;
56
+ /**
57
+ * @description 当 Polygon 创建时检测到自相交时触发(需开启 experimental_self_intersect_check)
58
+ * @param item Polygon 实例
59
+ * @param point 尝试添加但被拒绝的点坐标
60
+ */
61
+ 'polygon.experimental_self_intersect': (item: Polygon, point: THREE.Vector3) => void;
62
+ /**
63
+ * @description polygon 将要添加到下一个点
64
+ * @param item Polygon 实例
65
+ * @param point polygon 将要添加到下一个点到坐标
66
+ */
67
+ 'polygon.experimental_point_will_add': (item: Polygon, point: THREE.Vector3) => void;
56
68
  };
57
69
  export declare class Sculpt extends Subscribe<Event> {
58
70
  static modules: {