feat(pipeline): add batch processing for scene graph construction

This commit is contained in:
2026-03-28 17:32:15 +08:00
parent 3c9a6f6eaf
commit f604c85a79
7 changed files with 252 additions and 44 deletions

View File

@@ -10,3 +10,22 @@ class RoomNode:
# 范围:不用复杂的 Polygon用一个中心点+半径,或者简单的 3D BBox 足够了
center: np.ndarray # [x, y, z]
bbox_extent: np.ndarray # [dx, dy, dz] 用于快速判断一个点在不在房间里
def __post_init__(self):
self.center = np.asarray(self.center, dtype=np.float32)
self.bbox_extent = np.asarray(self.bbox_extent, dtype=np.float32)
if self.center.shape != (3,):
raise ValueError(f"center must have shape (3,), got {self.center.shape}")
if self.bbox_extent.shape != (3,):
raise ValueError(f"bbox_extent must have shape (3,), got {self.bbox_extent.shape}")
if not np.all(np.isfinite(self.center)):
raise ValueError("center must contain only finite values")
if not np.all(np.isfinite(self.bbox_extent)):
raise ValueError("bbox_extent must contain only finite values")
if np.any(self.bbox_extent < 0):
raise ValueError("bbox_extent must be non-negative")