View the result of geometry processing in Python

Introduction

"I'm not motivated to work, so I want to win the geometry processing !!"

I think there are days like that.

This time, I will introduce a library that displays the result after performing geometry processing in Python.

Pymesh is good for geometry processing itself.

meshplot

The one used in libigl's python binding tutorial. It doesn't seem to be on PyPI, so from https://github.com/skoch9/meshplot

python setup.py install

Drop it by yourself.

import meshplot
import trimesh

meshplot.offline()
mesh = trimesh.load('./unchan_pink.obj')

V = mesh.vertices
F = mesh.faces

meshplot.plot(V, F)

Then, html with embedded viewer for displaying mesh is generated after script is executed. If you want to do it in jupyter, you can delete meshplot.offline () (Reference).

The result is like this, you can rotate and Zoom out / in with the mouse.

image.png

However, this library is

--You need to install it by yourself --html is generated every time script is executed

So it is a little inconvenient.

polyscope

image.png

https://polyscope.run/py/

A relatively new viewer of the Contributor, Keenan Crane, who has a strong Geometry neighborhood.

There is a C ++ version and a Python version, both of which are easy to use.

Backend seems to be based on OpenGL.

Install can be done with pip.


pip install polyscope

The display script looks like this.

import polyscope as ps
import trimesh

mesh = trimesh.load('./unchan_pink.obj')

V = mesh.vertices
F = mesh.faces

ps.init()
ps.register_point_cloud("my points", V)
ps.register_surface_mesh("my mesh", V, F, smooth_shade=True)
ps.show()

The result works like this at about 60fps. You can freely change the colors of the vertices and triangles.

image.png

Summary

polyscope convenient!

Recommended Posts

View the result of geometry processing in Python
The result of installing python in Anaconda
The result of Java engineers learning machine learning in Python www
The basics of running NoxPlayer in Python
In search of the fastest FizzBuzz in Python
The story of blackjack A processing (python)
Status of each Python processing system in 2020
[Python] Let's reduce the number of elements in the result in set operations
A function that measures the processing time of a method in python
Output the number of CPU cores in Python
[Python] Sort the list of pathlib.Path in natural sort
File processing in Python
Multithreaded processing in python
Get the caller of a function in Python
Match the distribution of each group in Python
Calculation result after the decimal point in Python
the zen of Python
Make a copy of the list in Python
Text processing in Python
Find the divisor of the value entered in python
I want to batch convert the result of "string" .split () in Python
Queue processing in Python
Image processing? The story of starting Python for
Find the solution of the nth-order equation in python
Receive a list of the results of parallel processing in Python with starmap
The story of reading HSPICE data in Python
[Note] About the role of underscore "_" in Python
About the behavior of Model.get_or_create () of peewee in Python
Solving the equation of motion in Python (odeint)
Output in the form of a python array
Various processing of Python
How to pass the execution result of a shell command in a list in Python
plot the coordinates of the processing (python) list and specify the number of times in draw ()
Experience the good calculation efficiency of vectorization in Python
Full-width and half-width processing of CSV data in Python
How to get the number of digits in Python
[python] Get the list of classes defined in the module
The story of FileNotFound in Python open () mode ='w'
Get the result in dict format with Python psycopg2
Learn the design pattern "Chain of Responsibility" in Python
Implement the solution of Riccati algebraic equations in Python
Get the size (number of elements) of UnionFind in Python
Examine the close processing of Python dataset (SQLAlchemy wrapper)
Not being aware of the contents of the data in python
Reproduce the execution example of Chapter 4 of Hajipata in Python
Let's use the open data of "Mamebus" in Python
Implemented the algorithm of "Algorithm Picture Book" in Python3 (Heapsort)
[Python] Outputs all combinations of elements in the list
Get the URL of the HTTP redirect destination in Python
A reminder about the implementation of recommendations in Python
Reproduce the execution example of Chapter 5 of Hajipata in Python
To do the equivalent of Ruby's ObjectSpace._id2ref in Python
Check the asymptotic nature of the probability distribution in Python
Summary of date processing in Python (datetime and dateutil)
Scraping the result of "Schedule-kun"
UTF8 text processing in python
python3 Measure the processing speed.
Towards the retirement of Python2
Download the file in Python
Find the difference in Python
About the ease of Python