The Delaunay triangulation for PyTorch
Project description
Torch Delaunay - The Delaunay triangulation library for PyTorch
This is a fast library for computing Delaunay triangulation of 2-dimensional points.
The implementation is based on a sweep-algorithm, introduced by David Sinclair[^1] and later improved by Volodymyr Agafonkin[^2].
Here is an example of triangulation output produced by Torch Delaunay library for a random set of points:
Installation
The library is distributed as PyPI package, to install the package, execute the following command:
pip install torch_delaunay
You can use the torch_delaunay
library for a fast computation of Delaunay triangulation for
points defined as PyTorch tensors.
Usage
import torch
from torch_delaunay.functional import shull2d
# Compute Delaunay triangulation for randomly-generated 2-dimensional points.
points = torch.rand((100, 2))
simplices = shull2d(simplices)
Benchmarks
Benchmarks are collected on Apple M1 Pro chip with 32 GiB of memory.
Prob. Distribution | Data Type | Samples | Time | CPU | Iterations |
---|---|---|---|---|---|
Uniform | Float64 | 10000 | 4.18 ms | 4.11 ms | 171 |
Uniform | Float64 | 100000 | 49.6 ms | 48.3 ms | 15 |
Uniform | Float64 | 1000000 | 600 ms | 592 ms | 1 |
Uniform | Float32 | 10000 | 4.37 ms | 4.29 ms | 161 |
Uniform | Float32 | 100000 | 47.4 ms | 46.4 ms | 15 |
Uniform | Float32 | 1000000 | 573 ms | 568 ms | 1 |
Normal | Float64 | 10000 | 4.60 ms | 4.49 ms | 156 |
Normal | Float64 | 100000 | 48.5 ms | 47.4 ms | 15 |
Normal | Float64 | 1000000 | 568 ms | 563 ms | 1 |
Normal | Float32 | 10000 | 4.42 ms | 4.33 ms | 165 |
Normal | Float32 | 100000 | 46.5 ms | 45.4 ms | 15 |
Normal | Float32 | 1000000 | 550 ms | 547 ms | 1 |
License
The Torch Delaunay is distributed under GPLv3 license. See the LICENSE file for full license text.
[^1]: David Sinclair - S-hull: a fast radial sweep-hull routine for Delaunay triangulation.
[^2]: Volodymyr Agafonkin - Delaunator: An incredibly fast and robust JavaScript library for Delaunay triangulation of 2D points.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file torch_delaunay-1.0.0-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 137.7 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd41e5865bf6a2012b6e8ad67526fa481cbb35b7dbe10148cbc2a84b1002446e |
|
MD5 | 70cf76ec256aab16625f04cce70ef5e6 |
|
BLAKE2b-256 | a369303adc169bf72dbed39534764a7c6bd6f686dc3137d94b799f79adffab8a |
File details
Details for the file torch_delaunay-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ecffa6dc70c3cd0ed2bedf0af4258d8b4d8781a0ee4696fdba6ade543320b47 |
|
MD5 | 041310515f7a41a1aa4d8e1ac7019628 |
|
BLAKE2b-256 | 928e9d79e64ed822b677308a612294d4a4a34f73eb56349ea42bbdb90b903026 |
File details
Details for the file torch_delaunay-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27aad11486328bd2fdd5f21c731c4b56acc2e50281ee538427e805311d98d9cc |
|
MD5 | ab92aa2daad5b08b9507b2b4b7a56a09 |
|
BLAKE2b-256 | 7b51531ed7e67858a5daf4ad5ad7842b06d5cb1ce3db358afdcf9ba99b99326a |
File details
Details for the file torch_delaunay-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 147.5 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64473d56d285845bed6e1729ae19331dfd79bc3d338d0539aee7556fa65978a0 |
|
MD5 | 60b67bddbcd98e01bf77b0c11f9cdb76 |
|
BLAKE2b-256 | 73945f406ef992cb9faeec72b70435e8ffafd47ffeac40fb4933f7d0e9f89848 |
File details
Details for the file torch_delaunay-1.0.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 137.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fbcab9540eb4ee738df5759682d81fc978f98fdbd3b96f4d88771aef6aaf23c |
|
MD5 | 635c591e2ae690f25ac5809f48cf8714 |
|
BLAKE2b-256 | 29c842032e01fb561e38383d7264b473caf1215da66f014e6b47549fb5b43a8a |
File details
Details for the file torch_delaunay-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf788c9dc9757ea6c5aa669e82184682c04f86671839ff2915139dd30d33d64 |
|
MD5 | ebd8aec6282c8680f87462f44733f945 |
|
BLAKE2b-256 | 53f97717a6c6e90f6d4f513b0007e1b6195848e3d3b66a779ecb7792b6f8adcd |
File details
Details for the file torch_delaunay-1.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb7addff792c935125cef95259c4a19049fb9acb3523fdf1e09e1deda70b2ed8 |
|
MD5 | 5285cb234f6ee2f94a79595120935542 |
|
BLAKE2b-256 | 83aa3984130ddee82d62361936606185ae7dca5a1c71dfe5079bacbf1258eeda |
File details
Details for the file torch_delaunay-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 149.1 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a6abd79a6f5afac3a573ed92e1a10da280126a1f287626319f0b8e33e40fb7b |
|
MD5 | 9293eb8e57274b2ad7053387742ba32f |
|
BLAKE2b-256 | b25875fa372840c8d38b9598ee905996da9a77b6aae14a9eeaf4b65fec4a2091 |
File details
Details for the file torch_delaunay-1.0.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 136.4 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00bbf290cbc9d71ea9ecaf4a5d554196274858d20ed325e0fe208657125be166 |
|
MD5 | c30233b70e4a07830c283d6922956f3a |
|
BLAKE2b-256 | a49c7478c82ecc639cbfe7a9cceca015da9e91a4261bc999b94b7937fb4b084c |
File details
Details for the file torch_delaunay-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7230b7ec29be7c24ed46a57dcd6ae66908cecb0534b8d97d1e4fe163008cba |
|
MD5 | b3b37fcbf5cd5bac29d0728bc2b3fff8 |
|
BLAKE2b-256 | 0c06d74cbbd5ec7eb2e8d0446dfafb22c74dee6dddbd96aaa6f7c3b70dcc34af |
File details
Details for the file torch_delaunay-1.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d0a613ad1563cf4a17b7583545d3986c8657f5af5f34cdc43b300d29cb33730 |
|
MD5 | 03787ceda30bb42b932a995f5ef4e1a2 |
|
BLAKE2b-256 | 7205dd0a79f3c4d776dd44f8ab6f446a5ea8ef01b910a0370630c5d4719097d6 |
File details
Details for the file torch_delaunay-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 147.6 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9411ff05c99999bd01dde94082f6d13ce6d596386561017338e3e802c17edf62 |
|
MD5 | 20cd62284fdce0322244ac39b76fc8ec |
|
BLAKE2b-256 | b3dc12a03e0636e859c858dc3a6fc492375038e7867aa9076bf80d3df519956f |
File details
Details for the file torch_delaunay-1.0.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 136.2 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66374e742e4b638f47d8f2f51eb3468f310814f4d1ea784a0231836bc7dcac78 |
|
MD5 | 96158091e3d58c2a99be64491094c3e4 |
|
BLAKE2b-256 | fd56a7f9a2d676be81164e37327bd5468b34b469459d5fd6d73c0952709b5004 |
File details
Details for the file torch_delaunay-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e02253790cbff18e25df78533db24cbe890edcdc8663d44868cac623b86d53c |
|
MD5 | d3fcff8eebb8793aa01f14804885812e |
|
BLAKE2b-256 | cb180b758c9d19136adf947c67b4333d2964c08fdf72b993e77dd4695fd615f6 |
File details
Details for the file torch_delaunay-1.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a65fe6c8f0885434b09c26d094d3fc2647b9aa770e3a0a70a333c3fc5ca0a4 |
|
MD5 | 326f3109408616759f9b2544bf677ae1 |
|
BLAKE2b-256 | 614a60e079a6eea35cfc6fbd6636a7e90262db815729fd04ae11b1013425d34c |
File details
Details for the file torch_delaunay-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: torch_delaunay-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 147.7 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 478a885f713683bfb479ef14c611021d2eb6752a591bc76e19d5d4284a5216b1 |
|
MD5 | 9294ff41038778bb044cf09ece07c458 |
|
BLAKE2b-256 | 0dff0b04da3d368cbdafef6c2934f856480319b05775828144eb0eab9df3f4a5 |