MCPcopy Create free account
hub / github.com/openai/point-e / scene_bbox

Function scene_bbox

point_e/evals/scripts/blender_script.py:74–88  ·  view source on GitHub ↗
(single_obj=None, ignore_matrix=False)

Source from the content-addressed store, hash-verified

72
73
74def scene_bbox(single_obj=None, ignore_matrix=False):
75 bbox_min = (math.inf,) * 3
76 bbox_max = (-math.inf,) * 3
77 found = False
78 for obj in scene_meshes() if single_obj is None else [single_obj]:
79 found = True
80 for coord in obj.bound_box:
81 coord = Vector(coord)
82 if not ignore_matrix:
83 coord = obj.matrix_world @ coord
84 bbox_min = tuple(min(x, y) for x, y in zip(bbox_min, coord))
85 bbox_max = tuple(max(x, y) for x, y in zip(bbox_max, coord))
86 if not found:
87 raise RuntimeError("no objects in scene to compute bounding box for")
88 return Vector(bbox_min), Vector(bbox_max)
89
90
91def scene_meshes():

Callers 2

normalize_sceneFunction · 0.85
write_camera_metadataFunction · 0.85

Calls 1

scene_meshesFunction · 0.85

Tested by

no test coverage detected