Skip to content

Commit

Permalink
Limit initial zoom to far_plane
Browse files Browse the repository at this point in the history
 - take minimum of diagonal and 0.9 * far_plane

 Closes: #39
 Relates: #36
  • Loading branch information
ch-sa committed Nov 22, 2021
1 parent de69f40 commit 2ad2d51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion labelCloud/control/pcd_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ def load_pointcloud(self, path_to_pointcloud: str) -> PointCloud:
tmp_pcd.colorless = False

max_dims = np.subtract(tmp_pcd.pcd_maxs, tmp_pcd.pcd_mins)
diagonal = np.linalg.norm(max_dims)
diagonal = min(
np.linalg.norm(max_dims),
config.getfloat("USER_INTERFACE", "far_plane") * 0.9,
)

tmp_pcd.init_translation = -self.current_o3d_pcd.get_center() - [0, 0, diagonal]

Expand Down

0 comments on commit 2ad2d51

Please sign in to comment.