install open3d
pip install open3d
o3d_cylinder.py
import open3d as o3d
#The first
mesh1 = o3d.geometry.TriangleMesh.create_cylinder()
mesh1.compute_vertex_normals()
#The second
mesh2 = o3d.geometry.TriangleMesh.create_cylinder()
mesh2.compute_vertex_normals()
# (relative)Move
mesh2.translate([0,10,10])
#Output with STL
o3d.io.write_triangle_mesh("sample.stl", mesh1+mesh2)
reference http://www.open3d.org/docs/release/tutorial/Basic/visualization.html
Recommended Posts