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.1.1.tar.gz (76.0 MB view details)

Uploaded Source

Built Distributions

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

trueform-0.1.1-cp313-cp313-win_amd64.whl (23.5 MB view details)

Uploaded CPython 3.13Windows x86-64

trueform-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (26.5 MB view details)

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

trueform-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (17.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

trueform-0.1.1-cp312-cp312-win_amd64.whl (23.5 MB view details)

Uploaded CPython 3.12Windows x86-64

trueform-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (26.5 MB view details)

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

trueform-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (17.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

trueform-0.1.1-cp311-cp311-win_amd64.whl (23.5 MB view details)

Uploaded CPython 3.11Windows x86-64

trueform-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (26.5 MB view details)

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

trueform-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (17.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: trueform-0.1.1.tar.gz
  • Upload date:
  • Size: 76.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for trueform-0.1.1.tar.gz
Algorithm Hash digest
SHA256 affecdd1d460a17d3dbfc7a7c4683805a18521caf84834df9858c20888330d90
MD5 d49941adef264238cf5551ce089e9a1f
BLAKE2b-256 38e5f66c3f5786eb4a03dc98f8d963d2f6db07c11d34dcd9b88a9137eca71279

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 23.5 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.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9e533f9d61ba1fc461c4c8710780ed5ce064c9c23a525e6b4ba70201982db024
MD5 282bdca76ac82c9486b23abd82ab2ab6
BLAKE2b-256 2f9958cb526b580fc7de3d515e70865488fd659aa1ab3be226fb20176cb43a84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e918828dafb098103455535f915399467b52fe2d6ba7df7a7a4039dcbb0d4066
MD5 66b47e6d8b3b4a83da1fa132a2c2efb7
BLAKE2b-256 3456da8a7efbcfa76d0916100d5d333e2ab57d2c45dfe37407d4387288bf044b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c6ab058ff070d922710b42da0ca9bef845e59213cefb424cdec5c04bf5ac5b09
MD5 7431d35712e627040f3361b8c35f10ba
BLAKE2b-256 ac246c18fca9507f198fcb7dd4119ab1582321809c52b21dd683935f2bca7bda

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 23.5 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.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1367a4c90c3487adffcd94a2ee6d42383821437e830c68305d79fccfd09028fd
MD5 28d9ea8a01e766ed1534418b62d4f0a7
BLAKE2b-256 9011a2b4b3f52af20830affe9af0447cb2f43f5dff8362519fe487a396eca9c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2b594a2a84c7aa21f800ba91c6128c20290301bbb6cfb3b670210af8ae396af
MD5 8ff411563b578e562f985946ee06a8c5
BLAKE2b-256 675eb92df5a9bbe41920255b4b66b0865efb084be474033ef7fa1fe28ffe99d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d71b5c5fa072137eed05587ca523481f34f6c15dd0f2b9c8019e50ec8f3df844
MD5 612c81819c91153761674a1f57baa4d6
BLAKE2b-256 2455096438c808bb485809700d035892fa6b6ed3f27fbe45b0a72af0f1143f11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 23.5 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.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7be057e7a6be300ac6ace19ecd8e17fbbf7e0308ba04000c35b7777a38f63c45
MD5 b2b05dde7cc269a3925b7c33455f7210
BLAKE2b-256 49a597bd1707ee4d8905b70114e98c02d04c827b6124fc3cf0edb20cee904f88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 09052243d894007b2f3fde2ac2214cea6362e8e6d0fd830daec364e679da9aa4
MD5 06aaac5215429952164d924ae3507053
BLAKE2b-256 9552e9258504eaf8c677568c1a9314f0edbd311e1759ebcb9b0e2ee8764b0e36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed2d98bff86a70aac22264f28666e95da1eabf00d1edb4186d05e1f216c9ce9a
MD5 f5c5d00d4d8e2002bf365b56a21d8aea
BLAKE2b-256 d3e2f58f8732962bb75b4b18c2517cc24dd680d4f4d26d728065d6c51b4334a8

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