three-usd-robot 0.4.0 → 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/README.md +136 -35
- package/dist/AssetResolver-CpIJNgWZ.d.ts +29 -0
- package/dist/{ThreeUsdRobot-Deoh7zam.d.ts → ThreeUsdRobot-CajXJqYU.d.ts} +1 -1
- package/dist/ThreeUsdRobotLoader-DrMMLzo-.d.ts +67 -0
- package/dist/{buildKinematicTree-CZjBMA1I.d.ts → buildKinematicTree-wtZPzy0B.d.ts} +53 -16
- package/dist/{chunk-FYVZ7YPW.js → chunk-4MEZM763.js} +3153 -2618
- package/dist/chunk-4MEZM763.js.map +1 -0
- package/dist/chunk-JZMCABQO.js +864 -0
- package/dist/chunk-JZMCABQO.js.map +1 -0
- package/dist/chunk-YVWSO27W.js +709 -0
- package/dist/chunk-YVWSO27W.js.map +1 -0
- package/dist/core.d.ts +297 -134
- package/dist/core.js +2 -1
- package/dist/extras.d.ts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/index.d.ts +229 -83
- package/dist/index.js +271 -631
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +72 -0
- package/dist/react.js +92 -0
- package/dist/react.js.map +1 -0
- package/package.json +22 -1
- package/dist/chunk-FYVZ7YPW.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, ComposeOptions, CrateReader, DEFAULT_METERS_PER_UNIT,
|
|
1
|
+
import { Stage, Prim, CollisionApproximation, ExportPhysicsMaterial, RobotGeometryProvider, ExportRobotOptions, ExportMaterial, ExportMesh } from './core.js';
|
|
2
|
+
export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, ComposeOptions, CrateReader, DEFAULT_METERS_PER_UNIT, ExtractOptions, Layer, MASS_API, MESH_COLLISION_API, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, RIGID_BODY_API, Relationship, ResolvedXform, TextureChannel, TokenizeError, UpAxis, UsdzPackage, VERSION, ValidateRobotOptions, ValidationIssue, ValidationSeverity, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, driveKindFor, exportRobotUsda, extractRobotDescription, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isMesh, isScope, isXform, iterDescendants, jointValueFromSI, jointValueToSI, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz } from './core.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
|
-
import { A as Axis, R as RobotDescription,
|
|
5
|
-
export {
|
|
6
|
-
import { T as ThreeUsdRobot } from './ThreeUsdRobot-
|
|
7
|
-
export { J as JointObject, L as LinkObject, a as ThreeUsdRobotOptions } from './ThreeUsdRobot-
|
|
4
|
+
import { A as Axis, V as Vec2, b as Vec3, R as RobotDescription, c as JointDriveDescription, d as LinkInertialDescription, K as KinematicTree, U as UsdaFile, M as Mat4 } from './buildKinematicTree-wtZPzy0B.js';
|
|
5
|
+
export { e as AssetPath, f as AttributeSpec, B as BuildTreeOptions, C as CompositionArc, D as DEG2RAD, a as JointDescription, J as JointType, g as KinematicNode, L as LinkDescription, h as ListOp, i as MetadataMap, P as PrimSpec, j as PropertySpec, Q as Quat, k as RAD2DEG, l as RelationshipSpec, S as SampleChannel, m as SdfPath, n as Specifier, T as TreeEdge, o as UsdDictionary, p as UsdMatrix, q as UsdValue, r as Variability, s as Vec4, t as buildKinematicTree, u as channelFromSamples, v as decomposeRigid, w as fromUsdMatrix, x as getTranslation, y as identity4, z as interpolate, E as invert, F as makeEuler, G as makeRotationFromQuat, H as makeRotationX, I as makeRotationY, N as makeRotationZ, O as makeScale, W as makeTranslation, X as multiply, Y as multiplyAll, Z as toUsdMatrix } from './buildKinematicTree-wtZPzy0B.js';
|
|
6
|
+
import { T as ThreeUsdRobot } from './ThreeUsdRobot-CajXJqYU.js';
|
|
7
|
+
export { J as JointObject, L as LinkObject, a as ThreeUsdRobotOptions } from './ThreeUsdRobot-CajXJqYU.js';
|
|
8
|
+
import { A as AssetResolver } from './AssetResolver-CpIJNgWZ.js';
|
|
9
|
+
export { D as DefaultAssetResolver, c as createMemoryResolver, j as joinPosix } from './AssetResolver-CpIJNgWZ.js';
|
|
10
|
+
export { a as ThreeUsdRobotLoader, T as ThreeUsdRobotLoaderOptions } from './ThreeUsdRobotLoader-DrMMLzo-.js';
|
|
8
11
|
|
|
9
12
|
/** Unit vector for a USD joint axis token. Returns a fresh vector each call. */
|
|
10
13
|
declare function axisVector(axis: Axis): THREE.Vector3;
|
|
11
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Resolves `UsdShade` material bindings to flat PBR parameters.
|
|
17
|
+
*
|
|
18
|
+
* Follows a prim's (or an ancestor's) `material:binding` to a `Material`, finds
|
|
19
|
+
* its surface `Shader`, and reads constant color/metalness/roughness/opacity/
|
|
20
|
+
* emissive inputs plus the **texture** asset paths for the diffuse, normal,
|
|
21
|
+
* roughness, metallic, occlusion and emissive channels. Handles both
|
|
22
|
+
* `UsdPreviewSurface` (constant inputs or a connected `UsdUVTexture` network)
|
|
23
|
+
* and Omniverse `OmniPBR` MDL (direct asset-valued texture inputs such as
|
|
24
|
+
* `inputs:normalmap_texture`).
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/** `UsdUVTexture` wrap mode for one axis (`black` ≈ clamp; three has no border). */
|
|
28
|
+
type TextureWrap = "repeat" | "clamp" | "mirror" | "black";
|
|
29
|
+
/** `UsdTransform2d` applied to the `st` coords feeding a texture. */
|
|
30
|
+
type TextureTransform = {
|
|
31
|
+
/** `inputs:translation` (UV offset). */
|
|
32
|
+
translation?: Vec2;
|
|
33
|
+
/** `inputs:rotation` in degrees (CCW about the origin). */
|
|
34
|
+
rotation?: number;
|
|
35
|
+
/** `inputs:scale` (UV tiling). */
|
|
36
|
+
scale?: Vec2;
|
|
37
|
+
};
|
|
38
|
+
/** A resolved texture reference plus its `UsdUVTexture` sampler/transform state. */
|
|
39
|
+
type ResolvedTexture = {
|
|
40
|
+
/** Authored asset path of the image. */
|
|
41
|
+
path: string;
|
|
42
|
+
wrapS?: TextureWrap;
|
|
43
|
+
wrapT?: TextureWrap;
|
|
44
|
+
/** `UsdTransform2d` on the `st` input, if any. */
|
|
45
|
+
transform?: TextureTransform;
|
|
46
|
+
/** `inputs:scale` — multiplies the sampled value (folded into material factors). */
|
|
47
|
+
scale?: [number, number, number, number];
|
|
48
|
+
/** `inputs:bias` — added to the sampled value. */
|
|
49
|
+
bias?: [number, number, number, number];
|
|
50
|
+
};
|
|
51
|
+
type ResolvedMaterial = {
|
|
52
|
+
color?: Vec3;
|
|
53
|
+
opacity?: number;
|
|
54
|
+
metalness?: number;
|
|
55
|
+
roughness?: number;
|
|
56
|
+
emissiveColor?: Vec3;
|
|
57
|
+
/**
|
|
58
|
+
* `inputs:opacityThreshold`. When `> 0`, opacity is a binary mask (alpha
|
|
59
|
+
* clip / cutout); when `0`/absent, sub-unit opacity blends translucently.
|
|
60
|
+
*/
|
|
61
|
+
opacityThreshold?: number;
|
|
62
|
+
/** Diffuse/albedo texture, if any. */
|
|
63
|
+
colorTexture?: ResolvedTexture;
|
|
64
|
+
/** Opacity / alpha texture (may be the same image as `colorTexture`). */
|
|
65
|
+
opacityTexture?: ResolvedTexture;
|
|
66
|
+
/** Tangent-space normal map, if any. */
|
|
67
|
+
normalTexture?: ResolvedTexture;
|
|
68
|
+
/** Roughness map, if any. */
|
|
69
|
+
roughnessTexture?: ResolvedTexture;
|
|
70
|
+
/** Metallic map, if any. */
|
|
71
|
+
metalnessTexture?: ResolvedTexture;
|
|
72
|
+
/** Ambient-occlusion map, if any. */
|
|
73
|
+
occlusionTexture?: ResolvedTexture;
|
|
74
|
+
/** Emissive map, if any. */
|
|
75
|
+
emissiveTexture?: ResolvedTexture;
|
|
76
|
+
};
|
|
77
|
+
/** Resolve the bound material's flat parameters for `prim`, or `undefined`. */
|
|
78
|
+
declare function resolveBoundMaterial(stage: Stage, prim: Prim): ResolvedMaterial | undefined;
|
|
79
|
+
|
|
12
80
|
/**
|
|
13
81
|
* Loads texture image assets referenced by `UsdShade` materials.
|
|
14
82
|
*
|
|
15
|
-
* A {@link TextureProvider} maps an authored asset path
|
|
16
|
-
* The default provider
|
|
17
|
-
*
|
|
18
|
-
*
|
|
83
|
+
* A {@link TextureProvider} maps an authored asset path (plus sampler/transform
|
|
84
|
+
* options) to a `THREE.Texture`. The default provider fetches the image **bytes**
|
|
85
|
+
* through the {@link AssetResolver} and decodes them via a blob URL — so it works
|
|
86
|
+
* uniformly for textures served over HTTP and for images embedded inside a
|
|
87
|
+
* `.usdz` package (whose resolver serves zip entries, not real URLs). Decoded
|
|
88
|
+
* images are cached per resolved URL and shared across every texture that uses
|
|
89
|
+
* them; each `THREE.Texture` carries its own color space / wrap / transform.
|
|
19
90
|
*/
|
|
20
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Color space to interpret a texture in. Color/albedo and emissive maps are
|
|
94
|
+
* `"srgb"`; data maps (normal, roughness, metalness, occlusion) are `"linear"`.
|
|
95
|
+
*/
|
|
96
|
+
type TextureColorSpace = "srgb" | "linear";
|
|
97
|
+
/** Per-use sampler state applied to the returned `THREE.Texture`. */
|
|
98
|
+
type TextureOptions = {
|
|
99
|
+
/** Defaults to `"srgb"`. */
|
|
100
|
+
colorSpace?: TextureColorSpace;
|
|
101
|
+
wrapS?: TextureWrap;
|
|
102
|
+
wrapT?: TextureWrap;
|
|
103
|
+
transform?: TextureTransform;
|
|
104
|
+
};
|
|
21
105
|
/** Resolve an authored texture asset path to a `THREE.Texture` (or `null`). */
|
|
22
|
-
type TextureProvider = (assetPath: string) => THREE.Texture | null;
|
|
106
|
+
type TextureProvider = (assetPath: string, options?: TextureOptions) => THREE.Texture | null;
|
|
23
107
|
/**
|
|
24
|
-
* A {@link TextureProvider} backed by
|
|
25
|
-
*
|
|
26
|
-
*
|
|
108
|
+
* A {@link TextureProvider} backed by the {@link AssetResolver}, resolving paths
|
|
109
|
+
* against `baseUrl`. Image bytes are fetched once per URL (works for HTTP and
|
|
110
|
+
* `.usdz` entries alike) and the decoded image is shared; each call returns a
|
|
111
|
+
* distinct `THREE.Texture` carrying the requested color space / wrap / transform.
|
|
27
112
|
*/
|
|
28
113
|
declare function createTextureProvider(resolver: AssetResolver, baseUrl: string): TextureProvider;
|
|
29
114
|
|
|
@@ -48,9 +133,11 @@ type BindMeshesOptions = {
|
|
|
48
133
|
declare function buildMeshGeometry(meshPrim: Prim): THREE.BufferGeometry | null;
|
|
49
134
|
/**
|
|
50
135
|
* Build a material for a Mesh prim. Color priority: bound `UsdShade` material
|
|
51
|
-
* (when `stage` is given) → `primvars:displayColor` → default gray.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
136
|
+
* (when `stage` is given) → `primvars:displayColor` → default gray. Textures
|
|
137
|
+
* (via `textures`) become the matching `MeshStandardMaterial` maps — diffuse →
|
|
138
|
+
* `map` (sRGB), plus `normalMap` / `roughnessMap` / `metalnessMap` / `aoMap`
|
|
139
|
+
* (linear data) and emissive `emissiveMap`. Metalness / roughness / opacity /
|
|
140
|
+
* emissive constants come from the bound material when present.
|
|
54
141
|
*/
|
|
55
142
|
declare function buildMeshMaterial(meshPrim: Prim, stage?: Stage, textures?: TextureProvider): THREE.Material;
|
|
56
143
|
/**
|
|
@@ -59,80 +146,139 @@ declare function buildMeshMaterial(meshPrim: Prim, stage?: Stage, textures?: Tex
|
|
|
59
146
|
* the owning link prim.
|
|
60
147
|
*/
|
|
61
148
|
declare function bindRobotMeshes(stage: Stage, robot3d: ThreeUsdRobot, desc: RobotDescription, options?: BindMeshesOptions): void;
|
|
149
|
+
/**
|
|
150
|
+
* Attach the Mesh prims that belong to no link — the static scenery of a cell
|
|
151
|
+
* that also contains robots. They are placed by their authored stage transform
|
|
152
|
+
* under the robot root, so the loader's up-axis and unit normalization applies
|
|
153
|
+
* to them too. Collision-only and guide/proxy prims are skipped.
|
|
154
|
+
*/
|
|
155
|
+
declare function bindSceneMeshes(stage: Stage, robot3d: ThreeUsdRobot, desc: RobotDescription, options?: {
|
|
156
|
+
textureProvider?: TextureProvider;
|
|
157
|
+
}): number;
|
|
62
158
|
|
|
63
159
|
/**
|
|
64
|
-
*
|
|
160
|
+
* Authoring API (M14): assemble a robot from Three.js objects and export it.
|
|
65
161
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
162
|
+
* Links and joints are declared by name. Every joint takes **one** world-space
|
|
163
|
+
* frame; both body-local joint frames derive from it —
|
|
164
|
+
* `frame0 = linkWorld(parent)⁻¹ · frame`, `frame1 = linkWorld(child)⁻¹ · frame`
|
|
165
|
+
* — so the arrangement at build time is the robot's zero pose. Values are SI
|
|
166
|
+
* (radians / stage linear units); the exporter converts to authored units on
|
|
167
|
+
* write. World matrices are captured at `addLink`/`add*Joint` time.
|
|
72
168
|
*/
|
|
73
169
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
type ThreeUsdRobotLoaderOptions = {
|
|
86
|
-
/** Resolver for references / payloads / sublayers (default {@link DefaultAssetResolver}). */
|
|
87
|
-
assetResolver?: AssetResolver;
|
|
88
|
-
/** Render visual meshes (M6). */
|
|
89
|
-
loadVisuals?: boolean;
|
|
90
|
-
/** Render collision meshes (M6). */
|
|
91
|
-
loadCollisions?: boolean;
|
|
92
|
-
/** Load diffuse textures referenced by materials (default `true`). */
|
|
93
|
-
loadTextures?: boolean;
|
|
94
|
-
/** Up-axis correction strategy (M9). */
|
|
95
|
-
upAxisConversion?: "auto" | "Y" | "Z" | "none";
|
|
96
|
-
/** Extra uniform scale multiplied with `metersPerUnit` (M9). */
|
|
97
|
-
unitScale?: number;
|
|
98
|
-
/** Clamp `setJointValue` to authored limits (default `true`). */
|
|
99
|
-
clampJointLimits?: boolean;
|
|
100
|
-
/** Seed joints from drive targets / joint state (M9). */
|
|
101
|
-
applyDriveTargetsAsInitialPose?: boolean;
|
|
102
|
-
/** Override the robot name. */
|
|
103
|
-
robotName?: string;
|
|
104
|
-
/** Receives non-fatal load diagnostics. */
|
|
170
|
+
/** A world-space frame: a matrix, or an object whose `matrixWorld` is used. */
|
|
171
|
+
type WorldFrame = THREE.Matrix4 | THREE.Object3D;
|
|
172
|
+
type RobotBuilderOptions = {
|
|
173
|
+
name: string;
|
|
174
|
+
/** Stage up axis; defaults to `"Z"` (Isaac Sim convention). */
|
|
175
|
+
upAxis?: "Y" | "Z";
|
|
176
|
+
/** Stage linear unit; defaults to `1` (meters). */
|
|
177
|
+
metersPerUnit?: number;
|
|
178
|
+
/** Link to flag with `PhysicsArticulationRootAPI` (default: the container prim). */
|
|
179
|
+
articulationRoot?: string;
|
|
105
180
|
onWarn?: (message: string) => void;
|
|
106
181
|
};
|
|
182
|
+
type AddLinkOptions = {
|
|
183
|
+
name: string;
|
|
184
|
+
/** Link frame in world space at build pose (default identity). */
|
|
185
|
+
frame?: WorldFrame;
|
|
186
|
+
/** Objects whose `THREE.Mesh` descendants become the link's visual meshes. */
|
|
187
|
+
visuals?: THREE.Object3D[];
|
|
188
|
+
/** Objects whose `THREE.Mesh` descendants become collision meshes. */
|
|
189
|
+
collisions?: THREE.Object3D[];
|
|
190
|
+
/** Mass properties, exported as `PhysicsMassAPI` (M16). */
|
|
191
|
+
inertial?: LinkInertialDescription;
|
|
192
|
+
/** `physics:approximation` applied to this link's collision meshes (M16). */
|
|
193
|
+
collisionApproximation?: CollisionApproximation;
|
|
194
|
+
/** Physics material bound to this link's collision meshes (M16). */
|
|
195
|
+
physicsMaterial?: ExportPhysicsMaterial;
|
|
196
|
+
};
|
|
197
|
+
type AddJointOptions = {
|
|
198
|
+
name: string;
|
|
199
|
+
/** Parent link name; omit to fix the child to the world. */
|
|
200
|
+
parent?: string;
|
|
201
|
+
child: string;
|
|
202
|
+
/** Joint frame in world space (default: the child link's frame). */
|
|
203
|
+
frame?: WorldFrame;
|
|
204
|
+
/** Rotation / sliding axis token in the joint frame (default `"X"`). */
|
|
205
|
+
axis?: Axis;
|
|
206
|
+
/** Limits in SI: radians (revolute) or stage linear units (prismatic). */
|
|
207
|
+
lower?: number;
|
|
208
|
+
upper?: number;
|
|
209
|
+
/** Initial joint value in SI, exported as `PhysicsJointStateAPI`. */
|
|
210
|
+
initialValue?: number;
|
|
211
|
+
drive?: JointDriveDescription;
|
|
212
|
+
};
|
|
213
|
+
declare class RobotBuilder {
|
|
214
|
+
private readonly robotName;
|
|
215
|
+
private readonly upAxis;
|
|
216
|
+
private readonly metersPerUnit;
|
|
217
|
+
private readonly articulationRoot?;
|
|
218
|
+
private readonly warn;
|
|
219
|
+
private readonly links;
|
|
220
|
+
private readonly joints;
|
|
221
|
+
private readonly materialCache;
|
|
222
|
+
private materialAutoId;
|
|
223
|
+
constructor(options: RobotBuilderOptions);
|
|
224
|
+
addLink(options: AddLinkOptions): this;
|
|
225
|
+
addFixedJoint(options: Omit<AddJointOptions, "axis" | "lower" | "upper">): this;
|
|
226
|
+
addRevoluteJoint(options: AddJointOptions): this;
|
|
227
|
+
addPrismaticJoint(options: AddJointOptions): this;
|
|
228
|
+
private addJoint;
|
|
229
|
+
/** Assemble the IR + geometry provider (validates the kinematic graph). */
|
|
230
|
+
build(): {
|
|
231
|
+
desc: RobotDescription;
|
|
232
|
+
geometry: RobotGeometryProvider;
|
|
233
|
+
tree: KinematicTree;
|
|
234
|
+
};
|
|
235
|
+
/** Build and export in one step (pass the result to `serializeUsda`). */
|
|
236
|
+
toUsda(options?: Omit<ExportRobotOptions, "geometry">): UsdaFile;
|
|
237
|
+
/** Collect `THREE.Mesh` descendants of `roots` as link-relative export meshes. */
|
|
238
|
+
private gatherMeshes;
|
|
239
|
+
private convertMaterial;
|
|
240
|
+
}
|
|
241
|
+
|
|
107
242
|
/**
|
|
108
|
-
*
|
|
243
|
+
* Three.js-side export (M14).
|
|
109
244
|
*
|
|
110
|
-
*
|
|
111
|
-
* {@link
|
|
112
|
-
*
|
|
245
|
+
* Converts `BufferGeometry` / `MeshStandardMaterial` into the plain
|
|
246
|
+
* {@link ExportMesh} data the exporter consumes, harvests the meshes attached
|
|
247
|
+
* under a loaded robot's links, and re-exports a {@link ThreeUsdRobot} as a
|
|
248
|
+
* USDA AST. Texture maps are not carried yet (M15) — constants only.
|
|
113
249
|
*/
|
|
114
|
-
declare class ThreeUsdRobotLoader {
|
|
115
|
-
readonly options: ThreeUsdRobotLoaderOptions;
|
|
116
|
-
constructor(options?: ThreeUsdRobotLoaderOptions);
|
|
117
|
-
private get resolver();
|
|
118
|
-
/**
|
|
119
|
-
* Fetch an asset by URL and build the robot. `.usdz` packages are unzipped and
|
|
120
|
-
* composed from their entries; everything else is treated as USDA text.
|
|
121
|
-
*/
|
|
122
|
-
loadAsync(url: string): Promise<ThreeUsdRobot>;
|
|
123
|
-
private fetchRootBytes;
|
|
124
|
-
/** Build a robot (composed, with meshes) from USDA source text. */
|
|
125
|
-
parse(text: string, baseUrl?: string): Promise<ThreeUsdRobot>;
|
|
126
|
-
/** Build a robot from the bytes of a `.usdz` package. */
|
|
127
|
-
parseUsdz(bytes: Uint8Array): Promise<ThreeUsdRobot>;
|
|
128
|
-
/** Build a robot from the bytes of a binary crate (`.usdc` / binary `.usd`). */
|
|
129
|
-
parseCrate(bytes: Uint8Array, baseUrl?: string): Promise<ThreeUsdRobot>;
|
|
130
|
-
/** Parse + compose USDA source into the Three.js-independent robot IR. */
|
|
131
|
-
parseRobotDescription(text: string, baseUrl?: string): Promise<RobotDescription>;
|
|
132
|
-
private buildFromStage;
|
|
133
|
-
private composeStage;
|
|
134
|
-
private robotOptions;
|
|
135
|
-
private extractOptions;
|
|
136
|
-
}
|
|
137
250
|
|
|
138
|
-
|
|
251
|
+
type GeometryToExportMeshOptions = {
|
|
252
|
+
name: string;
|
|
253
|
+
kind?: "visual" | "collision";
|
|
254
|
+
/** Transform relative to the link frame (column-major); identity when omitted. */
|
|
255
|
+
transform?: Mat4;
|
|
256
|
+
material?: ExportMaterial;
|
|
257
|
+
doubleSided?: boolean;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Convert a triangle `BufferGeometry` into exportable mesh data. Non-indexed
|
|
261
|
+
* geometry becomes sequential triangles; a trailing partial triangle (or the
|
|
262
|
+
* absence of a position attribute) returns `null`.
|
|
263
|
+
*/
|
|
264
|
+
declare function geometryToExportMesh(geometry: THREE.BufferGeometry, options: GeometryToExportMeshOptions): ExportMesh | null;
|
|
265
|
+
/**
|
|
266
|
+
* Extract constant PBR parameters from a Three.js material. Only
|
|
267
|
+
* `MeshStandardMaterial` maps onto `UsdPreviewSurface`; anything else returns
|
|
268
|
+
* `undefined` (with a warning). Texture maps are reported but not carried.
|
|
269
|
+
*/
|
|
270
|
+
declare function materialToExportMaterial(material: THREE.Material, name: string, onWarn?: (message: string) => void): ExportMaterial | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* Provider over the meshes `bindRobotMeshes` attached under each link of a
|
|
273
|
+
* loaded robot (direct children tagged `userData.kind`), with their link-local
|
|
274
|
+
* transforms and materials.
|
|
275
|
+
*/
|
|
276
|
+
declare function threeGeometryProvider(robot: ThreeUsdRobot, onWarn?: (message: string) => void): RobotGeometryProvider;
|
|
277
|
+
type ExportThreeUsdRobotOptions = Omit<ExportRobotOptions, "geometry"> & {
|
|
278
|
+
/** Re-read mesh data from the source stage instead of the Three.js scene. */
|
|
279
|
+
stage?: Stage;
|
|
280
|
+
};
|
|
281
|
+
/** Export a loaded robot back to a USDA AST (pass the result to `serializeUsda`). */
|
|
282
|
+
declare function exportThreeUsdRobot(robot: ThreeUsdRobot, options?: ExportThreeUsdRobotOptions): UsdaFile;
|
|
283
|
+
|
|
284
|
+
export { type AddJointOptions, type AddLinkOptions, AssetResolver, Axis, type BindMeshesOptions, CollisionApproximation, ExportMaterial, ExportMesh, ExportPhysicsMaterial, ExportRobotOptions, type ExportThreeUsdRobotOptions, type GeometryToExportMeshOptions, JointDriveDescription, KinematicTree, LinkInertialDescription, Mat4, type MeshKind, Prim, type ResolvedMaterial, type ResolvedTexture, RobotBuilder, type RobotBuilderOptions, RobotDescription, RobotGeometryProvider, Stage, type TextureColorSpace, type TextureOptions, type TextureProvider, type TextureTransform, type TextureWrap, ThreeUsdRobot, UsdaFile, Vec2, Vec3, type WorldFrame, axisVector, bindRobotMeshes, bindSceneMeshes, buildMeshGeometry, buildMeshMaterial, createTextureProvider, exportThreeUsdRobot, geometryToExportMesh, materialToExportMaterial, resolveBoundMaterial, threeGeometryProvider };
|