Raw File
Tip revision: 0887b893b153f4ce6b09e4dd485f9b042f15b706 authored by Gal Metzer on 08 September 2021, 21:53 UTC
Tip revision: 0887b89
# Orienting Point Clouds with Dipole Propagation
<img src='docs/images/output.gif' align="right" width=325>
 Leveraging the power of neural networks and a robust and stable dipole propagation technique.

### SIGGRAPH 2021 [[Paper]]( [[Project Page]](<br>
by [Gal Metzer](,
[Rana Hanocka](,
[Denis Zorin](,
[Raja Giryes](,
[Daniele Panozzo](,
and [Daniel Cohen-Or](

# Getting Started

### Installation
- Clone this repo

#### Setup Conda Environment
To run the code, it is advised to create a new conda environment by running `conda create -n dipole python=3.6` </br>
and activate it by running `conda activate dipole`

then install the required libraries below:

- [PyTorch]( version 1.6.0 (might work with later versions as well) <br>
  install from [PyTorch getting started]( with your appropriate CUDATOOLKIT
- [Pytorch Geometric]( <br>
may use the helper installation script `./` or from [here]( <br>
  ** if using the helper script make sure to change the declared variables inside the script to match your installed versions **
- [argparse]( `pip install argparse`
- [Open3D]( `pip install open3d` (optional for faster normal estimation)

`./` is a full installation script for pytorch 1.6.0 and cudatoolkit 10.1. <br>
`./` is a full installation script for pytorch 1.8.0 and cudatoolkit 10.2. <br>
**Make sure to change `/path-to-anaconda3` in the installation script to the path on your machine**

# Running Examples
The code contains three main orientation scripts
- `` used to orient relatively small point clouds, taking into account all input points.
- `` used to orient relatively large point clouds, using a representative set of points for each patch.
- `` used to transfer the orientation from an oriented source point cloud to an un-oriented target point cloud.

The `/demos` folder contains demo scripts for running the code on point clouds from the `/data` folder.

Simple `cd demos` and run any of the scripts:

#### Visualizing Examples 
The oriented point clouds can easialy be visualized by opening them with [MeshLab](

#### Example Point Clouds
- ``
- `` (Table 1 - 17_42l)
- `` (Table 1 - 09_41r)
- ``
- ``
- ``
- ``

#### Large Example Point Clouds
Example on a large point clouds
- `` (Figure 17)
- `` (Figure 18)

#### Reference orientation
Example of using the dipole field to transfer the orientation from an oriented point cloud
to nearby points which are unoriented (e.g., generated using upsampling or consolidation).
- `` calculated on an output of [Self-Sampling]( <br> 
which does not have normal information for the produced consolidated point cloud. (Figure 15)

#### Simple Point Propagation
Example of using dipole propagation individually per point i.e. without patching and network steps.
- `` (Same shape as Table 1 - 09_41r)


In this implantation we added an extra step to fix the global orientation such that the normals are not only ***consistent***, <br>
but also points ***outside*** the surface, which was not included in the original paper. <br>

This technique relies on the fact that the dipole potential for a closed and correctly oriented shape is ***zero*** outside, 
and strictly positive or negative inside. Depending on whether the normals point inside or outside. <br>
The dipole potential is measured on a square lattice around the oriented point cloud,
and the sign of the average potential is used to determine whether all normals point outside. 

# Data
Data thanks to [Self-Sampling]( [NestiNet](, [Mano](, 
[threedscans](, [COSEG](

# Citation
If you find this code useful, please consider citing our paper
author = {Metzer, Gal and Hanocka, Rana and Zorin, Denis and Giryes, Raja and Panozzo, Daniele and Cohen-Or, Daniel},
title = {Orienting Point Clouds with Dipole Propagation},
year = {2021},
publisher = {Association for Computing Machinery},
volume = {40},
number = {4},
journal = {ACM Trans. Graph.},

# Questions / Issues
If you have questions or issues running this code, please open an issue.
back to top