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

Uploaded CPython 3.13Windows x86-64

trueform-0.3.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.3.0-cp313-cp313-macosx_11_0_arm64.whl (17.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

trueform-0.3.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.3.0-cp312-cp312-macosx_11_0_arm64.whl (17.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

trueform-0.3.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.3.0-cp311-cp311-macosx_11_0_arm64.whl (17.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for trueform-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cfabebc7d5a8d6270609570ce54dc93e1379f035a806e4442ed72d5ab39e8c68
MD5 f321dc6cb0aa006c476f8576f90ad030
BLAKE2b-256 762a3fbf50355d91a8affb5de9c16c4c3c6f4c249c18811cb9c8db7b65b78c80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.3.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.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a141efb99031274d06cf5ba4c8f1186c8cfb33b9ee51db6838f24805b611586f
MD5 f9a3d5d1567a0e7aee9f0974794d49ff
BLAKE2b-256 cf348dca2200042353deb2841c42129fdfe419a386b14b7f538f4227592199c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6cf096fb0edc87e3299b0213a2c68e1107cf5ed6b06090a53254367627626657
MD5 069927f880e5e2cea38b4700040407ef
BLAKE2b-256 19570019175536429bb6abaaf324730c06829497f311b62360150c613ceb4811

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33ee38639437c8fda102d867aee615b6ddac255deebf80a3a698b1ee9dc6ef5d
MD5 712d6713827bcb8ed63666d15048f2a9
BLAKE2b-256 171d03187a0be5a05ddd8d5bf824010d7b347835355bdd0a05959337a16685db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.3.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.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 92b2d765448263a6076db9332c35028c876e3d8425fa1fa3dd0d51eb0feb946d
MD5 984b410cfae6a7799aecfac98a2e45ec
BLAKE2b-256 49dbbb5e3ed80d996bc62bddbe45eb42923ecf789cf2116bd4f7fabca84ae6bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 23287f2c82a3847123e83845d7aeb9687373db2f3319f3cca00d219eac303d9f
MD5 aae6db7b2f4eb7e155ee3311ca203c9f
BLAKE2b-256 2db8186a325b5d9367c0ad8ad81d032cc4fac6115a3658022b8e5b34f8d5564f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce2d493d3bc4be72e2b8108859f3bfae0715a10d1a4a1cd1e389bfda055b2ddb
MD5 31962cb528e4d0b4c21e467a75a4094c
BLAKE2b-256 2961331b48dd2d528f86c989d651c43771deb01f0c320be1deda8e03f0c8831c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trueform-0.3.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.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 41bbfcd0d607e88e5f94e2c4e4f7e8351ab97ca9efe91cd89da3f64e2274ce1e
MD5 b7640ce46e4853736a46e1478ce7e485
BLAKE2b-256 4698e066d51c208cc732b3ccfa700043b4377bd2cd93a7ce23df795e11ff2619

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b4ac11f4fae132ad58ace58c0b85bfebee57f57603a2e563150902134bd74bf4
MD5 c996ac7cf2d9bc59f9caaf12fe66ad8a
BLAKE2b-256 064389d815d98e3608db694add9829c7761e7267794c2336a4a3b37123e95450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for trueform-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ff1a17e19660772e9d8c2be31d6a2cf6e4020bbeab450886b5b076d0d8f68169
MD5 d4e6c9f0c959efa9d660874898f47042
BLAKE2b-256 5746aa191109f5957d82d5d1a689b08fa930f8a5d3461b05a0a217a5840767c4

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