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 vertices.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
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: discrete_gaussian_curvature, discrete_mean_curvature, 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
keep a subset of faces selection.submesh_from_face_mask
remesh to uniform edge lengths remesh.isotropic_remesh
simplify (decimate) remesh.quadric_decimate, cluster_decimate
subdivide remesh.subdivide, subdivide_loop, subdivide_to_size
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
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
test which points are inside ray.contains_points
nearest neighbours, radius search neighbors.query_nearest, query_ball
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
estimate normals points.estimate_normals
down-sample voxels.voxel_down_sample, points.farthest_point_sample
remove outliers points.statistical_outlier_mask, radius_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
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), geodesic_walk.geodesic_path
flatten to the plane (UV parametrization) parametrization: harmonic, lscm, arap
bake or sample textures texture
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

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.
vertices Per-vertex quantities: normals under three weighting rules, and the angle defect.
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.
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.
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, outliers, down-sampling, convex hull.
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, or from scattered points.
parametrization Flattening a mesh into the plane: harmonic, Tutte, ARAP 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.

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.