Eikonal solver using parallel fast sweeping
Project description
Fast sweeping SDF solver
This repository contains a Python package providing an efficient solver for the Eikonal equation in 3D. The primary use for this package is to redistance a signed distance function (SDF) from its zero level set (e.g., during an optimization that optimizes the SDF). In particular, this implementation was created for the use in our paper on differentiable signed distance function rendering. You can find the code for that paper here.
This library does not convert meshes to SDFs, even though it can be used for such applications. This implementation runs efficiently on GPUs (using CUDA) and also provides a CPU implementation as a fallback. The solver is exposed via Python bindings and uses Dr.Jit for some of its implementation.
The code implements the parallel fast sweeping algorithm for the Eikonal equation:
A parallel fast sweeping method for the Eikonal equation. Miles Detrixhe, Frédéric Gibou, Chohong Min, Journal of Computational Physics 237 (2013)
The implementation is in part based on PDFS, see also LICENSE
for license details.
Installation
Pre-build binaries are provided on PyPi and can be installed using
pip install fastsweep
Alternatively, the package is also relatively easy to build and install from source. The build setup uses CMake and scikit build. Please clone the repository including submodules using
git clone --recursive git@github.com:rgl-epfl/fastsweep.git
The Python module can then be built and installed by invoking:
pip install ./fastsweep
Important: It is important that this solver and drjit
are compiled with exactly the same compiler and settings for binary compatibility. If you installed a pre-built drjit
package using pip
, you most likely will want to use the pre-built package for fastsweep
as well. Conversely, if you want to compile one of these packages locally, you will most likely need to compile the other one locally as well. If
there is a problem with binary compatibility, invoking the functionality of the solver will most likely throw a type-mismatch error.
Usage
The solver takes a Dr.Jit 3D TensorXf
as input and solves the Eikonal equation from its zero level set. It returns a valid SDF that reproduces the zero level set of the input. The solver does not support 1D or 2D problems, for these one can for example use scikit-fmm.
Given an initial 3D tensor, the solver can be invoked as
import fastsweep
data = drjit.cuda.TensorXf(...)
sdf = fastsweep.redistance(data)
The resulting array sdf
is then a valid SDF. The solver returns either a drjit.cuda.TensorXf
or dfjit.llvm.TensorXf
, depending on the type of the input. A complete
example script is provided here.
Limitations
- The code currently assumes the SDF to be contained in the unit cube volume and hasn't been tested for non-uniform volumes or other scales.
- The CPU version isn't very efficient, this code is primarily designed for GPU execution and the CPU version is really just a fallback.
- The computation of the zero level set does not consider different grid interpolation modes.
Citation
If you use this solver for an academic paper, consider citing the following paper:
@article{Vicini2022sdf,
title = {Differentiable Signed Distance Function Rendering},
author = {Delio Vicini and Sébastien Speierer and Wenzel Jakob},
year = 2022,
month = jul,
journal = {Transactions on Graphics (Proceedings of SIGGRAPH)},
volume = 41,
number = 4,
pages = {125:1--125:18},
doi = {10.1145/3528223.3530139}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file fastsweep-0.1.2.tar.gz
.
File metadata
- Download URL: fastsweep-0.1.2.tar.gz
- Upload date:
- Size: 48.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01bd3dd8c16f4064161dc078be67b651dbd2c1f70f6c489911e58bc3c40802b9 |
|
MD5 | 0318a8930a454e4d6c0e74ad07729653 |
|
BLAKE2b-256 | 9aaf1185e3436963f924e611737a6e875fd9dcfdd4abae2cc2bacde4c1ac333d |
File details
Details for the file fastsweep-0.1.2-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 76.9 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e37785f7e6bfdc0f220726f2ff3e2ab723a00cc957bb8ae1eee5b92d6e74ff1e |
|
MD5 | c117f080b35dda699e3e5ba518a14224 |
|
BLAKE2b-256 | fa05c9c15a77a334153b9563a15a1a9f2fdacd57d8d42cb007601ec51ccf56ee |
File details
Details for the file fastsweep-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 88.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a34fa0b798f839c6f52a2bcaf05c178cfea043c500d2ba063a6d0e76dc55a39 |
|
MD5 | a7a41129384502e15e39f3c6b4ef8f11 |
|
BLAKE2b-256 | 4076a3bf72c3ae993c5201d9fd449bbf8fa694a0274d036476ca15c62f0bab83 |
File details
Details for the file fastsweep-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 71.0 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c01e7f6d763e9cc1c4e588f8ec3b9f9dce56037072cdaab2cee6b01af9bb86fe |
|
MD5 | 7ef048f8626512f8ee495d4ad1bc4691 |
|
BLAKE2b-256 | 12330562158ac585f6bb852a03cc0e7ac8cf862e718923fb297981612387941e |
File details
Details for the file fastsweep-0.1.2-cp310-cp310-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp310-cp310-macosx_10_14_x86_64.whl
- Upload date:
- Size: 76.5 kB
- Tags: CPython 3.10, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a84106a7caa845e3e3e641072fd3a08a1050646ff387fef15562147044a618 |
|
MD5 | af7bae5ac133248527f6cf6fbd774c8a |
|
BLAKE2b-256 | e7b7e370c3f5cb0485d51697fd3a290a5547c95ee63fe942cec8bc260c5f1fba |
File details
Details for the file fastsweep-0.1.2-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 76.9 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc2373110dacd1912005ead354dd13f89c78454b173641606af1b12fa913fc3f |
|
MD5 | e4310b43d84ec0f375ae4bc146e3e9f2 |
|
BLAKE2b-256 | bd14d87fdecda52e8687cc3077660d29c4483aabaa42f9f249ed8f8417034518 |
File details
Details for the file fastsweep-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 88.5 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33b42f49d2173081a57699913532b6a70e6f746a1ba2c91e3918fdd960d9c3d6 |
|
MD5 | 68517f089e6e8b164b8244984a9416fc |
|
BLAKE2b-256 | 3dc0d462befdd60515f7ab395f48c342597cf61d1e23cca056f4b94cd000b2a7 |
File details
Details for the file fastsweep-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 71.2 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5340122e6afd0d05c4437389e18836dea32e6716169df0505bfc27e9ae68b5b5 |
|
MD5 | e7d532bdb658dfd7345f682a3fb403d2 |
|
BLAKE2b-256 | 2b92332a04d13327fd19654eb45e709940d43e82be007e0824f89b655fc8ddd0 |
File details
Details for the file fastsweep-0.1.2-cp39-cp39-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp39-cp39-macosx_10_14_x86_64.whl
- Upload date:
- Size: 76.6 kB
- Tags: CPython 3.9, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b06eb3118ac8cf8eb00c9c045676293107e64794da6bb6ad85e1de18d6fe02a7 |
|
MD5 | 22a057295427ed3976974acbe1274d18 |
|
BLAKE2b-256 | ef34a2216b290ae900835e09ae8dc5b5cc8664d366dfb66117718cffefd18e0b |
File details
Details for the file fastsweep-0.1.2-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 76.8 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c83753747871366512de267c3f150a704d1d2c766e8c1d4b4f1f7905d5c45c4d |
|
MD5 | 324113b7391807a53efaf65c3b973b37 |
|
BLAKE2b-256 | 8102ee8c0875f2a6f08dbc9029884e01be5daaf15dfbbead8a9acac622b22936 |
File details
Details for the file fastsweep-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 88.1 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e7968a08e462dd8630e70a98314a29f5b0a72d238ee3441478e9e5a5ae1454 |
|
MD5 | 505818d39ec61f32316b54e0a44187b1 |
|
BLAKE2b-256 | 7f65faf993de2347483ed2b5e957772cfcbc8b8ae8ca9b3e5125ff346f9f0204 |
File details
Details for the file fastsweep-0.1.2-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 71.0 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b4ca9e157d32384ad9e2b577b7ae785c78afbd35c4815becabf9bd6933af1a2 |
|
MD5 | be6df5ffc418008fe7aeb84e7ec6096e |
|
BLAKE2b-256 | 821f26b0eb417aa10b56b2d7d496b46db62f2084e27f662901725e3d342751a9 |
File details
Details for the file fastsweep-0.1.2-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fastsweep-0.1.2-cp38-cp38-macosx_10_14_x86_64.whl
- Upload date:
- Size: 76.4 kB
- Tags: CPython 3.8, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b9319de1687d9bb2b975f4d20fe1842d01e1e7494b3ac597b3b699afce83fe |
|
MD5 | 88f3797b526a9753e37264a90eb2316c |
|
BLAKE2b-256 | 48aa8da2a9c683eeb68b3021ac3fb3462c4643ebba7fe464fbc5400aaf725855 |