Skip to main content

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

fastsweep-0.1.3.tar.gz (48.1 kB view details)

Uploaded Source

Built Distributions

fastsweep-0.1.3-cp311-cp311-win_amd64.whl (77.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

fastsweep-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (91.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (71.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fastsweep-0.1.3-cp311-cp311-macosx_10_14_x86_64.whl (77.6 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

fastsweep-0.1.3-cp310-cp310-win_amd64.whl (76.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

fastsweep-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (88.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (70.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fastsweep-0.1.3-cp310-cp310-macosx_10_14_x86_64.whl (76.2 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

fastsweep-0.1.3-cp39-cp39-win_amd64.whl (76.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastsweep-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (88.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.3-cp39-cp39-macosx_11_0_arm64.whl (70.6 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fastsweep-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl (76.3 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

fastsweep-0.1.3-cp38-cp38-win_amd64.whl (76.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

fastsweep-0.1.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (88.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.3-cp38-cp38-macosx_11_0_arm64.whl (70.4 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

fastsweep-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl (76.1 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

Details for the file fastsweep-0.1.3.tar.gz.

File metadata

  • Download URL: fastsweep-0.1.3.tar.gz
  • Upload date:
  • Size: 48.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for fastsweep-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7a4b4a540f951fff35317abe30f5b7ef8f523d466ecba00334f85f7af7b5b2a1
MD5 0131a2a59b7312fb4a47ece93ecb6937
BLAKE2b-256 4204f4fe267569e37fed3ea3c69e558a677e91684cf18b5aa98ccb6e03133950

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c49c42909a511d5e73ad9dfc89a8e69e777cee49af2389228946fb9e4157272f
MD5 207743e5cf91f6defb37b9c7fff94b19
BLAKE2b-256 0d988e113165a0d6d9a8f44289fc8ebe8f5c5e79dea4ce4f90c330aea4269248

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5845b69bc8569ce07dac271da012a97333a9762a57c324a4ef68fe7e4c7cb1f3
MD5 df8c31dc391f4f001e4952b08da733f8
BLAKE2b-256 6ddfbc6f8b508c73a9c3a3558d1d5715ef7a464ea467fb4f1da6af2a6e809eb5

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e703238a5476e1959cc7886863ef5e8aaa1193fcf3be1047f135848a781e5743
MD5 2c52e5009b5231fe9e71b0f5ecf19241
BLAKE2b-256 a0c16cfe1d352bb6e2ab8f01b8824450fd8c4778f895e530c32ee5806af1b837

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 760bffeacb72001f265b8ff3ed542245ca937aa9a060731b81fe81a54b09f6df
MD5 373d7b0eaefbb486171a1d8f3df162ea
BLAKE2b-256 74bddfd7ee9bbf9a445890e1eaa47df69f19838ece6b7d78fb5011d7d9071ab8

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a8cbf8060070bdaca64aa6fa08c26e56ce48ccc9abb14f44e92f54b60b9b4ce8
MD5 63f9d832592e72768bd493563d831875
BLAKE2b-256 cf68c54aeda697f6be45d82731f2261c29a50919760702f7e9c02b2e8b692e8f

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3e61020cbbaddb936f9121835cc82d3911e6f0c0db52422971260ef1b6e0a30f
MD5 a74190aee2156507905553989cc7e7f2
BLAKE2b-256 a67e09f593b9e75d80a35b9a729ea09fa0ab2df35faa44be5f1e18e392429626

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a2b641fb2a2edaa275becc15160824a01441813a46803e70f1b123b3b29772c
MD5 1821a71b58ec9f6e0a11483ba200bc07
BLAKE2b-256 e5febde864306b610657749aa8898dd94331ca44f47b3a1fdac113c77967e0e1

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 32bc9f6a2514f3fabbd2cab33af27984155c2617e5d5bad3dcef971bc73d331d
MD5 005a35e414023c40965407a237e9806d
BLAKE2b-256 e22ff91e732ce9519d0f55be94aba4547429c822291b29e460e3a0a94a350e4c

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fastsweep-0.1.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 76.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for fastsweep-0.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0d6059ad6c6d3c1afcb0ba17721d0f2902d68631472f2725a13bfeaf06b7b96a
MD5 d4f0e5abfb437318a07d1be14dca06e0
BLAKE2b-256 aede361106ff162ae1f5f74dc32e6e61937d8f64f0be545509795d23e737b03a

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4917125e4e309c65b65786a2a69ad2009023baeebaf6c124488e595362e6a448
MD5 4f871852eeea39c4cacdc20dabbc777d
BLAKE2b-256 cb7485e7989a54e1e41078c92191c422a9794c41238a689efdd37bf85ddc48a0

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45cad57102e3d6de8d2b87827a7e16c86b3155f31cdaaa076756428ac2e72a0c
MD5 9ec3e97ff8cdaf188f9187e35e74bb13
BLAKE2b-256 3b348e4e7e81339b0a69e94eb668b62ff2db5ba0e6e11b40188361914dbd23be

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 74ebdd46332954adf51ab66775c0e10fd7a5f29aaae7d64c6c3e5d82f5b61a7d
MD5 c57b2fbdc8012985cc1208fca7ec5025
BLAKE2b-256 502083467cf47cc7b6274e6956311b78e18d5f0ea364f4b9b93d4521f4339514

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fastsweep-0.1.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for fastsweep-0.1.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 60262ece89f027952ad10eea9dde7c245ace6c358be8ac7a447e1213ec045f30
MD5 9dddb2cdd8e4df68bf323c3b53d3e401
BLAKE2b-256 0f459f196f232fa9af2405abaedee4164bb5ca974b9da6c8c5a133dbae18006a

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6d784f46c036fbe1fa867e01c853ff918044095e97e4f299becc47d5ced36522
MD5 cd4b7421188fedf7b42a0142e59edb49
BLAKE2b-256 452291261a8a73276d6da3353badf6195ebe30f265396c72faf2e5798842954a

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e826d2f694d7b7ae69727c3b568551eecd4cf4daa49da91279e10fa027da212e
MD5 50b0f7a12d58b084ed184d511d4136aa
BLAKE2b-256 340a46bf202dba73f447a64f75f79f2f1b2f8053e8f12523eb5d6399afc5c9fa

See more details on using hashes here.

File details

Details for the file fastsweep-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for fastsweep-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f0bac3e309a7f5a5cd97cbc1ed5bef38926fc5d26c9b3c9590158427f54c89b5
MD5 c8aa295e0d811b260276decb6452578e
BLAKE2b-256 f1c47d8bcc570f636eff91b7361c2638632503d92761aaf48926ea9e0cae3324

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page