@nebula-spatial/viewer 0.5.18 → 0.6.1
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 +83 -35
- package/README.md +5 -0
- package/dist/asset-ir-BXa1EdOy.js +637 -0
- package/dist/assets/source-types.d.ts +10 -0
- package/dist/assets/types.d.ts +61 -6
- package/dist/assets/{usd-worker-B6-1I5dT.js → usd-worker-r6Nuoxlk.js} +671 -584
- package/dist/index-CHf9y9eX.js +17406 -0
- package/dist/index.d.ts +21 -2
- package/dist/index.js +29 -18
- package/dist/{mjcf-visual-CtY2Wk3w.js → mjcf-visual-DxMXiBnu.js} +12 -13
- package/dist/mujoco-runtime-BA88JuDR.js +791 -0
- package/dist/physics-guide-size-CplAlsve.js +12 -0
- package/dist/scene/instances.d.ts +36 -0
- package/dist/scene/joints.d.ts +129 -0
- package/dist/scene/session.d.ts +26 -0
- package/dist/scene/types.d.ts +292 -0
- package/dist/session-DLi-MvLB.js +240 -0
- package/dist/{session-DxTeRKCd.js → session-DqEr1CxY.js} +581 -567
- package/dist/session-ZNb3ZYLq.js +562 -0
- package/dist/simulation/physics-runtime-state.d.ts +73 -0
- package/dist/simulation/types.d.ts +151 -0
- package/dist/simulation/usd-dependency-probe.d.ts +42 -0
- package/dist/simulation/usd-inspection.d.ts +66 -0
- package/dist/spark-renderer-BGF_AaI9.js +25 -0
- package/dist/spark.module-kM8pwA1o.js +9278 -0
- package/dist/types.d.ts +75 -1
- package/dist/ui/camera-axis-gizmo.d.ts +5 -0
- package/dist/urdf-session-CKlR-fOQ.js +1230 -0
- package/dist/usd-session-DyNMsD-v.js +11199 -0
- package/dist/version.d.ts +1 -1
- package/dist/visual/classification.d.ts +20 -0
- package/dist/{xacro-x2TeKQ7T.js → xacro-BCLnc3tY.js} +1 -1
- package/openusd/openusd-runtime-manifest.json +6 -6
- package/openusd/openusd_probe.js +1 -1
- package/openusd/openusd_probe.wasm +0 -0
- package/package.json +2 -1
- package/runtime-assets.d.mts +9 -9
- package/runtime-assets.mjs +11 -11
- package/vite.d.mts +7 -7
- package/vite.mjs +115 -115
- package/dist/collision-debug-BSJoz5J7.js +0 -2947
- package/dist/index-E8DHSeyT.js +0 -11499
- package/dist/mujoco-runtime-fDWdXNEc.js +0 -739
- package/dist/resources-CHhCm2f7.js +0 -27
- package/dist/session-DB-osaBL.js +0 -801
- package/dist/stage-BnRjc-Rp.js +0 -592
- package/dist/urdf-session-Q_c3Rd1M.js +0 -1264
- package/dist/usd-session-tW3LxVFs.js +0 -10647
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Box3, ColorRepresentation, Object3D, Vector3 } from 'three';
|
|
2
2
|
import type { CadViewerCapability, CameraStateStore, ViewerUiOptions, ViewerUiTheme } from './cad/types';
|
|
3
3
|
import type { AssetChangeEvent, AssetControlChangeEvent, AssetErrorEvent, AssetPreview, AssetSource, OpenAssetOptions, ViewerAssetOptions } from './assets/types';
|
|
4
|
+
import type { SceneControl, SceneEntry, SceneOptions } from './scene/types';
|
|
4
5
|
export type { CadBlockModel, CadDocumentHandle, CadDocumentUnits, CadFontResolver, CadFontRequest, CadResolvedFont, CadResolvedTextFont, CadTextWarmupOptions, CadHudModel, CadHudSnapshot, CadInspectorModel, CadInspectorSnapshot, CadLayerModel, CadLayerRow, CadBlockUsageRow, CadSessionPhase, CadWorldBounds, CadScaleRulerState, CadInsertDetails, CadInsertSelection, CadInsertSelectionId, CadTextDetails, CadTextSelection, CadTextSelectionId, CadSelection, CadHit, CadViewerSnapshot, CadLoadProgress, CadViewerErrorCode, CadViewerErrorEvent, CadLoadSource, CadOpenOptions, CadSessionLoadTiming, RenderDebugBreakdownEntry, SplitBlockLayerDetail, CadViewerCapability, ResolveTextFont, CadViewerEventMap, CameraStateStore, ViewerCadUiKeyboardOptions, ViewerUiOptions, ViewerCadUiParts, ViewerCadUiOptions, ViewerUiPreset, ViewerCadUiStateStore, ViewerUiTheme, ViewerUiTokens, } from './cad/types';
|
|
5
6
|
export type ViewerViewMode = '2d' | '3d';
|
|
6
7
|
export type CadInteractionMode = 'managed' | 'manual' | 'disabled';
|
|
@@ -17,7 +18,7 @@ export type ViewerNavigationPolicy = 'legacy' | 'viewer' | 'preview';
|
|
|
17
18
|
* always dollies. Own union so the viewer surface does not re-export the
|
|
18
19
|
* runtime package's type.
|
|
19
20
|
*/
|
|
20
|
-
export type ViewerPreviewDragPreset = 'left-rotate' | 'left-pan';
|
|
21
|
+
export type ViewerPreviewDragPreset = 'left-rotate' | 'left-pan' | 'studio';
|
|
21
22
|
export type CameraChangeReason = 'pointer' | 'wheel' | 'fit' | 'restore' | 'api' | 'view-mode';
|
|
22
23
|
export type ViewerEnvironment = 'room' | {
|
|
23
24
|
/** Load an external equirectangular texture for image-based lighting. */
|
|
@@ -109,6 +110,11 @@ export interface ViewerOptions {
|
|
|
109
110
|
transmissionMode?: 'three' | 'eevee-sphere-probe';
|
|
110
111
|
/** Pointer mapping for model/simulation previews. Defaults to `left-rotate`. */
|
|
111
112
|
previewDragPreset?: ViewerPreviewDragPreset;
|
|
113
|
+
/**
|
|
114
|
+
* OrbitControls damping factor for preview navigation. Range: (0, 1].
|
|
115
|
+
* Omit or set to null to use the selected preset's default.
|
|
116
|
+
*/
|
|
117
|
+
previewCameraDampingFactor?: number | null;
|
|
112
118
|
autoSelectOnPick?: boolean;
|
|
113
119
|
pointerPick?: boolean;
|
|
114
120
|
/** CAD click policy. Defaults to managed. */
|
|
@@ -137,6 +143,12 @@ export interface ViewerOptions {
|
|
|
137
143
|
export interface ViewerFitViewOptions {
|
|
138
144
|
padding?: number;
|
|
139
145
|
viewMode?: ViewerViewMode;
|
|
146
|
+
/** Keep the document/asset-owned preview camera range and clipping profile. */
|
|
147
|
+
preservePreviewCameraRange?: boolean;
|
|
148
|
+
/** Rebuild the preview camera profile without moving the camera. */
|
|
149
|
+
preserveCameraPose?: boolean;
|
|
150
|
+
/** Maximum preview orbit distance as a multiple of the fitted radius. */
|
|
151
|
+
previewMaxDistanceFactor?: number;
|
|
140
152
|
}
|
|
141
153
|
export interface ViewerPickOptions {
|
|
142
154
|
/** Stop at the nearest intersection when accelerated picking is available. */
|
|
@@ -243,6 +255,10 @@ export interface Viewer {
|
|
|
243
255
|
dispose?: boolean;
|
|
244
256
|
}): Object3D | null;
|
|
245
257
|
};
|
|
258
|
+
readonly renderEffects: {
|
|
259
|
+
add(effect: ViewerRenderEffect): () => void;
|
|
260
|
+
remove(effect: ViewerRenderEffect): boolean;
|
|
261
|
+
};
|
|
246
262
|
readonly camera: {
|
|
247
263
|
getState(): ViewerCameraSnapshot | null;
|
|
248
264
|
/** Applies a validated snapshot immediately. Animated transitions are not part of the current contract. */
|
|
@@ -288,8 +304,66 @@ export interface Viewer {
|
|
|
288
304
|
setTransparentHdrBackdropBlurriness(value: number): boolean;
|
|
289
305
|
/** Switches the model/simulation preview pointer mapping at runtime. */
|
|
290
306
|
setPreviewDragPreset(preset: ViewerPreviewDragPreset): void;
|
|
307
|
+
/**
|
|
308
|
+
* Current damping override. Set a number for an immediate effect, or null to
|
|
309
|
+
* return to the selected preview preset's default.
|
|
310
|
+
*/
|
|
311
|
+
previewCameraDampingFactor: number | null;
|
|
312
|
+
/**
|
|
313
|
+
* Opens a multi-asset scene under the existing single Renderer/Scene/RAF.
|
|
314
|
+
*
|
|
315
|
+
* A scene owns one stage and one child group per placed asset; each asset is
|
|
316
|
+
* still loaded by its own format loader, so no parser is duplicated. Only one
|
|
317
|
+
* scene may be open at a time, and opening a scene closes any active single
|
|
318
|
+
* asset (and vice versa).
|
|
319
|
+
*/
|
|
320
|
+
openScene(entries: readonly SceneEntry[], options?: SceneOptions): SceneControl;
|
|
321
|
+
closeScene(): Promise<void>;
|
|
322
|
+
/** Renders one offscreen frame through this Viewer's Renderer/Scene/RAF. */
|
|
323
|
+
captureFrame(options: ViewerCaptureOptions): Promise<ViewerCaptureResult>;
|
|
291
324
|
dispose(): void;
|
|
292
325
|
use(plugins: readonly import('./plugins').ViewerPlugin[], options?: {
|
|
293
326
|
replace?: boolean;
|
|
294
327
|
}): void;
|
|
295
328
|
}
|
|
329
|
+
export interface ViewerRenderEffectContext {
|
|
330
|
+
readonly purpose: 'viewport' | 'capture';
|
|
331
|
+
readonly target: import('three').WebGLRenderTarget | null;
|
|
332
|
+
}
|
|
333
|
+
export interface ViewerRenderEffect {
|
|
334
|
+
isActive?(): boolean;
|
|
335
|
+
afterScene(renderer: import('three').WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera, context: ViewerRenderEffectContext): void;
|
|
336
|
+
dispose?(): void;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Offscreen frame capture. The capture renders through the same Renderer,
|
|
340
|
+
* Scene and loop hooks, against a cloned camera, so it neither opens a second
|
|
341
|
+
* WebGL context nor moves the camera the caller is looking through.
|
|
342
|
+
*/
|
|
343
|
+
export interface ViewerCaptureOptions {
|
|
344
|
+
readonly width: number;
|
|
345
|
+
readonly height: number;
|
|
346
|
+
readonly format?: 'image/png' | 'image/jpeg' | 'image/webp';
|
|
347
|
+
readonly quality?: number;
|
|
348
|
+
readonly background?: 'scene' | 'transparent' | {
|
|
349
|
+
readonly color: readonly [number, number, number];
|
|
350
|
+
};
|
|
351
|
+
readonly crop?: {
|
|
352
|
+
readonly x: number;
|
|
353
|
+
readonly y: number;
|
|
354
|
+
readonly width: number;
|
|
355
|
+
readonly height: number;
|
|
356
|
+
};
|
|
357
|
+
readonly signal?: AbortSignal;
|
|
358
|
+
readonly frameBounds?: {
|
|
359
|
+
readonly min: readonly [number, number, number];
|
|
360
|
+
readonly max: readonly [number, number, number];
|
|
361
|
+
};
|
|
362
|
+
readonly padding?: number;
|
|
363
|
+
}
|
|
364
|
+
export interface ViewerCaptureResult {
|
|
365
|
+
readonly blob: Blob;
|
|
366
|
+
readonly width: number;
|
|
367
|
+
readonly height: number;
|
|
368
|
+
readonly format: string;
|
|
369
|
+
}
|