Skip to content

API reference

Every function is reached as od.<module>.<function> after import ordito as od. Each module loads on first use, so import ordito stays cheap however many modules exist. The pages below are generated from the docstrings. Each opens with a table of the module's functions; each function then lists its parameters (array shapes first), what it returns, what it raises, related functions, and an example. The examples run in the test suite on both CPU and CUDA, and every value they print is checked, so the output shown is the output you will get.

Three conventions hold across the whole reference (see Concepts for the reasons):

  • A mesh is two arrays: vertices, a wp.array[wp.vec3] of shape (n_vertices,), and faces, a flat wp.array[wp.int32] of shape (3 * n_faces,). A per-face result has shape (n_faces,), and a per-vertex result has shape (n_vertices,).
  • Outputs live on the device of the inputs. Pass inputs that are all on the same device; mixing devices raises RuntimeError.
  • A variable-length result per item (one boundary loop, one neighbour list) comes back packed as (values, offsets), where item i is values[offsets[i]:offsets[i + 1]]. A plain-list variant exists alongside where it is convenient (boundary_loops next to boundary_loops_with_offsets).

Find a function by task

I want to... Use
Create and load
make a primitive (box, sphere, cylinder, torus...) creation: box, icosphere, uv_sphere, cylinder, torus, grid
revolve, extrude or sweep a profile revolve, extrude_polygon, sweep_polygon
load a mesh file (OBJ, PLY, STL, ...) io.load_mesh_data, io.load_mesh (needs ordito[io])
work with an object that caches derived quantities Trimesh
Inspect
face normals, areas, angles, centroids triangles.face_normals_and_areas, face_angles, face_centroids
vertex normals normals.vertex_normals
volume, centre of mass, inertia, Euler characteristic measures: volume, moments, euler_characteristic
is it watertight / manifold / orientable / self-intersecting? validation: is_watertight, is_edge_manifold, is_orientable, is_self_intersecting
are two meshes the same up to vertex and face numbering? comparison.meshes_allclose, triangles_allclose, faces_equal
unique edges and their lengths edges.edges_unique, edges_unique_length
boundary edges and hole rims boundary.boundary_edges, boundary_loops
neighbouring faces and connected components adjacency.face_adjacency, face_connected_component_labels, combine.split
curvature curvature: vertex_defects, discrete_gaussian_curvature, discrete_mean_curvature, principal_curvature, mls_principal_curvature
bounding boxes bounds.aabb, bounds.oriented_bounding_box
triangle quality triangles.face_quality
Repair
make a broken mesh a closed solid in one call repair.make_solid
merge duplicate vertices, drop degenerate or unused elements repair.remove_duplicated_vertices, remove_degenerate_faces, remove_unreferenced_vertices
fix needle and cap triangles within a deviation bound repair.fix_degeneracies, collapse_small_triangles
fix the winding, or point normals outward repair.make_winding_consistent, make_normals_outward
remove small floating pieces repair.remove_small_components
fill holes holes: fill_small, fill_min_weight, fill_smooth
remove self-intersections repair.fix_self_intersections
Edit
move, rotate, scale, mirror transform: transform_mesh, rotation_matrix
combine meshes, or split into parts combine.concatenate, combine.split
union, intersection or difference of two solids boolean: union, intersection, difference
the same for many solids at once union_all, intersection_all, difference_all
cut a solid by another solid or a plane, capped split_by_mesh, split_by_plane, trim_by_plane
triangulate a planar region with holes polyline.triangulate_polygons, triangulate_polygons_from_offsets
keep a subset of faces selection.submesh_from_face_mask
grow a selection, or measure hops from it selection.expand_vertex_mask, vertex_hop_distance
carry colours, UVs, labels or any per-vertex or per-face field through an edit return_provenance=True and interpolation.Provenance
turn per-corner values (a UV atlas, hard normals) into per-vertex ones, or weld them back repair.split_vertices_by_corner_values, remove_duplicated_vertices with vertex_values
read a per-vertex field at surface samples or query hits interpolation.interpolate_barycentric, sample.sample_surface with return_barycentric=True
remesh to uniform edge lengths remesh.isotropic_remesh
simplify (decimate) remesh.quadric_decimate, cluster_decimate
drop a closed mesh's redundant vertices within a tolerance remesh.simplify
subdivide remesh.subdivide, subdivide_loop, subdivide_to_size
refine a solid onto a smooth surface through its vertices, keeping creases remesh.subdivide_smooth
smooth smoothing: filter_taubin, filter_laplacian, filter_implicit_fairing
offset or thicken a surface levelset.offset_mesh, levelset.thicken_mesh
cut with a plane intersection.slice_mesh_with_plane, split_mesh_with_plane, mesh_with_plane
extract an isosurface levelset.marching_cubes, intersection.marching_triangles
a solid from a signed distance function levelset.function_level_set
Query
closest point on a surface, signed distance proximity.closest_point_on_mesh, signed_distance_on_mesh, winding_number
cast rays ray.intersects_first, intersects_location, first_hits
every crossing of segments with a closed surface, exact at edges and vertices ray.segment_hits
test which points are inside ray.contains_points
nearest neighbours, radius search neighbors.query_nearest, query_ball
sum or average a value over each point's neighbourhood without listing the neighbours neighbors.query_ball_sum
one-to-one matches between two clouds (mutual nearest neighbours) neighbors.mutual_nearest
Chamfer and Hausdorff distances metrics: chamfer_mesh_to_mesh, hausdorff_mesh_to_mesh
intersection curve of two meshes, colliding faces intersection.mesh_with_mesh, collision_masks
Point clouds
sample points on a surface sample.sample_surface, sample_surface_poisson_disk
sample the surface inside a ball sample.sample_surface_in_ball
estimate normals points.estimate_normals
orient or smooth normals points.orient_normals (spanning-tree propagation), smooth_normals
smooth a point cloud points.smooth_points (Laplacian or Taubin), smooth_points_mls (moving least squares), smooth_points_bilateral
per-point covariances and frames points.point_covariances, point_frames
cluster a point cloud points.cluster_labels (DBSCAN, Euclidean clusters)
boundary points of a cloud points.point_boundary_mask
geodesic and signed distance, transport and log map on a cloud heat.PointCloudHeatSolver (heat method on the local triangulations' tufted cover), points.local_triangulation
points visible from a viewpoint points.point_visible_mask (hidden point removal)
down-sample voxels.voxel_down_sample, points.farthest_point_sample
order points or cells along a Hilbert or Morton curve points.space_filling_order, voxels.space_filling_codes
remove outliers points.statistical_outlier_mask, radius_outlier_mask, cluster_outlier_mask, plane_outlier_mask, normal_outlier_mask
convex hull (example) points.convex_hull (exact), convex_superset_mask (prefilter)
reconstruct a surface reconstruction.screened_poisson, ball_pivoting
align two scans registration.icp, icp_point_to_plane, procrustes
fit many sets of corresponding points at once, robust to outliers registration.procrustes_from_offsets
voxelize voxels.voxelize_mesh, voxelize_points
Differential geometry
cotangent Laplacian and mass matrix laplacian.cotmatrix, laplacian.mass_matrix
solve a constrained quadratic (harmonic, biharmonic fields) linalg.min_quad_with_fixed
geodesic distance heat.heat_geodesic (approximate, fast), heat.fast_marching_distance (first-order front, no solve), geodesic_walk.geodesic_path
flatten to the plane (UV parametrization) parametrization: harmonic, lscm, arap, slim (least symmetric Dirichlet distortion from a start, fold-free), low_distortion_parametrization (free boundary, no pins, any topology), arap_parametrization (the same from a classic map, any surface with a boundary), slim_parametrization (the whole unwrap to the least symmetric Dirichlet distortion, from the free chart or a classic map; fold-free on a disk)
bake or sample textures texture
which face covers each pixel of a UV window (visibility buffer) texture.rasterize_face_indices
Arrays
NumPy-like unique, sort, isin, searchsorted-style helpers grouping, array
reductions (min, max, sum, mean) without a host round trip reduce
per-group sums (bincount with weights, add.reduceat), reproducible under the deterministic setting reduce.scatter_sum, reduce.segment_sum
per-group means, minima and maxima (minimum.at, maximum.reduceat) reduce.scatter_mean, scatter_min, scatter_max, segment_mean, segment_min, segment_max
Deploy
compile every kernel ahead of time for a container image or CI (no GPU needed) precompile: python -m ordito.precompile --arch 86,89, precompile.precompile

Modules

Primitives & creation

Module Contents
creation Parametric mesh generators: boxes, Platonic solids, surfaces of revolution and extrusions.

Mesh structure & topology

Module Contents
mesh The optional Trimesh container, which caches derived quantities.
normals Vertex normals under three weighting rules, and the accumulators beneath them.
edges Triangle edges: the directed corner edges, the deduplicated undirected set, and their lengths.
triangles Quantities carried by one triangle at a time: its normal, area, angles, shape and barycentre.
halfedge Implicit halfedge connectivity: edge twins and counter-clockwise vertex one-rings.
adjacency Which faces share an edge, what each adjacent pair looks like, connected components.
boundary Boundary edges, vertices and loops.
selection Face-subset extraction and vertex-selection morphology.
validation Validity predicates (manifold, watertight, orientable, self-intersecting) and their per-element masks.
equality Equality of meshes up to the numbering of their vertices and faces.
homology Homology generators: the loops that make a surface's topology.
tangent_space Per-vertex and per-face tangent frames, and the angles that transport vectors between them.

Measures & shape descriptors

Module Contents
measures What the whole mesh adds up to: enclosed volume, moments, Euler characteristic.
curvature Discrete curvature: principal directions and magnitudes, Gaussian and mean.
bounds Bounding boxes: building them, and selecting or cropping with them.
visibility Ambient occlusion, shape diameter and thickness: how far the surface is from a point.

Mesh editing & repair

Module Contents
transform Affine transforms: build a 4x4 matrix, apply it, classify what it preserves.
repair Removing what should not be in a mesh: duplicates, bad triangles, inconsistent winding.
holes Closing boundary holes, and stitching two open meshes along a rim.
combine Assembling meshes from parts and splitting them back apart.
boolean Union, intersection and difference of closed meshes as solids, singly or in batches, and cuts by a mesh or a plane.
remesh Changing a mesh's triangulation: subdividing, decimating, and improving triangle shapes.
smoothing Laplacian smoothing filters, for vertex positions and for per-vertex scalar fields.
seams Feature and UV-seam edges, and the topological cut along them.
levelset Surfaces from scalar fields: marching cubes, offsets and thickening.

Spatial queries

Module Contents
proximity Where a point stands relative to a mesh: closest point, signed distance, winding number.
ray Ray casting and point-in-mesh tests.
neighbors Point-set acceleration structures (BVH, hash grid), k-nearest and radius queries.
intersection Where a mesh meets a plane, another mesh, or an isovalue.
metrics Chamfer and Hausdorff distances between point clouds and meshes.

Point clouds, voxels & reconstruction

Module Contents
points Point-cloud geometry: plane and line fits, covariance, normals and their orientation, local triangulations, smoothing, clustering, outliers, down-sampling, convex hull, visibility.
sample New points on a mesh surface, inside its volume, or over a sphere.
voxels Sparse voxel grids: voxelize, test membership, morphology, booleans, and mesh the result.
reconstruction Surfaces from points: Delaunay, screened Poisson, ball pivoting, uniform resampling.
registration Point-cloud registration: Procrustes analysis and ICP.

Operators & solvers

Module Contents
laplacian Discrete Laplacians, gradients and mass matrices, with intrinsic repairs for bad meshes.
energies Mesh energies: the scalar regularization losses, and the operators the solvers minimize.
linalg Sparse solvers: constrained quadratic minimization, conjugate gradients, preconditioners.
cholesky Sparse Cholesky factorization of symmetric positive-definite operators, on the device.
interpolation Moving a field between faces, vertices and edges, across a topology edit, or from scattered points.
parametrization Flattening a mesh into the plane: harmonic, Tutte, ARAP, SLIM and LSCM.

Geodesics & heat-method solvers

Module Contents
geodesic_walk Straightest geodesics, shortest paths and loop shortening across the surface.
heat Heat-method distances, signed distances, vector transport and log maps, on meshes and point clouds.

Curves

Module Contents
polyline Open and closed 3D polylines: length, resampling, simplification, triangulation.

Attributes & I/O

Module Contents
texture Bake per-vertex attributes into UV-space textures and sample them back.
io Mesh file loading through the optional meshio dependency.

Arrays & infrastructure

Module Contents
array NumPy-style structural and elementwise operations on Warp arrays, and sparse assembly.
reduce Global reductions on Warp arrays: min, max, sum, mean, any, all, median, and per-group sums.
grouping Grouping and deduplication of values and rows.
graph Graph algorithms on sparse adjacency matrices and edge lists.
typing Array type aliases and runtime rank checks.
constants Shared numeric tolerances and sentinel values.
config Runtime settings: whether float reductions and scans repeat bit for bit on CUDA (od.set_deterministic, with od.deterministic(False):); see Reproducible results.
precompile Ahead-of-time kernel builds: fill Warp's kernel cache for given GPU architectures and the CPU without running a workload (python -m ordito.precompile), for container images and CI.