Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/user_guides/schemas/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Schema Domains
.. toctree::
:maxdepth: 2

usdGeom/usdGeom_toc
usdLux/usdLux_toc
usdMedia/usdMedia_toc
usdRender/usdRender_toc
Expand Down
188 changes: 188 additions & 0 deletions docs/user_guides/schemas/usdGeom/Boundable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
% WARNING: THIS FILE IS GENERATED BY genSchemaDocs. DO NOT EDIT.
% Generated: 05:01PM on October 02, 2025


(Boundable)=
# Boundable

The Boundable schema is the base class for all prims that can have bounding boxes calculated and stored. This is essential for performance optimization, as it allows renderers and other tools to quickly determine the spatial extent of geometry without having to compute it every time.

## What is an Extent?

An **extent** is a bounding box that describes the spatial bounds of a prim in its local coordinate space. Think of it as a rectangular box that completely contains the geometry.

- **Rectilinear**: The bounding box is axis-aligned (not rotated)
- **Local-space**: The extent is defined in the prim's own coordinate system, before any transforms are applied
- **Cached**: The extent is stored as an attribute so it doesn't need to be recalculated every time

## Bounds vs Extents

Every 3D object needs to know its size and position in space. UsdGeom uses two related but different concepts:

- **Extents**: Authored bounding box data stored as an attribute on geometry prims. This is a rectilinear (box-shaped) volume in local space that contains the geometry.
- **Bounds**: Computed bounding boxes that can be calculated at runtime, often combining multiple extents or computing them dynamically.

**Why both?** Extents provide fast, pre-computed bounding information for performance, while bounds can be calculated on-demand for more complex scenarios. For animated geometry, extents should be authored using timeSamples.

```{seealso}
For more details, see the [USD Boundable API documentation](https://openusd.org/release/api/class_usd_geom_boundable.html#UsdGeom_Boundable_Extent).
```

## Common Use Cases

1. **Frustum Culling**: Quickly determining if geometry is visible in a camera's view
2. **Collision Detection**: Fast initial checks for object intersections
3. **Level of Detail**: Deciding which geometry to load based on distance
4. **Spatial Queries**: Finding objects within a certain area
5. **Rendering Optimization**: Avoiding unnecessary work on hidden geometry

## Examples

### Basic Extent Usage
```{code-block} usda
#usda 1.0

def Sphere "MySphere"
{
double radius = 2.0
float3[] extent = [(-2, -2, -2), (2, 2, 2)]
}
```

### Animated Extent
```{code-block} usda
#usda 1.0

def Sphere "AnimatedSphere"
{
double radius.timeSamples = {
0: 1.0,
24: 3.0
}
float3[] extent.timeSamples = {
0: [(-1, -1, -1), (1, 1, 1)],
24: [(-3, -3, -3), (3, 3, 3)]
}
}
```

### Setting Extents

```{code-block} python
from pxr import Usd, UsdGeom

stage = Usd.Stage.CreateInMemory()
sphere = UsdGeom.Sphere.Define(stage, "/MySphere")

# Set the sphere's radius
sphere.CreateRadiusAttr(5)

# Calculate and set the extent (bounding box)
sphere.CreateExtentAttr(UsdGeom.Boundable.ComputeExtentFromPlugins(sphere, Usd.TimeCode.Default()))

stage.Save()
```

## Best Practices

1. **Always Author Extents**: To avoid expensive runtime extent computation.
2. **Update When Needed**: When geometry properties change, update the extent accordingly
3. **Use ComputeExtent()**: For dynamic extent calculation, use the appropriate ComputeExtent() methods

```{contents}
:depth: 2
:local:
:backlinks: none
```

(Boundable_properties)=

## Properties

(Boundable_extent)=

### extent

**USD type**: `float3[]`

The extent attribute defines a bounding box for the prim in its local coordinate space. It consists of two points: the minimum corner and maximum corner of the bounding box.

The extent is stored as an array of two float3 values:
- First element: minimum corner (xmin, ymin, zmin)
- Second element: maximum corner (xmax, ymax, zmax)

For animated geometry, the extent should be authored using timeSamples to capture the changing bounds over time. This allows renderers to efficiently cull geometry without having to compute the bounds at runtime.

Example:
```usda
float3[] extent = [(-1, -1, -1), (1, 1, 1)] # Unit cube
```


(Boundable_inheritedproperties_Xformable)=

## Inherited Properties ({ref}`Xformable`)

(Boundable_xformOpOrder)=

### xformOpOrder

**USD type**: `token[]`

The xformOpOrder attribute contains the names of transform operation attributes in the precise sequence they should be applied. This ensures transforms are evaluated in the correct order, which is opposite to what you might expect from matrix algebra.

Special tokens:
- "!resetXformStack!": Indicates this prim should not inherit parent transforms
- "!invert!<opName>": Indicates an inverted operation (e.g., for pivot points)


(Boundable_inheritedproperties_Imageable)=

## Inherited Properties ({ref}`Imageable`)

(Boundable_proxyPrim)=

### proxyPrim

**USD type**: `rel` (relationship)

The proxyPrim relationship allows linking a prim whose purpose is "render" to its (single target) purpose="proxy" prim. This is useful for:

- Pipeline complexity management through pruning
- DCC optimizations for interactive processing
- Hydra-based selection mapping

Note: Only valid to author on prims whose purpose is "render".


(Boundable_purpose)=

### purpose

**USD type**: `token`

**Fallback value**: `default`

Purpose classifies geometry into categories that can each be independently included or excluded from different operations, such as rendering or bounding-box computation.

Allowed values:
- "default": No special purpose, included in all traversals
- "render": For final quality renders
- "proxy": For lightweight interactive renders
- "guide": For helper/visualization geometry


(Boundable_visibility)=

### visibility

**USD type**: `token`

**Fallback value**: `inherited`

Visibility is the simplest way to control whether geometry is shown or hidden. It can be animated, allowing a sub-tree of geometry to appear and disappear over time. Unlike deactivating geometry, invisible geometry is still available for inspection, positioning, and defining volumes.

Allowed values:
- "inherited" (default): Inherits visibility from parent prims
- "invisible": Hides the prim and all its children from rendering

Expand Down
Loading