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.1.tar.gz (48.0 kB view details)

Uploaded Source

Built Distributions

fastsweep-0.1.1-cp310-cp310-win_amd64.whl (81.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

fastsweep-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (90.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (70.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fastsweep-0.1.1-cp310-cp310-macosx_10_14_x86_64.whl (76.6 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

fastsweep-0.1.1-cp39-cp39-win_amd64.whl (81.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastsweep-0.1.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (90.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (71.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fastsweep-0.1.1-cp39-cp39-macosx_10_14_x86_64.whl (76.7 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

fastsweep-0.1.1-cp38-cp38-win_amd64.whl (81.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

fastsweep-0.1.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (90.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (70.9 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

fastsweep-0.1.1-cp38-cp38-macosx_10_14_x86_64.whl (76.6 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: fastsweep-0.1.1.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for fastsweep-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8cc3db0c0c9428fdbd316760837b831220efeb5c733b531d65cb2e79d258ffe2
MD5 cca1317587c9541ab83b011ebdf8468d
BLAKE2b-256 0ca7c348ec25b1f95d7ca4a010cb899f7886f4128c3185f16011fe00bc646716

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4c9951bf3a7f326b557b8d84e862196f4dfe1811b4052f1e04179748a523b200
MD5 8aabfe1a1ddbd7978d66b125c05fea20
BLAKE2b-256 f4518a72161b2b10adfb3abda2ac0c93ffe4ea855a5cbd5628b71af8eeccff6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 be1bc1e4e7af1a29cae4dca75f4040d08a4c57ddcbb3650d3b7190ddc68e035f
MD5 710491a230fb55245215923bd719cb05
BLAKE2b-256 e3669acb3a0b0739b04b304a9cf6a2ffa3cfcc17b536059db1436ecf74bdeffd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c4916479b47f348a12b966606deaef0652e573ab5229efac7ecb7268a87fe79
MD5 14cd83373a07d2c1c85663c2518158f9
BLAKE2b-256 f0e9dba03a29a397cbe5e098951734902d6c1588bd6657157f99cc59810b7e19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 80f10f69f3f4d4b3050d4ddf4619c6c69f7255a310006b0730bcd9a74de6506b
MD5 4d85d6a9b668c8536fea2a6ae1c46a87
BLAKE2b-256 36fe5d2229866cbc5a650fdc40de29bbf849548f361ec906854586b221962886

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastsweep-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 81.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for fastsweep-0.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 238a20a14a45ebe1ea88a88f5c8c92524e80968036ef1019f2968c434121cc03
MD5 f77a0defb29b97f50444c949b9aac822
BLAKE2b-256 46c2a386d2cc05fbb91ee23cc5a4929246e052d9a7f40f58e9eec94129925ff0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b02c4551d7065986291fff6e6f400f82baee385f1daa115cfd4b1d73329490bd
MD5 9c44a26af9d572bd72afe2c2e2014cb0
BLAKE2b-256 79fca3e96b1f88d1b8a3eea611c031f87d5c6d0997cb5cd887c03ff0ad1114aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cef8597e9c39b9e1fe0ad3b40cfe9c34a2c2bfdd8581e4e3aa6eefe09f50b4a8
MD5 527940309b60b8a221c4b3a9a26c4d9d
BLAKE2b-256 3baa2653ff7d50cb3c9700a8e25eed6cbe33fa7e2206cd4f4388d161561ab6a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6d16b8751077276c162bd3c438a05cfa7e9c604f02561f351f3adafeba432d09
MD5 940c95c1b678340ae9edabb65c1c1e6b
BLAKE2b-256 dd14c51503a4a8d087bc29934dfce04e56c47a690f60ee6e57b08b0c9f86a227

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastsweep-0.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 81.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for fastsweep-0.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a27c4c35346b87523e285f11efa789e2a70fdbaeb73f359a01c39c17d476933d
MD5 994c5668daa711ed57eeab91cd0ab479
BLAKE2b-256 d7548fe57d8a9976f52a519be3b8a2f5d3e0e48655d33903f9ec449335eb8c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e0cb51f63f4dbe181c3565e47b48c7506b1246783d7ff81ae2de3fee02ebf0e6
MD5 d0cd15422d3dc87c63777428c0958f12
BLAKE2b-256 f57a2ddd2021effff3e0689e97febcc77d5e994a328d6a177ffe2167c85ef7bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c1907638d417d7308bcff269e4b610873612d0135407078a9a6a41e7758a6e8
MD5 0d5b010bd46d7612befd26c3f74e87c1
BLAKE2b-256 c3b9dd4fd514c70f00a4249eb0e1a438179b48aed8f5026c4bb6300dbbd88c5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 cf31df1afe508ea12f383415aa7252d8c197f0546f25e7f51e8f26e2ff558ef4
MD5 e0a81205bff4a8e4676115e743a1d703
BLAKE2b-256 955ce0238332dcc645cf7f4dfb9d9bda45d8f68b16a7b8766d8e9ff40c8dab29

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