@splnlss/3d-story-viewer 0.5.6 → 0.5.7

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/README.md CHANGED
@@ -75,6 +75,38 @@ viewer.enableContentLayers(['default']);
75
75
  viewer.alignCamera(-105.18896, 39.93, 9000);
76
76
  ```
77
77
 
78
+ ## Gaussian Splat Layers
79
+
80
+ Gaussian splat content layers support `ply`, `sog`, `spz`, and `rad` data. Every
81
+ layer uses an explicit WGS84 anchor plus an optional local ENU transform:
82
+
83
+ ```js
84
+ viewer.defineContentLayers([
85
+ {
86
+ id: 'site-scan',
87
+ name: 'Site scan',
88
+ type: 'gaussian-splat',
89
+ labels: ['default'],
90
+ data: { url: 'https://assets.example.com/site.rad', format: 'rad' },
91
+ options: {
92
+ transform: {
93
+ anchor: { longitude: -105.1, latitude: 40.1, altitude: 1600 },
94
+ translationENU: [0, 0, 0],
95
+ rotationDegrees: [0, 0, 0],
96
+ scale: 1,
97
+ },
98
+ },
99
+ },
100
+ ]);
101
+ ```
102
+
103
+ PLY, SOG, and SPZ files stream directly and report byte progress. RAD uses
104
+ Spark's paged loader: becoming ready means its metadata is valid and LOD
105
+ streaming can begin, while detail continues to load in response to the camera.
106
+ RAD hosts must support HTTP byte ranges and cross-origin `GET`/`HEAD` requests.
107
+ Expose `Content-Length`, `Content-Range`, and `Accept-Ranges`; relative RAD
108
+ sidecar files must use the same policy.
109
+
78
110
  ## Environment Variables
79
111
 
80
112
  Viewer tokens can be passed directly in the constructor or provided through Vite environment variables:
@@ -14,7 +14,7 @@ export type GaussianSplatLayerDefinition = {
14
14
  labels: string[];
15
15
  data: {
16
16
  url: string;
17
- format: "ply" | "sog" | "spz";
17
+ format: "ply" | "sog" | "spz" | "rad";
18
18
  };
19
19
  options: {
20
20
  renderOrder?: 0;
@@ -11,6 +11,8 @@ export class GaussianSplatLayer extends ContentLayer {
11
11
  visible: boolean;
12
12
  transformMatrix: any;
13
13
  load(): Promise<void>;
14
+ createPagedMesh(): SplatMesh;
15
+ createDirectMesh(attempt: any): Promise<SplatMesh>;
14
16
  disposeMesh(mesh: any): void;
15
17
  }
16
18
  import { ContentLayer } from '.';