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.

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

Uploaded Source

Built Distributions

fastsweep-0.1.0-cp310-cp310-win_amd64.whl (80.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

fastsweep-0.1.0-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.0-cp310-cp310-macosx_11_0_arm64.whl (70.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fastsweep-0.1.0-cp310-cp310-macosx_10_14_x86_64.whl (76.5 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

fastsweep-0.1.0-cp39-cp39-win_amd64.whl (80.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

fastsweep-0.1.0-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.0-cp39-cp39-macosx_11_0_arm64.whl (71.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fastsweep-0.1.0-cp39-cp39-macosx_10_14_x86_64.whl (76.6 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

fastsweep-0.1.0-cp38-cp38-win_amd64.whl (80.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

fastsweep-0.1.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (90.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

fastsweep-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (70.8 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

fastsweep-0.1.0-cp38-cp38-macosx_10_14_x86_64.whl (76.5 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fastsweep-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6d089d50a04155081222e2d761b6e310d124b4b53213b26ac532e6a78854bbf6
MD5 d09d73e9b73968a8693dd7c38ab535db
BLAKE2b-256 b218f993388642b065f4ac5f3174686ea6a2971b90aafd6b7b97343ac790f25a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 016cbf179da11374a3f33b12559822e971d5665bf7829fc61c622edbd482abb8
MD5 fdf18a247069fa4ec0a44eac14a96a28
BLAKE2b-256 90a94cd8ea556cc3363b82caede4ffe7b10128adb4b8624047444811eedc521e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8b83aca4e671f50c1c3a3035cff4582872ef4fab965064f4b653fceb5b793ce5
MD5 f825f1b7a84ab905d9ed79830a198cd7
BLAKE2b-256 2c01e093d0dba1849c6c3d73c9e100717a971c22313d14876d8c817967b871df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14aeeb17530fd0278dbde3037007592122ab7cd39a2a82290af950fec9b490ee
MD5 abe444c23c8a93e454c005afdc3f17dd
BLAKE2b-256 d657cc7819a4ba282a32d536ee38a9041b0e0306575989ab2f77819386f4f2d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3e1f7f3c63ef1f82efd78a498abf099a9ef13013cec314ca32bafbe0a0b40630
MD5 886da167fbc037024cf92c2e16f4d64f
BLAKE2b-256 6ab9a2210d8076c0bfaa45ee856f720b8de598df079b4902e60db55026e9a23a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastsweep-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f97c78b420e47f7abe456426e61c089f98c4629c0ab5a28f2ba85cfd0360c1a1
MD5 89b0e20dbcb14b060f3799505adb17aa
BLAKE2b-256 25a4640cd5727a4bb2bc388b6133aa69b1f4eb0284a3b14b0260b30bea5df010

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f1e1867a641aba0218561fe5a50dd387d20eb645347b3b82a3fb740b93ae9870
MD5 8fa138ffbdaf4c1b21a0f1795d20f168
BLAKE2b-256 6900d1212f92f0c3d3a6675bc806b3892ec36ffb5fcaac2d60b0c20e44ad1ac8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65f8e0351096b1927f5712a37f439c08b4dc3bc86f9374207d6bc59ff1f8ae9a
MD5 2274195793a60350dc7ebd9df2ba98cc
BLAKE2b-256 1b16b46003a1d5b4e319a27b1458a9f3778665f35a2617bf2b8b1432a3e0894e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 62cdae5ee15e0df900eb5eba8672f4babe1905ab0a6fe5ad893d2a3681f8a970
MD5 056acc8d6d7946d618166d9845ec8500
BLAKE2b-256 950b344b2779f520dc90c40614d5f183c33ccad5228937d36544d32b74fddba5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastsweep-0.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c9c1f8192956420c6bb096192ce6a69d7f9f1d8869b15bb40484f011a1715c0f
MD5 68bba6cdbfcd5055af653913eedcc517
BLAKE2b-256 b89243d77cf07170e6dcdbb583b06d68f99cc8c7a4e87ce840e0509acb82ec6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 706ba353e576367e12d5982ee79348de2b5adf6c1ffca2d6e47566c1f70071f9
MD5 8c77606884587f39223e0c314799dec4
BLAKE2b-256 40b98f5d81b244ee5c09359a17f544af00c1701be9e5e21a223e2a7b2fd04466

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5764d9eaa2bdb0f63e9e3ebaa958412fa51460de24e962934c07488c4a95259
MD5 85f243ec8934c70a3716a07baa40f2e8
BLAKE2b-256 ac2501272cf3f8c44c1972b97e49a0232c9bcd926befb48ac328e728239daf3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsweep-0.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e606eb4437e610295bb3584b1984c83e52251bcb84ec5406d1316a69b21f436a
MD5 ded98da1fe19daee1d1f93487a5cca09
BLAKE2b-256 c06e3df10faa1c622daeb77bf82e77b6f9e3d4edd55113a7d33c8622c3eff79a

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