Created
January 31, 2020 06:25
-
-
Save richardrl/f76786042dcd72c6bd78396a73e172db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import open3d | |
import numpy as np | |
def main(): | |
vis = open3d.visualization.Visualizer() | |
vis.create_window("Pose Visualizer") | |
vis.get_render_option().line_width = 10.0 | |
obb = open3d.geometry.OrientedBoundingBox(center=np.array([0.0,0.0,0.0]), R=np.eye(3), extent=np.array([1.0, 1.0, 1.0])) | |
box_points = obb.get_box_points() | |
lines = [ | |
[0, 1], | |
[0, 2], | |
[0,3], | |
[1,6], | |
[1, 7], | |
[2,5], | |
[2,7], | |
[3,5], | |
[3,6], | |
[4,5], | |
[4,6], | |
[4,7], | |
] | |
line_colors = [[0, 0, .5] for i in range(len(lines))] | |
line_set = open3d.geometry.LineSet( | |
points=open3d.utility.Vector3dVector(box_points), | |
lines=open3d.utility.Vector2iVector(lines), | |
) | |
line_set.colors = open3d.utility.Vector3dVector(line_colors) | |
vis.add_geometry(line_set) | |
while True: | |
vis.poll_events() | |
vis.update_renderer() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment