Code Monkey home page Code Monkey logo

bvh-distance-queries's Introduction

Point to Mesh distance computation

This package provides a PyTorch module that performs point to surface queries on the GPU

Table of Contents

License

Software Copyright License for non-commercial scientific research purposes. By downloading and/or using the Model & Software (including downloading, cloning, installing, and any other use of this github repository), you acknowledge that you have read these terms and conditions, understand them, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Model & Software. Any infringement of the terms of this agreement will automatically terminate your rights under this License.

Description

This repository provides a PyTorch wrapper around a CUDA kernel that implements the method described in Maximizing parallelism in the construction of BVHs, octrees, and k-d trees. More specifically, given a batch of meshes it builds a BVH tree for each one, which can then be used for distance quries.

Installation

Before installing anything please make sure to set the environment variable $CUDA_SAMPLES_INC to the path that contains the header helper_math.h , which can be found in the CUDA Samples repository. To install the module run the following commands:

1. Install the dependencies

pip install -r requirements.txt 

2. Run the setup.py script

python setup.py install

If you want to modify any part of the code then use the following command:

python setup.py build develop

Examples

  • Random points to surface: Generate random points and compute their distance to a mesh. Use:

    python examples/random_points_to_surface.py --mesh-fn MESH_FN --num-query-points 100000
  • Fit a cube to a cube: Randomly translate and rotate a cube then fit it to the original, without using the correspondences by using the point to mesh distances.

    python examples/fit_cube_to_cube.py
  • Fit a cube to random points: First generate a set of random points and compute their convex hull, which gives us a dummy scan. We then try to rigidly align a cube to this scan using the provided point-to-mesh residuals.

    python examples/fit_cube_to_random_points.py 

Dependencies

  1. PyTorch

Example dependencies

  1. open3d
  2. mesh

Running on Cluster

If you want to run this on the cluster you need to build it using the GPU availabe on the cluster. If you use the local build there might be GPU architecture compatibility issue and you can encounter following error message

RuntimeError: parallel_for failed: unrecognized error code: unrecognized error code

Citation

If you find this code useful in your research please cite the relevant work(s) of the following list:

@inproceedings{Karras:2012:MPC:2383795.2383801,
    author = {Karras, Tero},
    title = {Maximizing Parallelism in the Construction of BVHs, Octrees, and K-d Trees},
    booktitle = {Proceedings of the Fourth ACM SIGGRAPH / Eurographics Conference on High-Performance Graphics},
    year = {2012},
    pages = {33--37},
    numpages = {5},
    url = {https://doi.org/10.2312/EGGH/HPG12/033-037}, 
    doi = {10.2312/EGGH/HPG12/033-037},
    publisher = {Eurographics Association}
}

Contact

The code of this repository was implemented by Vassilis Choutas. For commercial licensing, please contact [email protected].

bvh-distance-queries's People

Contributors

vchoutas avatar yuliangxiu avatar pixelite1201 avatar dendenxu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.