SIGGRAPH 2020 [Paper] [Project Page]
Point2Mesh is a technique for reconstructing a surface mesh from an input point cloud. This approach "learns" from a single object, by optimizing the weights of a CNN to deform some initial mesh to shrink-wrap the input point cloud. The argument for going this route is: since the (local) convolutional kernels are optimized globally across the entire shape, this encourages local-scale geometric self-similarity across the reconstructed shape surface.
The code was written by Rana Hanocka and Gal Metzer.
git clone https://github.com/zdata-inc/point2mesh.git
cd point2mesh
git submodule init
Refer to the PyTorch3D repo for complete installation instructions
conda create -n point2mesh python=3.9
conda activate point2mesh
conda install pytorch=1.13.0 torchvision pytorch-cuda=11.6 -c pytorch -c nvidia
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
pip install trimesh
# pip install bpy -- requires python 3.10 or python < 3.8
python3 -m venv point2mesh
pip install torch==1.13.0 torchvision
pip install torch --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu116
pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
pip install trimesh
Refer to the Manifold repo for complete installation instructions.
cd Manifold
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
cd Manifold
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target Manifold --config Release
Download our example data
bash ./scripts/get_data.sh
First, if using conda env first activate env e.g. source activate point2mesh
.
All the scripts can be found in ./scripts/examples
.
Here are a few examples:
bash ./scripts/examples/giraffe.sh
bash ./scripts/examples/bull.sh
bash ./scripts/examples/tiki.sh
bash ./scripts/examples/noisy_guitar.sh
... and more.
To run all the examples in this repo:
bash ./scripts/run_all_examples.sh
You should provide an initial mesh file. If the shape has genus 0, you can use the convex hull script provided in ./scripts/process_data/convex_hull.py
If you find this code useful, please consider citing our paper
@article{Hanocka2020p2m,
title = {Point2Mesh: A Self-Prior for Deformable Meshes},
author = {Hanocka, Rana and Metzer, Gal and Giryes, Raja and Cohen-Or, Daniel},
year = {2020},
issue_date = {July 2020},
publisher = {Association for Computing Machinery},
volume = {39},
number = {4},
issn = {0730-0301},
url = {https://doi.org/10.1145/3386569.3392415},
doi = {10.1145/3386569.3392415},
journal = {ACM Trans. Graph.},
}
If you have questions or issues running this code, please open an issue.