[PYTHON] Create a cylinder with open3d + STL file output

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

Create a cylinder with open3d + STL file output
Create a file uploader with Django
Create a large text file with shellscript
Create a VM with a YAML file (KVM)
Create a GUI executable file created with tkinter
Create a PDF file with a random page size
Create a Photoshop format file (.psd) with python
Create a UI that replaces VBA with PySimpleGUI (file dialog, list, log output)
[Python] Create a Tkinter program distribution file with cx_Freeze
Create a 2d CAD file ".dxf" with python [ezdxf]
Create a dummy data file
Create a heatmap with pyqtgraph
Create a directory with python
Create xlsx file with XlsxWriter
How to create a flow mesh around a cylinder with snappyHexMesh
Build a deb file with Docker
Output to csv file with Python
Write standard output to a file
Create a virtual environment with Python!
Create an Excel file with Python3
Create a binary file in Python
Output cell to file with Colaboratory
Create a 1MByte random number file
Create a poisson stepper with numpy.random
How to create a config file
Make it possible to output a log to a file with go echo
Create a temporary file with django as a zip file and return it
Create and return a CP932 CSV file for Excel with Chalice
Create a Python function decorator with Class
Creating a simple PowerPoint file with Python
Build a blockchain with Python ① Create a class
Create a dummy image with Python + PIL.
[Python] Create a virtual environment with Anaconda
Let's create a free group with Python
Create a GUI app with Python's Tkinter
Create Excel file with Python + similarity matrix
Create a word frequency counter with Python 3.4
Create a deb file from a python package
[GPS] Create a kml file in Python
Create a Connecting Nearest Neighbor with NetworkX
Script to create a Mac dictionary file
Create a web service with Docker + Flask
Read a character data file with numpy
Create a devilish picture with Blender scripts
Create a matrix with PythonGUI (text box)
I made a configuration file with Python
Create an upgradeable msi file with cx_Freeze
Create a graph with borders removed with matplotlib
Divide each PowerPoint slide into a JPG file and output it with python
Zip-compress any file with the [shell] command to create a file and delete the original file.
Create a frame with transparent background with tkinter [Python]
How to read a CSV file with Python 2/3
Create a GIF file using Pillow in Python
Speaking Japanese with OpenJtalk (reading a text file)
Speaking Japanese with gTTS (reading a text file)
Create an executable file in a scripting language
Create a LINE BOT with Minette for Python
Create a game UI from scratch with pygame2!
How to create a JSON file in Python
Create a virtual environment with conda in Python
Create a page that loads infinitely with python