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.0.tar.gz (75.5 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.0-cp313-cp313-win_amd64.whl (23.4 MB view details)

Uploaded CPython 3.13Windows x86-64

trueform-0.1.0-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.0-cp313-cp313-macosx_11_0_arm64.whl (17.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

trueform-0.1.0-cp312-cp312-win_amd64.whl (23.4 MB view details)

Uploaded CPython 3.12Windows x86-64

trueform-0.1.0-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.0-cp312-cp312-macosx_11_0_arm64.whl (17.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

trueform-0.1.0-cp311-cp311-win_amd64.whl (23.4 MB view details)

Uploaded CPython 3.11Windows x86-64

trueform-0.1.0-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.0-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.0.tar.gz.

File metadata

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

File hashes

Hashes for trueform-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4224dac6502b6336440306de188f5ac4f7a6c83473d0274d9b45a4aa8bcdb46a
MD5 17304aff2d7692cfb20a217032da462c
BLAKE2b-256 aa7ff6b861a0480fad97c2a3276e26a614f62a9811981235e24fd08dee4f2277

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 23.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.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dab9d9780b178c85793345af530d240827e185bc7ce9835a96387e26c2291ff0
MD5 2c2ce145db39e36f65c0a53edc4bb3a4
BLAKE2b-256 3f4699ff19d0cfdd4cbe2e85767924f6539f11804772b9e6ee7e92e682615fad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f400c69410fb34cb2cd0e23f11499671bfd39783fae74d65e6a7ccb3efe0913
MD5 7f45c18e1ee41ee8c637ad9e35262fbd
BLAKE2b-256 83a5ee14f5987e07fc4f6241918da3bd5c3a49265401cc01a25b33e076218e2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 79c925a07280a8a3877be7665830859e02dc3c3264c063f8d01fa612091892f0
MD5 15ad42f3c7c299884472ab3f2b5e2dae
BLAKE2b-256 51a0e524365d8e42c80d4e4fddbc1f9c6107b5f0af4d10866d72874f7546cad2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 23.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.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 54d89c592a5c6dde7e3650fc288e6deada155e5486b54f135a48d6ca8b50fde4
MD5 060b29ff401740dda3999c981e883a47
BLAKE2b-256 fe121a378964ee10749da27e155ca4e2805108063eb4f8a1fe088de65c7a0d9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e759c88305da4a89e967df459f98a4bc49cee464fdd4bf1269f4749a9ca250f
MD5 ca76fe8eb1983e928bdcf5d8d7591663
BLAKE2b-256 f9f3b1ffce9dacd558391ae54c5a23959ec5b7fa487b7069176ae9514e827cd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d0280c440bc0c2292e28f869882ed3b7a0a80b30f5f9d2d27693e6326adfd01
MD5 d61a621217b23907f6ebf110bef2abc0
BLAKE2b-256 0471fff45326526e416928c36555d64a98147b4c1a74e031a923591670b7df26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 23.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.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a20f42291bf568d581725965c672c73c93886cba4eed6de239b4e490080229d5
MD5 0ff6733a50f2b0bdae349c04ea18f15d
BLAKE2b-256 7010a97dda3a506b7c02d62447f5ea88252d4a69c8f3ea26c56c43f9c1c86f16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 acb4c1dfced14508389dafc730e750e872a43bdac972211e9611f0a7825eefc6
MD5 829593f6afb5a45ef31c96d40e925a33
BLAKE2b-256 99c79381277d6e86cc69cdbb1e7de070b875ea721d72517108dc90e594e9c4d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecfc02c0b5ca3799ddc54e5f64faebbca610155c6e2f471e9013f663ee13d1f2
MD5 8e7584983ff92290d57112167149934c
BLAKE2b-256 b81254b2932283290611632d0397b5f70b9efa7ba9c8abafdb6379469a35d24a

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