Constant-width `Points` bounds computation unhandled
UsdGeomPoints states that constant width is a commonly authored interpolation for widths.
However, constant interpolation yields no bounds when ComputeExtent is called.
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateInMemory()
points = UsdGeom.Points.Define(stage, "/points")
assert points.GetPointsAttr().Set([(0, 0, 0), (10, 0, 0)])
assert points.GetWidthsAttr().Set([5])
assert points.SetWidthsInterpolation(UsdGeom.Tokens.constant)
points_vertex = UsdGeom.Points.Define(stage, "/points_vertex")
assert points_vertex.GetPointsAttr().Set([(0, 0, 0), (10, 0, 0)])
assert points_vertex.GetWidthsAttr().Set([5, 5])
assert points_vertex.SetWidthsInterpolation(UsdGeom.Tokens.vertex)
boundable = UsdGeom.Boundable(points.GetPrim())
# prints `None`
print(boundable.ComputeExtent(Usd.TimeCode.Default()))
boundable_vertex = UsdGeom.Boundable(points_vertex.GetPrim())
# prints `[(-2.5, -2.5, -2.5), (12.5, 2.5, 2.5)]`
print(boundable_vertex.ComputeExtent(Usd.TimeCode.Default()))One quirk of this repro case is that the ComputeExtent name on Points and several other prims shadows ComputeExtent on Boundable. Given that this is not the case for UsdGeomMesh, I suspect that this is an artifact of UsdGeom extent computations helpers predating the bounds computation registry and ComputeExtents being defined in UsdGeomBoundable. This is why we have to rebind the UsdGeomPoints to UsdGeomBoundable to trigger the issue. I'd recommend the shadowing be fixed as well but as a separate issue.
A workaround would be for a user to properly compute it themselves and set the extents attribute which will be preferred over running the computation. However, validators that try to validate the authored extents attribute against the computed result may get tripped up.
Source: PixarAnimationStudios/OpenUSD