Skip to content
/ mesh Public
forked from MPI-IS/mesh

MPI-IS Mesh Processing Library

License

Notifications You must be signed in to change notification settings

bxiong97/mesh

 
 

Repository files navigation

Build Status

Perceiving Systems Mesh Package

This package contains core functions for manipulating meshes and visualizing them. It requires Python 3.5+ and is supported on Linux and macOS operating systems.

The Mesh processing libraries support several of our projects such as

Requirements

You first need to install the Boost <http://www.boost.org> libraries. Directly download from the website into the boost folder in this project, then unzip. It makes the path easy to get later.

Installation

First, make sure you are using Python 3.6. If not, create a conda env with the specified version:

conda create --name py36 python=3.6
conda activate py36

Then, create a dedicated Python virtual environment and activate it:

python3 -m venv --copies my_venv
conda deactivate
source my_venv/bin/activate

Finally, upgrade to the latest pip, or make will fail:

pip install --upgrade pip

You should then compile and install the psbody-mesh package easily using the Makefile:

$ BOOST_INCLUDE_DIRS=/home/yanfeng/github/mesh/boost/boost_1_80_0 make all

Testing

To run the tests, simply do:

$ make tests

Documentation

A detailed documentation can be compiled using the Makefile:

$ make documentation

Viewing the Meshes

Starting from version 0.4 meshviewer ships with meshviewer -- a program that allows you to display polygonal meshes produced by mesh package.

Viewing a mesh on a local machine

The most straightforward use-case is viewing the mesh on the same machine where it is stored. To do this simply run

$ meshviewer view sphere.obj

This will create an interactive window with your mesh rendering. You can render more than one mesh in the same window by passing several paths to view command

$ meshviewer view sphere.obj cylinder.obj

This will arrange the subplots horizontally in a row. If you want a grid arrangement, you can specify the grid parameters explicitly

$ meshviewer view -nx 2 -ny 2 *.obj

Viewing a mesh from a remote machine

It is also possible to view a mesh stored on a remote machine. To do this you need mesh to be installed on both the local and the remote machines. You start by opening an empty viewer window listening on a network port

(local) $ meshviewer open --port 3000

To stream a shape to this viewer you have to either pick a port that is visible from the remote machine or by manually exposing the port when connecting. For example, through SSH port forwarding

(local) $ ssh -R 3000:127.0.0.1:3000 user@host

Then on a remote machine you use view command pointing to the locally forwarded port

(remote) $ meshviewer view -p 3000 sphere.obj

This should display the remote mesh on your local viewer. In case it does not it might be caused by the network connection being closed before the mesh could be sent. To work around this one can try increasing the timeout up to 1 second

(remote) $ meshviewer view -p 3000 --timeout 1 sphere.obj

To take a snapshot you should locally run a snap command

(local) $ meshviewer snap -p 3000 sphere.png

License

Please refer for LICENSE.txt for using this software. The software is compiled using CGAL sources following the license in CGAL_LICENSE.pdf

Acknowledgments

We thank the external contribution from the following people:

About

MPI-IS Mesh Processing Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 67.8%
  • C 15.7%
  • C++ 14.2%
  • CMake 1.8%
  • Other 0.5%