copper3d 3.6.2 → 3.6.5

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 (63) hide show
  1. package/dist/Loader/copperNrrdLoader.js +1 -1
  2. package/dist/Loader/copperNrrdLoader.js.map +1 -1
  3. package/dist/Scene/copperScene.d.ts +4 -4
  4. package/dist/Scene/copperScene.js +4 -4
  5. package/dist/Scene/copperScene.js.map +1 -1
  6. package/dist/Utils/segmentation/NrrdTools.d.ts +41 -2
  7. package/dist/Utils/segmentation/NrrdTools.js +30 -2
  8. package/dist/Utils/segmentation/NrrdTools.js.map +1 -1
  9. package/dist/Utils/segmentation/tools/AiAssistTool.d.ts +108 -5
  10. package/dist/Utils/segmentation/tools/AiAssistTool.js +408 -25
  11. package/dist/Utils/segmentation/tools/AiAssistTool.js.map +1 -1
  12. package/dist/Utils/surfaceAnnotation/MeshGraph.d.ts +12 -10
  13. package/dist/Utils/surfaceAnnotation/MeshGraph.js +14 -12
  14. package/dist/Utils/surfaceAnnotation/MeshGraph.js.map +1 -1
  15. package/dist/Utils/surfaceAnnotation/SurfaceAnnotator.d.ts +48 -28
  16. package/dist/Utils/surfaceAnnotation/SurfaceAnnotator.js +76 -50
  17. package/dist/Utils/surfaceAnnotation/SurfaceAnnotator.js.map +1 -1
  18. package/dist/Utils/surfaceAnnotation/annotationStore.d.ts +4 -4
  19. package/dist/Utils/surfaceAnnotation/annotationStore.js +4 -4
  20. package/dist/Utils/surfaceAnnotation/annotationStore.js.map +1 -1
  21. package/dist/Utils/surfaceAnnotation/contourRender.d.ts +1 -1
  22. package/dist/Utils/surfaceAnnotation/contourRender.js +16 -11
  23. package/dist/Utils/surfaceAnnotation/contourRender.js.map +1 -1
  24. package/dist/Utils/surfaceAnnotation/geodesicContour.d.ts +11 -10
  25. package/dist/Utils/surfaceAnnotation/geodesicContour.js +16 -15
  26. package/dist/Utils/surfaceAnnotation/geodesicContour.js.map +1 -1
  27. package/dist/Utils/surfaceAnnotation/pointMarkers.d.ts +3 -2
  28. package/dist/Utils/surfaceAnnotation/pointMarkers.js +6 -2
  29. package/dist/Utils/surfaceAnnotation/pointMarkers.js.map +1 -1
  30. package/dist/Utils/surfaceAnnotation/raycastSurface.d.ts +3 -2
  31. package/dist/Utils/surfaceAnnotation/raycastSurface.js +71 -5
  32. package/dist/Utils/surfaceAnnotation/raycastSurface.js.map +1 -1
  33. package/dist/Utils/surfaceAnnotation/strokeContour.d.ts +9 -6
  34. package/dist/Utils/surfaceAnnotation/strokeContour.js +15 -10
  35. package/dist/Utils/surfaceAnnotation/strokeContour.js.map +1 -1
  36. package/dist/Utils/surfaceAnnotation/types.d.ts +5 -5
  37. package/dist/Utils/surfaceAnnotation/types.js +2 -2
  38. package/dist/Utils/surfaceAnnotation/types.js.map +1 -1
  39. package/dist/Utils/texture2d.js +4 -2
  40. package/dist/Utils/texture2d.js.map +1 -1
  41. package/dist/Utils/workers/reformatSaveDataWorker.js +2 -2
  42. package/dist/Utils/workers/reformatSaveDataWorker.js.map +1 -1
  43. package/dist/bundle.esm.js +684 -157
  44. package/dist/bundle.umd.js +684 -157
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +9 -2
  47. package/dist/index.js.map +1 -1
  48. package/dist/lib/three-vignette.js +8 -2
  49. package/dist/lib/three-vignette.js.map +1 -1
  50. package/dist/types/Scene/copperScene.d.ts +4 -4
  51. package/dist/types/Utils/segmentation/NrrdTools.d.ts +41 -2
  52. package/dist/types/Utils/segmentation/tools/AiAssistTool.d.ts +108 -5
  53. package/dist/types/Utils/surfaceAnnotation/MeshGraph.d.ts +12 -10
  54. package/dist/types/Utils/surfaceAnnotation/SurfaceAnnotator.d.ts +48 -28
  55. package/dist/types/Utils/surfaceAnnotation/annotationStore.d.ts +4 -4
  56. package/dist/types/Utils/surfaceAnnotation/contourRender.d.ts +1 -1
  57. package/dist/types/Utils/surfaceAnnotation/geodesicContour.d.ts +11 -10
  58. package/dist/types/Utils/surfaceAnnotation/pointMarkers.d.ts +3 -2
  59. package/dist/types/Utils/surfaceAnnotation/raycastSurface.d.ts +3 -2
  60. package/dist/types/Utils/surfaceAnnotation/strokeContour.d.ts +9 -6
  61. package/dist/types/Utils/surfaceAnnotation/types.d.ts +5 -5
  62. package/dist/types/index.d.ts +1 -1
  63. package/package.json +2 -1
@@ -1,9 +1,10 @@
1
1
  import * as THREE from "three";
2
2
  import type { AnnotationVertex, SurfaceHit } from "./types";
3
3
  /**
4
- * 模式 A(自由手绘)一笔的状态机。
5
- * pointermove 时不断 addSample;与上一采样点世界距离 < minGap 的样本丢弃,避免过密。
6
- * 顶点以 local 存(由 mesh 把世界命中点转 local)。
4
+ * State machine for one stroke in mode A (freehand).
5
+ * On pointermove it keeps calling addSample; samples whose world distance from the previous
6
+ * sample is < minGap are dropped to avoid over-density.
7
+ * Vertices are stored in local space (the mesh converts the world hit point to local).
7
8
  */
8
9
  export declare class StrokeContour {
9
10
  private minGap;
@@ -14,9 +15,11 @@ export declare class StrokeContour {
14
15
  private lastNormal;
15
16
  private has;
16
17
  /**
17
- * @param minGap 采样最小间距(世界系),去抖
18
- * @param maxJump 跳变阈值(世界系):距离 > maxJump 且法线大幅翻转时丢弃该样本,
19
- * 避免笔触掠过沟缝/轮廓边时相邻点落在不同深度、直线段横穿模型。
18
+ * @param minGap minimum sample spacing (world space), debounce
19
+ * @param maxJump jump threshold (world space): drop the sample when distance > maxJump and the
20
+ * normal flips sharply, to prevent adjacent points landing at different depths
21
+ * (and the straight segment cutting through the model) when the stroke grazes a
22
+ * groove or contour edge.
20
23
  */
21
24
  constructor(minGap: number, maxJump: number, mesh: THREE.Mesh);
22
25
  begin(): void;
@@ -5,7 +5,7 @@ export interface SurfaceHit {
5
5
  normal: THREE.Vector3;
6
6
  faceIndex: number;
7
7
  }
8
- /** 标注顶点:位置与法线均为 **模型 local 空间**(单一真源,不受相机/摆放影响) */
8
+ /** Annotation vertex: position and normal are both in **model local space** (single source of truth, unaffected by camera/placement). */
9
9
  export interface AnnotationVertex {
10
10
  x: number;
11
11
  y: number;
@@ -26,14 +26,14 @@ export interface Annotation {
26
26
  object3D: THREE.Object3D | null;
27
27
  }
28
28
  export interface ExportOptions {
29
- /** 导出坐标空间,默认 "local"(模型空间,可复现、不受相机/摆放影响) */
29
+ /** Export coordinate space, defaults to "local" (model space, reproducible and unaffected by camera/placement). */
30
30
  space?: "local" | "world";
31
- /** 是否在每个点附带法线 [x,y,z,nx,ny,nz] */
31
+ /** Whether to attach a normal to each point [x,y,z,nx,ny,nz]. */
32
32
  includeNormals?: boolean;
33
33
  }
34
- /** 世界系命中点 → local 顶点(位置 worldToLocal,法线用逆变换) */
34
+ /** World-space hit point → local vertex (position via worldToLocal, normal via inverse transform). */
35
35
  export declare function worldHitToLocalVertex(h: SurfaceHit, mesh: THREE.Mesh): AnnotationVertex;
36
- /** local 顶点 → world 位置 + world 法线(供渲染) */
36
+ /** Local vertex → world position + world normal (for rendering). */
37
37
  export declare function localVertexToWorld(v: AnnotationVertex, mesh: THREE.Mesh): {
38
38
  p: THREE.Vector3;
39
39
  n: THREE.Vector3;
@@ -28,6 +28,6 @@ import { CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_
28
28
  import type { LayerId, ChannelValue } from "./Utils/segmentation/core/index";
29
29
  import type { AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult } from "./Utils/segmentation/tools/AiAssistTool";
30
30
  import "./css/style.css";
31
- export declare const REVISION = "v3.6.2-beta";
31
+ export declare const REVISION: string;
32
32
  export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, NrrdTools, loading, Copper3dTrackballControls, createTexture2D_NRRD, MeshNodeTool, throttle, removeGuiFolderChilden, CHANNEL_COLORS, CHANNEL_HEX_COLORS, AI_MASK_CHANNEL_COLORS, AI_CHANNEL_HEX_COLORS, rgbaToHex, rgbaToCss, GaussianSmoother, SurfaceAnnotator, };
33
33
  export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, IPaintImage, exportPaintImageType, IOptVTKLoader, aligned4DSurfaceType, aligned4DOptsType, Aligned4DController, ICommXYZ, IGUIStates, IGuiParameterSettings, INrrdStates, NrrdState, GuiState, IGuiMeta, ToolMode, IAnnotationCallbacks, LayerId, ChannelValue, AiPromptTool, AiPromptPoint, AiPromptPayload, AiMaskResult, SurfaceAnnotatorOptions, Annotation, AnnotationMode, ExportOptions, };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "copper3d",
3
3
  "description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
4
- "version": "3.6.2",
4
+ "version": "3.6.5",
5
5
  "main": "dist/bundle.umd.js",
6
6
  "moudle": "dist/bundle.esm.js",
7
7
  "types": "dist/types/index.d.ts",
@@ -32,6 +32,7 @@
32
32
  "homepage": "https://github.com/LinkunGao/copper3d_visualisation#readme",
33
33
  "devDependencies": {
34
34
  "@rollup/plugin-image": "^2.1.1",
35
+ "@rollup/plugin-replace": "^4.0.0",
35
36
  "@rollup/plugin-typescript": "^8.3.2",
36
37
  "@types/file-saver": "^2.0.5",
37
38
  "postcss": "^8.4.14",