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

Most of the public API lives at the top of 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");

A small number of focused sub-namespaces are also public, when grouping the symbols there reads better than promoting them to tf:::

  • tf::exact:: — precision types used by Cut and CSG: tf::exact::int32, tf::exact::int64.
  • tf::csg:: — the boolean expression algebra: tf::csg::merge, tf::csg::intersection, tf::csg::difference, tf::csg::complement, tf::csg::any_of, tf::csg::all_of, plus tf::csg::expr.

Every other nested namespace — tf::core::, tf::topology::, tf::csg::graph::, etc. — is an implementation detail. Using symbols from there 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, search, neighbor queries, and ray casting.

Topology

Connectivity structures, planar embeddings, and mesh analysis.

Geometry

Mesh generation, normals, smoothing, and point cloud alignment.

Remesh

Simplification, isotropic remeshing, and edge collapse.

Intersect

Mesh intersections, self-intersections, and isocontours.

Cut

Arrangements, booleans, and curve embedding.

CSG

N-form boolean expressions over implicit arrangements.

Clean

Remove duplicates, degenerates, and unreferenced elements.

Reindex

Extract, filter, and reorganize geometric data.

I/O

Read and write STL and OBJ files.