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.

Mesh booleans, registration, remeshing and queries — 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>
ICP Registration 1M 7.7 ms 93× libigl
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
Decimation (50%) 1M 72 ms 50× CGAL edge_collapse
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.6.0.tar.gz (749.3 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.6.0-cp313-cp313-win_amd64.whl (26.9 MB view details)

Uploaded CPython 3.13Windows x86-64

trueform-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (30.4 MB view details)

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

trueform-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (20.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

trueform-0.6.0-cp312-cp312-win_amd64.whl (26.9 MB view details)

Uploaded CPython 3.12Windows x86-64

trueform-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (30.4 MB view details)

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

trueform-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (20.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

trueform-0.6.0-cp311-cp311-win_amd64.whl (26.9 MB view details)

Uploaded CPython 3.11Windows x86-64

trueform-0.6.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (30.4 MB view details)

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

trueform-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (20.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for trueform-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f7b576cdf500e9e0e3b828adedccd6491e717b02f58b31148a82ae95b8a0d9a6
MD5 db962cb5872867badc219b44a30e2843
BLAKE2b-256 d4fff52d8abeeebce3c218356249fe8c741549fe22af774fc2b4da6c57119958

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 26.9 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.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 db215a09eb49782635622dd2c8627871b9ab57058dc5cbc7d231922a32200898
MD5 e96fe70d5328244a4745261b437041be
BLAKE2b-256 dd8e54cc33a099a39e321251640e8d43d4ffa28827872416ec98af51299bb6fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9c6a19ecda71fc9f899b210eb2e901d6d5cdc0b8f50d7e33444f055e07ef9d58
MD5 0e76cef97323acfa400a74aa70f1db43
BLAKE2b-256 ff0205c6dcbe5ff3e34ce0ce11a0432dc4109db02713864d41c36820461f2d41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 79385d7da1d959310a03e178c0dcd1e0d2cacf0296c7543a35a6a39343ea21ac
MD5 078025d08baf789f5af4c47d653d63c3
BLAKE2b-256 2bab6a62cc5250c96044f41d7331dd860d5ae037876adc7ffb60e5684d42f19c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 26.9 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.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a67e4682d884805f93c1db37ee059bdec5aba93f380da3e840d2c640e4aef951
MD5 5bc6bc7ec9511ba75be9cfb64a958094
BLAKE2b-256 9532db4a75ea0a45d161a1111d2e7fa968aef8dc9dc9515389c8a67f6ed94654

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 238f787eba36fc3c3efd396fbe56e600d4a11f4fc7ce0f9e107491393c4be647
MD5 119b8d7e9f440ce44e69194a98bdbff2
BLAKE2b-256 7445eae89f4072623627e7b1367a96dc47a98c8c567f0761445b8219d5893ed9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cbc3bb89b08d9610990feab28603d7c75b37981830699663434fba1e3e910ef8
MD5 1edd56eb9c048677a04c5101a6e5ca1d
BLAKE2b-256 1698cc6057820f524573404891b3440438752003d3fdc97bdc648cc25771cd45

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 26.9 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.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7fd13f5c6efefd8e33770369ca8be0d20b92a6dca22fdb4fd55adeae5e80e094
MD5 e611a1eb232f9305d537656c635ae23b
BLAKE2b-256 78420b3911aa5727a1633a4b5779a770fc9fe2cb68a2c77ba7d344d701355f93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.6.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5702c161dce30c9ce70221416ed3a8eb2f6c8a12fe33670a7937639254e5e311
MD5 dcfc409138db9af1bc44dc836ca6830c
BLAKE2b-256 e622754f1b36b079af30482f3c6f07eeebf839677605bba863eeb9101ea44336

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46c52fc92703565b4dbb6a62685909e885792d84ffdeb9ec72cd9c95d8e45c82
MD5 5d035197f3864be74f14322ffa9a44b2
BLAKE2b-256 56a1accc248ac839ebdb5772a310ef528348c1f2b1d234499a7a81011d84c829

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