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>
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
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.5.0.tar.gz (710.0 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.5.0-cp313-cp313-win_amd64.whl (26.4 MB view details)

Uploaded CPython 3.13Windows x86-64

trueform-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (29.8 MB view details)

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

trueform-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (19.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

trueform-0.5.0-cp312-cp312-win_amd64.whl (26.4 MB view details)

Uploaded CPython 3.12Windows x86-64

trueform-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (29.8 MB view details)

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

trueform-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (19.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

trueform-0.5.0-cp311-cp311-win_amd64.whl (26.4 MB view details)

Uploaded CPython 3.11Windows x86-64

trueform-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (29.8 MB view details)

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

trueform-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (19.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for trueform-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1c3448d386209d74fde1092f495e4fe0a93055ae6ef347a841ab27262a5356a5
MD5 c9ea221e6b186bf43fb800169b9af9d7
BLAKE2b-256 6ac7e7d4bb6de4314f1f61a7e022f85f67caab62d7330431d27b53e5b30d540d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 26.4 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.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 69d0bf4ec041225f88f553e9adc24bdc1f6aaf4742fe1fb20c1350b317f1f0a1
MD5 fdcdc60d5a27b36416915ece4b13eec6
BLAKE2b-256 bb66cab2c35a8d5b5165978e5fe67ffaa30731ae6efe43eeedce64fb84e014a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 52746a4ec37f66c4f3875731b89e79946e808747673bd2a3d9827152fe1da7a2
MD5 54f13ec32e40692a889016f00462415c
BLAKE2b-256 c0ba88d87a0b5c5f35d30452d8417fa336204bad8cbaa48ed24048cf208ca4fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf52b671e06e2f76a5a1e672c718cfa3669ad5881cd0996b0cc22cee60ee4e51
MD5 529724f9d7668cff4916e27977ee4e70
BLAKE2b-256 4f13c50e1ce922276a449452d233c3bbb885bc05bf30473f66ad04961f9ab601

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 26.4 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.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 53ac89099b6c13069207de87dd1710e5e9223c6fa5629c5fec1f77f956e358f8
MD5 6fd0e5ed5830fef597fedf625ffe957b
BLAKE2b-256 bbd92d676e8285dc0bdcb10243fe16bdb6aa0ef7c9dada06cd4e5341cebb076c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2539f3e7efb8ad8afcdb4a10576d02b0766280abf55820a353152d487dcd7341
MD5 b0257d77cd2bf53b775bf5a1c28668e6
BLAKE2b-256 cca50b9eaa0e6c0d85c7ef6bb02319565d8495164abb6ddc3662dfd8d3c12c22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d064c166857f0066998ef1761ee8d97da02f7f3c5ec11afb8219ea72e9c53aa8
MD5 b56bb63828faa6716f23b36d373e057a
BLAKE2b-256 5f5ce2b7ae6db631075634249f4dacdafef6e98b6607505733497c9914f2d54a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 26.4 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.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bdf95df7e68407e1f9eeb957f7741cea479018148ab02f3a3e8758bcc3c3d00a
MD5 1677a7b375621c3e6df63f757b52c57a
BLAKE2b-256 894ab70aac6835b04b756849ad847ff3a6170bff09bef7da1a30381c83511e22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4598c382f9b8e8bd267276c6d64918923efbd7fef77dd1dd091828291ef3134f
MD5 66b1e27df6e135d9f0e3d0fef14710dc
BLAKE2b-256 dca88df33d3c983ee0a88971b744a10fb7c4c31a537e592191d7fa528f653a33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd10cb5c2d8e0f81dc29723b281c036464e2e001f46516711f0e55907e21d70d
MD5 419f8f031e0944296c104d941615e3dc
BLAKE2b-256 5dfd09e06392169c0a0984520ef996337f4051fd9d58dc126cd8614d65107d5e

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