Skip to main content

Natural Neighbor Interpolation in 3D

PyPI - Version

This is a Python package for 3D natural neighbor interpolation (Sibson interpolation).

Natural neighbor interpolation is a form of scattered data interpolation, where you have a set of sample values of a function at arbitrary locations in 3D space (let's call the locations keys), and you want to interpolate the function value at other points (let's call them queries).

Specifically, in natural neighbor interpolation, the interpolated value is a weighted average of the function values of the query point's "natural neighbors". The natural neighbors of a query point are those vertices which, if we were to add the query point to the data, would have Voronoi cells sharing a face with the query point's Voronoi cell. The weights are proportional to the volume "stolen" from the neighbor's Voronoi cell upon the query point's insertion.

The Delaunay tetrahedralization is built on Ross Hemsley's interpolate3d (incremental Bowyer-Watson insertion with flip-based convexity repair and Shewchuk's robust geometric predicates).

The interpolation itself is a from-scratch insertion-free algorithm: instead of inserting each query point into the mesh and removing it (as in Hemsley's original), it finds the Bowyer-Watson cavity via read-only BFS on the existing mesh and computes the stolen Voronoi volumes geometrically from circumcenters. This means the mesh is never modified during queries, so a single shared mesh serves all threads.

Other changes from the original:

  • OpenMP parallelization with a single shared mesh (no per-thread mesh copies)
  • Morton-order (Z-order) spatial sorting of query points for cache locality
  • Contiguous packed simplex array for cache-friendly BFS traversal
  • k-d tree for fast initial simplex location
  • Sibson coordinates (weights) returned directly as a sparse matrix

Installation

natinterp3d is available on PyPI:

pip install natinterp3d

Usage

Simplest is to call natinterp3d.interpolate(queries, keys, values) or natinterp3d.get_weights(queries, keys):

import natinterp3d
import numpy as np

# The positions of the data points where the function values are known
keys = np.array([[x1, y1, z1], [x2, y2, z2], ...])

# The values can also be a 2D array of shape (N, values_dim) with D dimensional vectors as values at each data point
values = np.array([v1, v2, v3, ...])  

# The positions where we want to interpolate the function values
queries = np.array([[qx1, qy1, qz1], [qx2, qy2, qz2], ...])

# Returns either [num_queries] or [num_queries, values_dim], the array of interpolated values
interpolated_values = natinterp3d.interpolate(queries, keys, values)

# or get the interpolation weights as a sparse matrix of size [num_queries, num_keys] (scipy.sparse.csr_matrix)
weights = natinterp3d.get_weights(queries, keys)

For more control, e.g., if you want to interpolate queries and/or values on the same key positions, you can use the natinterp3d.Interpolator class as:

import natinterp3d

keys = np.array([[x1, y1, z1], [x2, y2, z2], ...])
interpolator = natinterp3d.Interpolator(keys)

values = np.array([v1, v2, v3, ...])  # or a 2D array of shape (N, values_dim)
queries = np.array([[qx1, qy1, qz1], [qx2, qy2, qz2], ...])
interpolated_values = interpolator.interpolate(queries, values)

# or:
weights = interpolator.get_weights(queries)

Multithreaded computation is automatically enabled. To customize, use the argument parallel=True/False and num_threads in interpolate or get_weights. With num_threads=None (default), the number of threads is automatically determined based on the available CPU cores.

License

GNU GPL v3

Metadata

Release files for natinterp3d 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for natinterp3d 1.0.9
File Size Uploaded Provenance Actions
natinterp3d-1.0.9.tar.gz 137.9 kB With provenance Details for natinterp3d-1.0.9.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for natinterp3d 1.0.9
File Actions
natinterp3d-1.0.9-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for natinterp3d-1.0.9-cp313-cp313-win_amd64.whl
natinterp3d-1.0.9-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for natinterp3d-1.0.9-cp313-cp313-manylinux_2_28_x86_64.whl
natinterp3d-1.0.9-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for natinterp3d-1.0.9-cp312-cp312-win_amd64.whl
natinterp3d-1.0.9-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for natinterp3d-1.0.9-cp312-cp312-manylinux_2_28_x86_64.whl
natinterp3d-1.0.9-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for natinterp3d-1.0.9-cp311-cp311-win_amd64.whl
natinterp3d-1.0.9-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for natinterp3d-1.0.9-cp311-cp311-manylinux_2_28_x86_64.whl
natinterp3d-1.0.9-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for natinterp3d-1.0.9-cp310-cp310-win_amd64.whl
natinterp3d-1.0.9-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for natinterp3d-1.0.9-cp310-cp310-manylinux_2_28_x86_64.whl

Total release size: 3.9 MB

Release files / natinterp3d-1.0.9.tar.gz

Download URL natinterp3d-1.0.9.tar.gz
Size 137.9 kB
Tags Source
SHA-256 checksum
How to use checksums
52673d883bcf532ed8e7b41bdf0d42ff28b0dc09245920e5955ae1f6e19a4a23
BLAKE2b-256 checksum
How to use checksums
29edf61f4f6c7e062c5f26ed5b173f1d94af6c1a7427a4f7bc9d7ddcdb4dd645
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp313-cp313-win_amd64.whl

Download URL natinterp3d-1.0.9-cp313-cp313-win_amd64.whl
Size 144.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e71fd3530786599905dfa8a94ea9c04a257b9de30de90a716fa5b7d22be838e0
BLAKE2b-256 checksum
How to use checksums
0662d528c392f05fc27be87f432aa3aa02baa081d48bc8faf16e11e0ea314679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL natinterp3d-1.0.9-cp313-cp313-manylinux_2_28_x86_64.whl
Size 788.1 kB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b6afba53c3b57afd7d2d1a9e21c51d24ac55debe0ddc1dc0e2a44c2a58f72845
BLAKE2b-256 checksum
How to use checksums
4ec1043b31487e151fb76fd71abf77c0219aa333a4b44b701f28e40be1ac539f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp312-cp312-win_amd64.whl

Download URL natinterp3d-1.0.9-cp312-cp312-win_amd64.whl
Size 145.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
85ebf65264b42fd6a37ff9288ffff8b255c6cf1a19868834989075fa89287698
BLAKE2b-256 checksum
How to use checksums
b92d1e2d25129f31ce72da29cecde5030c266b4586747e9f576f6ef5c38c4141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL natinterp3d-1.0.9-cp312-cp312-manylinux_2_28_x86_64.whl
Size 796.0 kB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a31b66a0f45767a1991f373cca749fc68f337bdafdbab89f2c68b5d65e853aec
BLAKE2b-256 checksum
How to use checksums
f27803e6f0a4f03c7877ab2e32f8b3b4396cfacee9e09103cf90be830ed70eb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp311-cp311-win_amd64.whl

Download URL natinterp3d-1.0.9-cp311-cp311-win_amd64.whl
Size 145.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
dc3ccd249be2c1e72fecf02b4277a96d6e5efe2a1e282472a89446145a3424bf
BLAKE2b-256 checksum
How to use checksums
7981c4edc38e811997526f9eb1ea98d11d866d04719eff995172445555012eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL natinterp3d-1.0.9-cp311-cp311-manylinux_2_28_x86_64.whl
Size 783.9 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
55a0538753046b89f57b9a430aa7e3a6d299ab2858f95419a9b2fb1181002f3a
BLAKE2b-256 checksum
How to use checksums
76f6150a7d47736e2307e6698dda02a13685a2bac8bdb0631e60609c7856fd16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp310-cp310-win_amd64.whl

Download URL natinterp3d-1.0.9-cp310-cp310-win_amd64.whl
Size 145.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
da1b9fcf93c2c26b599d689d5afb22bb59c76d6479a4e5f17f6f9490ead45514
BLAKE2b-256 checksum
How to use checksums
a8c16a70e2881fdfbd6ac0aba6a2a47e6ab9e07139afef8a572631d42ef14022
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Release files / natinterp3d-1.0.9-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL natinterp3d-1.0.9-cp310-cp310-manylinux_2_28_x86_64.whl
Size 775.6 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a175638d18fb9eeffd0a6d009d3b7ccb42c936ef4da0ee3f86f69aad0d02ff78
BLAKE2b-256 checksum
How to use checksums
02e4cd2d2317640ebb550d2c0d20adc03d7a844ca9f821d0906b827da67dc573
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

Security for natinterp3d 1.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for natinterp3d-1.0.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page