Search code examples
computer-visionopen3d

Open3d: How do I create an icosphere/geodesic polyhedron sphere?


I tried to create an icosphere in open3d. I tried the "create_sphere" function within TriangleMesh, but for some reason the mesh is made out of rectangles rather than triangles:

import open3d as o3d
a = o3d.geometry.TriangleMesh.create_sphere()
a.compute_vertex_normals()
o3d.visualization.draw_geometries([a])

As you can see, the sphere is not made of triangles. How do I generate an icosphere of triangles?

enter image description here


Solution

  • As you can see, the sphere is not made of triangles.

    Not true. The sphere is made of triangles.


    As stated in the Open3D documentation, open3d.geometry.TriangleMesh.create_sphere returns open3d.geometry.TriangleMesh, hence it must be made of triangles.

    To access the data, use np.asarray(a.triangles).


    Also notice that you can press w when the visualizer is on. And you shall see wireframes like this: enter image description here