Modules | C++

Overview

Modules, namespaces, and file organization.

trueform is organized into focused modules, each providing tools for a specific aspect of geometric processing. The library is header-only—include what you need and start coding.

File Organization

Include everything with a single header:

#include <trueform/trueform.hpp>

Or include only the modules you need:

#include <trueform/spatial.hpp>
#include <trueform/topology.hpp>

Each function and class lives in its own header file. This enables fine-grained includes when compile time matters:

#include <trueform/spatial/aabb_tree.hpp>
#include <trueform/spatial/distance.hpp>

Aggregate headers list everything a module offers. For example, trueform/spatial.hpp includes all spatial functionality—read it to see what's available.

Namespace

All public API is in the tf:: namespace:

tf::point<float, 3> p{1, 2, 3};
tf::aabb_tree<int, float, 3> tree;
auto mesh = tf::read_stl("model.stl");

Internal namespaces like tf::core::, tf::topology:: etc. are implementation details. Using them directly is undefined behavior—they may change without notice.

Modules

Each module page documents its API with working code snippets.

Core

Primitives, ranges, transformations, queries, buffers, policies, and algorithms.

Spatial

Trees, forms, search, neighbor queries, and ray casting.

Topology

Connectivity structures, planar embeddings, and mesh analysis.

Geometry

Normal computation, mesh generation, and geometric analysis.

Intersect

Mesh intersections, self-intersections, and isocontours.

Cut

Mesh booleans and planar arrangements.

Clean

Remove duplicates, degenerates, and unreferenced elements.

Reindex

Extract, filter, and reorganize geometric data.

I/O

Read and write STL and OBJ files.