Skip to main content

Real-time geometric processing on NumPy arrays. Easy to use, robust on real-world data.

Project description

trueform

Real-time geometric processing on NumPy arrays. Easy to use, robust on real-world data.

Spatial queries, mesh booleans, isocontours, topology — at interactive speed on million-polygon meshes. Robust to non-manifold flaps, inconsistent winding, and pipeline artifacts. NumPy in, NumPy out.

Documentation | Live Examples

Installation

pip install trueform

Quick Tour

import numpy as np
import trueform as tf

# NumPy arrays in
points = np.array([
    [0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]
], dtype=np.float32)
faces = np.array([
    [0, 1, 2], [0, 2, 3], [0, 3, 1], [1, 3, 2]
], dtype=np.int32)

mesh = tf.Mesh(faces, points)

# Or read from file
mesh = tf.read_stl("model.stl")

Boolean operations:

(result_faces, result_points), labels = tf.boolean_union(mesh0, mesh1)

# With intersection curves
(result_faces, result_points), labels, (paths, curve_points) = tf.boolean_union(
    mesh0, mesh1, return_curves=True
)

Spatial queries:

static_mesh = tf.Mesh(faces0, points0)
dynamic_mesh = tf.Mesh(faces1, points1)
dynamic_mesh.transformation = rotation_matrix

does_intersect = tf.intersects(static_mesh, dynamic_mesh)
distance = tf.distance(static_mesh, dynamic_mesh)
(id0, id1), (dist2, pt0, pt1) = tf.neighbor_search(static_mesh, dynamic_mesh)
neighbors = tf.neighbor_search(dynamic_mesh, static_mesh.points[0], k=10)
for idx, dist2, pt in neighbors:
    pass

Full documentation covers mesh analysis, topology, isocontours, curvature, and more.

Examples

Run examples locally:

git clone https://github.com/polydera/trueform.git
cd trueform/python/examples
pip install vtk  # for interactive examples
python vtk/collision.py mesh.stl

Blender Integration

Cached meshes with automatic dirty-tracking for live preview add-ons. See Blender docs.

Benchmarks

Operation Input Time Speedup Baseline
Boolean Union 2 × 1M 28 ms 84× CGAL Simple_cartesian<double>
Mesh–Mesh Curves 2 × 1M 7 ms 233× CGAL Simple_cartesian<double>
Self-Intersection 1M 78 ms 37× libigl EPECK (GMP/MPFR)
Isocontours 1M, 16 cuts 3.8 ms 38× VTK vtkContourFilter
Connected Components 1M 15 ms 10× CGAL
Boundary Paths 1M 12 ms 11× CGAL
k-NN Query 500K 1.7 µs nanoflann k-d tree
Mesh–Mesh Distance 2 × 1M 0.2 ms Coal (FCL) OBBRSS
Principal Curvatures 1M 25 ms 55× libigl

Apple M4 Max, 16 threads, Clang -O3. Full methodology

License

Dual-licensed: PolyForm Noncommercial 1.0.0 for noncommercial use, commercial licenses available.

Contributing

See CONTRIBUTING.md and open issues.

Citation

@software{trueform2025,
    title={trueform: Real-time Geometric Processing},
    author={Sajovic, {\v{Z}}iga and {et al.}},
    organization={XLAB d.o.o.},
    year={2025},
    url={https://github.com/polydera/trueform}
}

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

trueform-0.4.0.tar.gz (691.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

trueform-0.4.0-cp313-cp313-win_amd64.whl (23.6 MB view details)

Uploaded CPython 3.13Windows x86-64

trueform-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (26.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

trueform-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (17.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

trueform-0.4.0-cp312-cp312-win_amd64.whl (23.6 MB view details)

Uploaded CPython 3.12Windows x86-64

trueform-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (26.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

trueform-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (17.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

trueform-0.4.0-cp311-cp311-win_amd64.whl (23.6 MB view details)

Uploaded CPython 3.11Windows x86-64

trueform-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (26.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

trueform-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (17.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file trueform-0.4.0.tar.gz.

File metadata

  • Download URL: trueform-0.4.0.tar.gz
  • Upload date:
  • Size: 691.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trueform-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c2e9d743d5fd25bb6168777f7c20ed7bff578a5259f12889eba93e69a299771b
MD5 5c4ee23e1e5f846bc7b9d46593b9f802
BLAKE2b-256 18ca12ac4bd69bc6f7b35efcbde17b7c7faf9dfcfafecbeb1f417f102a3ce456

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: trueform-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 23.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trueform-0.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8312ead12f5aa74edcd9a2a86ed25286c072990250e8d11f1d318bb3cfba0781
MD5 12c7c144d93df0beb0f90e950eb138fd
BLAKE2b-256 0984effda6aa3c6734d8c3912f971ecf5a6cc9845d70df266ba35759dff19232

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for trueform-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 50ff0570311d76e27a48defc17ee1db1e357591d4564b0c01d5300b70f1b4cb7
MD5 ba92f0b7f2d092c4b0e97fc0b44b77cf
BLAKE2b-256 8952d2ee2357087c06e655f62ef42f4d922a542ab51a03d7730414168f74c3fc

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trueform-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 542c9c2af19a3512cae8e750aba53b38de124fc97a7169181e680f09da7fb4f3
MD5 cd2f396dd34e0c7e59122743f5b221b9
BLAKE2b-256 7228a7562b0727d06755af90060b924534fa0acd759464f3f0cff82959ea5711

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: trueform-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 23.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trueform-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9fd99473dc5012e30c0a2296692545fead76eaff2093ee74ef9fba96d82df513
MD5 5b0941232aa55de18a7de15553839d3b
BLAKE2b-256 ffad23d5d82291f7e35d4317272c9f18139e6f29644f83ffedd6da5ccc77258f

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for trueform-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1dabb66eeab0fbe49e4c9c2334f319af545aba62d3a72f977b89257b88ee5171
MD5 e394c21b60bf337376a651f504dd484d
BLAKE2b-256 633b68fad9941d1c76a4dd041588791507f6acd44f002f31dfa82a5c0e351f77

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trueform-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 25db78398101cbfc2ad103c7f347cd42071645c8c32ae32882d390e32f71d340
MD5 cea8ade0b6883c34deed68f1a6d210df
BLAKE2b-256 e5be889ba4c8240b3b79548323a2db584114075ff59c2f438542a0916024d973

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: trueform-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 23.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trueform-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 eed1190fe681adae509c56c3d100c2a80c5511d0d3fafc4f67ba15d9e8442d82
MD5 393001f9f1e1e9c5bec3fecd72c1b657
BLAKE2b-256 297b427d1f45952bb9212ef5dd2add5d7c14bb9404c2fc4370be5820e75db81d

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for trueform-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eaaafd2e9e64af8780f3c4b01e8f43edcaf760fc1f6f5d7f84ae43f209a1bee3
MD5 6c74f22706d98f9aa0dfb507626b20a9
BLAKE2b-256 63eeb769ba4d0c4f86e9b37e08730d7283eb307f217cca72510a8b2bf325814f

See more details on using hashes here.

File details

Details for the file trueform-0.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for trueform-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 86ec19c6d5a1c7dac282d763baf0c164477b25f4f30df1eb72f3c25897019d34
MD5 58d75f8ea8125bf3163e3aa62a186964
BLAKE2b-256 08bd3c7c0e96525b79de9f59ae3cbc0d0240f6491bc53404e31f405bce20b852

See more details on using hashes here.

Supported by

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