@d5techs/3dgs-lib 1.2.0 → 1.3.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/dist/App.d.ts CHANGED
@@ -24,6 +24,7 @@ import { SplatTransformProxy, MeshGroupProxy, SplatBoundingBoxProvider } from ".
24
24
  import { TransformableObject, GizmoMode } from "./core/gizmo/TransformGizmo";
25
25
  import type { BoundingBoxProvider } from "./types";
26
26
  import { SceneAidsRenderer } from "./core/SceneAidsRenderer";
27
+ import type { CoordinateSystem } from "./gs/PLYLoaderMobile";
27
28
  /**
28
29
  * 统一进度回调类型
29
30
  * @param progress 进度值 0-100
@@ -64,8 +65,12 @@ export declare class App {
64
65
  addOBJ(url: string): Promise<Mesh[]>;
65
66
  /**
66
67
  * 加载 PLY 文件 (3D Gaussian Splatting)
68
+ * @param urlOrBuffer PLY 文件 URL 或 ArrayBuffer
69
+ * @param onProgress 进度回调
70
+ * @param isLocalFile 是否为本地文件
71
+ * @param coordinateSystem 源数据坐标系,默认 'blender'(Z-up → Y-up 自动转换)
67
72
  */
68
- addPLY(urlOrBuffer: string | ArrayBuffer, onProgress?: ProgressCallback, isLocalFile?: boolean): Promise<number>;
73
+ addPLY(urlOrBuffer: string | ArrayBuffer, onProgress?: ProgressCallback, isLocalFile?: boolean, coordinateSystem?: CoordinateSystem): Promise<number>;
69
74
  /**
70
75
  * 加载 Splat 文件
71
76
  */
@@ -14,9 +14,15 @@ export type SplatCPU = {
14
14
  opacity: number;
15
15
  shRest?: Float32Array;
16
16
  };
17
+ import type { CoordinateSystem } from './PLYLoaderMobile';
18
+ export interface PLYLoadOptions {
19
+ /** 源数据坐标系,默认 'blender'(Z-up → Y-up 自动转换) */
20
+ coordinateSystem?: CoordinateSystem;
21
+ }
17
22
  /**
18
23
  * 加载并解析 PLY 文件
19
24
  * @param url PLY 文件的 URL
25
+ * @param options 加载选项
20
26
  * @returns SplatCPU 数组
21
27
  */
22
- export declare function loadPLY(url: string): Promise<SplatCPU[]>;
28
+ export declare function loadPLY(url: string, options?: PLYLoadOptions): Promise<SplatCPU[]>;
@@ -9,6 +9,12 @@
9
9
  * 5. 支持多种 PLY 数据类型
10
10
  * 6. 确定性采样(基于文件内容的种子)
11
11
  */
12
+ /**
13
+ * 坐标系类型
14
+ * - 'blender': Blender 坐标系 (Z-up, 右手系),加载时自动将 Y/Z 对调转换为 WebGPU 的 Y-up 坐标系
15
+ * - 'webgpu': WebGPU 坐标系 (Y-up),数据已经是 Y-up 格式,不做转换
16
+ */
17
+ export type CoordinateSystem = 'blender' | 'webgpu';
12
18
  /**
13
19
  * 移动端加载配置
14
20
  */
@@ -21,6 +27,8 @@ export interface MobileLoadOptions {
21
27
  onProgress?: (loaded: number, total: number) => void;
22
28
  /** 随机种子(用于确定性采样,默认使用文件大小作为种子) */
23
29
  seed?: number;
30
+ /** 源数据坐标系,默认 'blender'(Z-up → Y-up 自动转换) */
31
+ coordinateSystem?: CoordinateSystem;
24
32
  }
25
33
  /**
26
34
  * 紧凑 Splat 数据(用于移动端)
package/dist/index.d.ts CHANGED
@@ -22,9 +22,9 @@ export { MTLParser } from './loaders/MTLParser';
22
22
  export type { ParsedMaterial } from './loaders/MTLParser';
23
23
  export type { IGSSplatRenderer, IGSSplatRendererWithCapabilities, } from './gs/IGSSplatRenderer';
24
24
  export { loadPLY } from './gs/PLYLoader';
25
- export type { SplatCPU } from './gs/PLYLoader';
25
+ export type { SplatCPU, PLYLoadOptions } from './gs/PLYLoader';
26
26
  export { loadPLYMobile, parsePLYBuffer, compactDataToGPUBuffer } from './gs/PLYLoaderMobile';
27
- export type { MobileLoadOptions, CompactSplatData } from './gs/PLYLoaderMobile';
27
+ export type { MobileLoadOptions, CompactSplatData, CoordinateSystem } from './gs/PLYLoaderMobile';
28
28
  export { loadSplat, deserializeSplat } from './gs/SplatLoader';
29
29
  export { loadSOG, deserializeSOG } from './gs/SOGLoader';
30
30
  export type { SOGProgressCallback } from './gs/SOGLoader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d5techs/3dgs-lib",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "可扩展的 WebGPU 3D 渲染引擎",
5
5
  "type": "module",
6
6
  "main": "./dist/3dgs-lib.cjs",