@nebula-spatial/viewer 0.5.17 → 0.6.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 +63 -22
- package/USD-VISUAL-MATERIAL-SUPPORT.md +5 -1
- package/dist/asset-ir-BEDGD9CL.js +637 -0
- package/dist/assets/source-types.d.ts +10 -0
- package/dist/assets/types.d.ts +59 -6
- package/dist/index-DoxM1Msk.js +17223 -0
- package/dist/index.d.ts +20 -1
- package/dist/index.js +29 -18
- package/dist/{mjcf-visual-C0PWP0vB.js → mjcf-visual-CQEeWkL_.js} +12 -13
- package/dist/mujoco-runtime-BmuEJ_ST.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 +284 -0
- package/dist/session-BnNntPUE.js +9169 -0
- package/dist/{session-D44z2smp.js → session-Cz4tFSlO.js} +6 -8
- package/dist/session-sBOJEWpK.js +559 -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/types.d.ts +46 -1
- package/dist/ui/camera-axis-gizmo.d.ts +5 -0
- package/dist/urdf-session-HKelZnMM.js +1230 -0
- package/dist/usd-session-Cn6whyh4.js +10875 -0
- package/dist/version.d.ts +1 -1
- package/dist/visual/classification.d.ts +20 -0
- package/dist/{xacro-CjMp9HT5.js → xacro-Cl7vUCSC.js} +1 -1
- 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-CHPrPNT3.js +0 -2947
- package/dist/index-cM9KArXm.js +0 -11499
- package/dist/mujoco-runtime-BV2xR38M.js +0 -739
- package/dist/resources-CHhCm2f7.js +0 -27
- package/dist/session-CKva1mAh.js +0 -801
- package/dist/stage-pxmOnL0U.js +0 -592
- package/dist/urdf-session-ChpRmt69.js +0 -1264
- package/dist/usd-session-auH_xmOc.js +0 -10526
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import './version';
|
|
|
2
2
|
export { viewerVersion } from './version';
|
|
3
3
|
export type { ViewerSceneUiOptions, ViewerSceneUiParts } from './ui/types';
|
|
4
4
|
export { createViewer } from './viewer';
|
|
5
|
+
export { axisGizmo } from './ui/camera-axis-gizmo';
|
|
5
6
|
export { DEFAULT_GROUND_GRID_SCALE, chooseGroundGridScale, formatGroundGridScale, } from './assets/ground-grid';
|
|
6
7
|
export type { GroundGridScale } from './assets/ground-grid';
|
|
7
8
|
export { getUsdQuery } from './simulation/usd-query';
|
|
@@ -11,11 +12,29 @@ export { compileMujocoWasmModule } from './simulation/mujoco-wasm-module';
|
|
|
11
12
|
export type { MujocoWasmCompileOptions } from './simulation/mujoco-wasm-module';
|
|
12
13
|
export { preloadUsdViewer } from './simulation/usd-preload';
|
|
13
14
|
export { prewarmUsdWorker } from './simulation/usd-prewarm';
|
|
15
|
+
export { probeUsdDependencies } from './simulation/usd-dependency-probe';
|
|
16
|
+
export type { UsdDependencyProbeRequest, UsdDependencyProbeResult, } from './simulation/usd-dependency-probe';
|
|
17
|
+
export { detectPlyContent, detectVisualContent } from './visual/classification';
|
|
18
|
+
export type { PlyContentKind, PlyHeader, VisualContentDetection, VisualContentKind, } from './visual/classification';
|
|
14
19
|
export type { QueryableUsdModel, UsdAttributeValue, UsdBoundMaterial, UsdMetadataValue, UsdPrimInfo, UsdQuery, } from './simulation/usd-query';
|
|
15
|
-
export type { AssetChangeEvent, AssetControlState, AssetControlChangeEvent, AssetBackgroundLoadingSnapshot, AssetDetectionResult, AssetErrorEvent, AssetErrorSnapshot, AssetFileEntry, AssetFormat, AssetLoaderContext, AssetLoaderContribution, AssetNoticeKind, AssetNoticeSnapshot, AssetPhysicsState, AssetPresentationProfile, AssetPreview, AssetPreviewCapabilities, AssetPreviewKind, AssetPreviewPhase, AssetPreviewSnapshot, AssetResourceResolver, AssetSession, AssetSingleSource, AssetSource, AssetUpAxis, NormalizedAssetSource, OpenAssetOptions, UsdExternalReferenceMode, ViewerAssetOptions, } from './assets/types';
|
|
20
|
+
export type { AssetChangeEvent, AssetControlState, AssetControlChangeEvent, AssetBackgroundLoadingSnapshot, AssetDetectionResult, AssetErrorEvent, AssetErrorSnapshot, AssetFileEntry, AssetFormat, AssetLoaderContext, AssetLoaderContribution, AssetNoticeKind, AssetNoticeSnapshot, AssetPhysicsState, AssetPresentationProfile, AssetPreview, AssetPreviewCapabilities, AssetPreviewKind, AssetPreviewPhase, AssetPreviewSnapshot, AssetResourceResolver, AssetSession, AssetSingleSource, AssetSource, AssetUpAxis, AssetWarningSnapshot, NormalizedAssetSource, OpenAssetOptions, UsdExternalReferenceMode, UsdVariantSelection, ViewerAssetOptions, } from './assets/types';
|
|
16
21
|
export { USD_RESOURCE_AUTH, USD_RESOURCE_EXTERNAL_DENIED, USD_RESOURCE_FETCH, USD_RESOURCE_INVALID, USD_RESOURCE_NOT_FOUND, } from './simulation/usd-resource-policy';
|
|
17
22
|
export type { Disposable, ToolbarItem, ViewerState, ViewerInteractionHooks, ViewerContributionPoint, ViewerPlugin, ViewerPluginContext, ViewerPluginRegistry, } from './plugins';
|
|
18
23
|
export { configureViewerText } from './cad/text';
|
|
19
24
|
export type { ViewerTextBuilderOptions } from './cad/text';
|
|
20
25
|
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, Viewer, ViewerEventMap, ViewerEnvironment, ViewerEnvironmentState, ViewerEnvironmentTexture, ViewerFitViewOptions, ViewerHighlightOptions, ViewerOptions, ViewerPickOptions, ViewerPickResult, ViewerPointerEvent, ViewerObjectOptions, ViewerPreviewDragPreset, ViewerCameraSnapshot, ViewerOrthographicSnapshot, ViewerOrbitSnapshot, ViewerRenderStats, ViewerDocumentRect, ViewerCadUiKeyboardOptions, ViewerUiOptions, ViewerCadUiParts, ViewerCadUiOptions, ViewerUiPreset, ViewerCadUiStateStore, ViewerUiTheme, ViewerViewMode, CadInteractionMode, CameraChangeReason, ViewerUiTokens, } from './types';
|
|
21
26
|
export type { JointInspection, JointInspectionJoint, JointInspectionSnapshot, AssetInspection, UrdfEntityKind, UrdfInspection, UrdfInspectionEntity, UrdfInspectionIssue, UrdfInspectionJoint, UrdfInspectionLink, UrdfInspectionMode, UrdfInspectionNode, UrdfInspectionOverlays, UrdfInspectionRobot, UrdfInspectionSnapshot, UrdfSourceRange } from './inspection/types';
|
|
27
|
+
/**
|
|
28
|
+
* Multi-asset scene authoring. A scene owns one stage and several placed
|
|
29
|
+
* assets; the joint surface (`SceneInstanceJoints`) is what a host saves a pose
|
|
30
|
+
* through. Persistence is never the Viewer's: read `capturePose()`, store it,
|
|
31
|
+
* and write it back with `applyInstancePose`.
|
|
32
|
+
*/
|
|
33
|
+
export { createSceneSession, findInstanceId } from './scene/session';
|
|
34
|
+
export type { SceneSessionDeps } from './scene/session';
|
|
35
|
+
export { clampJointValue, createSceneInstanceJoints, isSceneScalarJoint, jointBlockReason, toSceneJointDescriptor, } from './scene/joints';
|
|
36
|
+
export type { JointInspectionSource, SceneInstanceJoints, SceneJointBlockReason, SceneJointDescriptor, SceneJointPose, SceneJointSnapshot, SceneJointState, } from './scene/joints';
|
|
37
|
+
export type { SceneControl, SceneDeterministicCheckOptions, SceneDeterministicCheckResult, SceneEntry, SceneInspectionOverlay, SceneInstanceBounds, SceneInstancePhysics, SceneInstanceRuntime, SceneInstanceSnapshot, SceneInstancePhase, SceneOptions, ScenePhysicsConfiguration, ScenePhysicsState, ScenePlacement, SceneSnapshot, Vec3Like, } from './scene/types';
|
|
38
|
+
export type { PhysicsBodyMotionType, PhysicsRuntimeBodyState, PhysicsRuntimeCaptureOptions, PhysicsRuntimeContactState, PhysicsRuntimeGrabState, PhysicsRuntimeJointState, PhysicsRuntimeSnapshot, } from './simulation/physics-runtime-state';
|
|
39
|
+
export type { UsdInspectionJoint, UsdInspectionMaterial, UsdInspectionMesh, UsdInspectionPrim, UsdInspectionSnapshot, UsdInspectionStage, UsdInspectionVariantSet, } from './simulation/usd-inspection';
|
|
40
|
+
export type { ViewerCaptureOptions, ViewerCaptureResult } from './types';
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { configureCadTextBuilder as
|
|
1
|
+
import { D as s, I as o, V as r, J as n, U as t, H as i, W as c, X as U, Y as d, Z as S, _ as E, $ as _, a0 as D, a1 as l, a2 as R, L as m, a3 as p, a4 as u, m as C, a5 as O, a6 as I, a7 as V, a8 as G, a9 as T, aa as f, ab as N } from "./index-DoxM1Msk.js";
|
|
2
|
+
import { configureCadTextBuilder as x } from "@nebula-spatial/cad-loader";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
s as DEFAULT_GROUND_GRID_SCALE,
|
|
5
|
+
o as USD_RESOURCE_AUTH,
|
|
6
|
+
r as USD_RESOURCE_EXTERNAL_DENIED,
|
|
7
|
+
n as USD_RESOURCE_FETCH,
|
|
8
|
+
t as USD_RESOURCE_INVALID,
|
|
9
|
+
i as USD_RESOURCE_NOT_FOUND,
|
|
10
|
+
c as axisGizmo,
|
|
11
|
+
U as chooseGroundGridScale,
|
|
12
|
+
d as clampJointValue,
|
|
13
|
+
S as compileMujocoWasmModule,
|
|
14
|
+
E as compileOpenUsdWasmModule,
|
|
15
|
+
x as configureViewerText,
|
|
16
|
+
_ as createSceneInstanceJoints,
|
|
17
|
+
D as createSceneSession,
|
|
18
|
+
l as createViewer,
|
|
19
|
+
R as detectPlyContent,
|
|
20
|
+
m as detectVisualContent,
|
|
21
|
+
p as findInstanceId,
|
|
22
|
+
u as formatGroundGridScale,
|
|
23
|
+
C as getUsdQuery,
|
|
24
|
+
O as isSceneScalarJoint,
|
|
25
|
+
I as jointBlockReason,
|
|
26
|
+
V as preloadUsdViewer,
|
|
27
|
+
G as prewarmUsdWorker,
|
|
28
|
+
T as probeUsdDependencies,
|
|
29
|
+
f as toSceneJointDescriptor,
|
|
30
|
+
N as viewerVersion
|
|
20
31
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Group as q, Euler as
|
|
3
|
-
|
|
4
|
-
function U(f) {
|
|
1
|
+
import { O as v, T as E, d as z } from "./index-DoxM1Msk.js";
|
|
2
|
+
import { Group as q, Euler as G, BoxGeometry as N, SphereGeometry as P, CylinderGeometry as $, CapsuleGeometry as I, PlaneGeometry as X, Mesh as j } from "three";
|
|
3
|
+
function D(f) {
|
|
5
4
|
const y = f.extension.documents, l = new q();
|
|
6
5
|
l.name = f.name;
|
|
7
6
|
try {
|
|
@@ -29,7 +28,7 @@ function U(f) {
|
|
|
29
28
|
s.quaternion.set(t[1], t[2], t[3], t[0]).normalize();
|
|
30
29
|
} else {
|
|
31
30
|
const t = h(e.getAttribute("euler"), [0, 0, 0], 3);
|
|
32
|
-
s.quaternion.setFromEuler(new
|
|
31
|
+
s.quaternion.setFromEuler(new G(t[0] * g, t[1] * g, t[2] * g, "XYZ"));
|
|
33
32
|
}
|
|
34
33
|
if (m.add(s), e.tagName === "body") {
|
|
35
34
|
M(e, s);
|
|
@@ -41,13 +40,13 @@ function U(f) {
|
|
|
41
40
|
if (F && (r.length < F || r.some((t) => n === "plane" ? t < 0 : t <= 0)))
|
|
42
41
|
throw new Error(`MJCF geom ${n} 的尺寸缺失或无效`);
|
|
43
42
|
let i;
|
|
44
|
-
if (n === "box") i = new
|
|
45
|
-
else if (n === "sphere") i = new
|
|
43
|
+
if (n === "box") i = new N(2 * r[0], 2 * r[1], 2 * r[2]);
|
|
44
|
+
else if (n === "sphere") i = new P(r[0]);
|
|
46
45
|
else if (n === "cylinder")
|
|
47
|
-
i = new
|
|
46
|
+
i = new $(r[0], r[0], 2 * r[1]), i.rotateX(Math.PI / 2);
|
|
48
47
|
else if (n === "capsule")
|
|
49
|
-
i = new
|
|
50
|
-
else if (n === "plane") i = new
|
|
48
|
+
i = new I(r[0], 2 * r[1]), i.rotateX(Math.PI / 2);
|
|
49
|
+
else if (n === "plane") i = new X(2 * (r[0] || 5), 2 * (r[1] || 5));
|
|
51
50
|
else throw new Error(`MJCF 独立预览暂不支持 geom ${n}`);
|
|
52
51
|
const p = e.getAttribute("material"), o = [...u.querySelectorAll("asset > material")].find((t) => t.getAttribute("name") === p);
|
|
53
52
|
if (p && !o) throw new Error(`Undefined MJCF material: ${p}`);
|
|
@@ -58,16 +57,16 @@ function U(f) {
|
|
|
58
57
|
metalness: Math.max(0, w("metallic", 0)),
|
|
59
58
|
specular: w("specular", 0.5),
|
|
60
59
|
emission: w("emission", 0)
|
|
61
|
-
}), C = new
|
|
60
|
+
}), C = new j(i, S);
|
|
62
61
|
n === "plane" && m === l && (C.userData.excludeFromSimulationFit = !0), s.add(C);
|
|
63
62
|
}
|
|
64
63
|
}, A = u.querySelector("worldbody");
|
|
65
64
|
if (!A) throw new Error("MJCF 缺少 worldbody");
|
|
66
65
|
return M(A, l), l.updateMatrixWorld(!0), l;
|
|
67
66
|
} catch (u) {
|
|
68
|
-
throw
|
|
67
|
+
throw z(l), u;
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
export {
|
|
72
|
-
|
|
71
|
+
D as compileMjcfPreview
|
|
73
72
|
};
|