mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-14 20:03:49 +08:00
Add 'within' function to SceneBox (#2991)
Co-authored-by: Matias Turkulainen <30566358+maturk@users.noreply.github.com>
This commit is contained in:
1 parent
9960de0e84
commit
946151ac45
1 file changed
+4
@@ -34,6 +34,10 @@ class SceneBox:
|
||||
aabb[0] is the minimum (x,y,z) point.
|
||||
aabb[1] is the maximum (x,y,z) point."""
|
||||
|
||||
def within(self, pts: Float[Tensor, "n 3"]):
|
||||
"""Returns a boolean mask indicating whether each point is within the box."""
|
||||
return torch.all(pts > self.aabb[0], dim=-1) & torch.all(pts < self.aabb[1], dim=-1)
|
||||
|
||||
def get_diagonal_length(self):
|
||||
"""Returns the longest diagonal length."""
|
||||
diff = self.aabb[1] - self.aabb[0]
|
||||
|
||||
Reference in new issue
Block a user