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.2.0.tar.gz (676.6 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.2.0-cp313-cp313-win_amd64.whl (23.5 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

trueform-0.2.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.2.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.2.0.tar.gz.

File metadata

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

File hashes

Hashes for trueform-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dfb1835bf738e86a3945a5d611201ab1679d98009796abdc5b909b64cccdcd11
MD5 21d8446c3b62bba451850064bb7640be
BLAKE2b-256 5a13e998db54ecd054447c4deff95a0e113c38d370d5cc360caba95e12ec01de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.2.0-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.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 73d2f71c4d67285569579fa2baafa8eb767694ee3643a75290caecaae17dc75d
MD5 d87c32dcd627296db30099efedc83c2c
BLAKE2b-256 01d9fd7037bf05df02f6e085c9036e59c83030cb35f1184f98fa89998c096584

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 494ab4caf95c3c7644f9fa6f6503f156be67b409978107dbe36bf0e679be858b
MD5 6b916023596730697d5f9483cb1f6177
BLAKE2b-256 fc1aeafa4e1b2ad8c4cfd0b43e4626a8cc229acdae1c5ef7f7652e5986c86bbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 551119b9ca0a43c68ade73395c5c8126aa5365e8550c70d91fb19a5aa54badc7
MD5 931b712a0fa7ac6e5760430eec279022
BLAKE2b-256 83fee746b3a349974c8d0274545c407f2c67a20ad6fb123ef6d629c24016a75e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.2.0-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.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 27da2f6a0e765a015b4963928a60f7a3b1067d2ede0d312329d01c3630fe6a17
MD5 3f00b09cbe6434d6e6430a219e4ad5ce
BLAKE2b-256 0c7b8773a84bdd188f87c4b352bc7505386825c0cb4d23004a540cd53530d9bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 354a9f6ffd147255051e2669d679347a04bc64c689a8e12df910b864a23bbb18
MD5 522c8355b934706b6240f56fdf2a35e1
BLAKE2b-256 42c4668b5cba9f0fe990f181ddcc3a2665f5ff32737c498d007d57835d6f686d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e7de3c17436bafc2bd6327e4cd75bd5849a962ef042c726200efdd20e13c830
MD5 1eb6293eb055e94ad3ff74f73569a243
BLAKE2b-256 32a938b08e5380956c47f32381c0a272418a15d86515c5dd210c130758648990

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.2.0-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.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 95f1f909e05fcc420da1279360ee17e28026b0804105e3901f239fc4541895f0
MD5 ced5ae0f2b358ec82318afa6da43b59c
BLAKE2b-256 b1fcde604672f6c09fca9c521f5f92d8365ed4c03d910a86b4d7d5609a92ec5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8b7833a578799691891c4bf4e66eadc45d90eac03bbc340da4193efc5c90b54
MD5 7d1df21d47f716a5888ce93b51fce4fb
BLAKE2b-256 f5bd23e515634a6a50dd4374e94ff8ddd195f7013bb86d7b5ee3d42e176b99d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0fd47401ad44c1cccf5143aecb7d42b154b3e26a2bb62724bc1667f489d65d20
MD5 a062c7c3d956f73f819805f1fc7aab46
BLAKE2b-256 6bfc9100db2b3665d6a431fbd9f1c593a3edbab270d7ebc7e98fa1362360d73a

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