# Geometry and mesh algorithms

Part of Deterministic skills by Baltor.

Pure Python geometry whose glTF output loads in Godot: triangulation, convex hulls, polyline simplification, polygon offsets, subdivision, curves and gears. Their pages are in the gallery, with the render each check recorded.

## What to watch for

- Coplanar and duplicate points are where hull and triangulation code fails.
- glTF is Y-up and in metres, so a mesh in another frame needs converting.
- Offsetting a polygon can make it self-intersect; the result must be checked.

## Components

- [2D Delaunay triangulation by Bowyer-Watson](https://baltor.ai/gallery/delaunay-bowyer-watson): Triangulate 2D points so that no point lies inside any triangle's circumcircle, using Bowyer-Watson insertion with exact fallback predicates. Name `delaunay_bowyer_watson`, licence MIT, 10 files.
- [3D convex hull by quickhull](https://baltor.ai/gallery/quickhull-3d): Compute the convex hull of 3D points as a closed mesh with outward faces, merging coplanar triangles into polygons. Name `quickhull_3d`, licence MIT, 10 files.
- [Ramer-Douglas-Peucker polyline simplification](https://baltor.ai/gallery/douglas-peucker): Simplify 2D or 3D polylines by keeping only points farther than a tolerance from the simplified line, with a measure of the largest deviation. Name `douglas_peucker`, licence MIT, 10 files.
- [Polygon offset with miter, round or bevel joins](https://baltor.ai/gallery/polygon-offset-2d): Grow or shrink a simple 2D polygon by a distance with miter, round or bevel joins, refusing offsets that would make it cross itself. Name `polygon_offset_2d`, licence MIT, 10 files.
- [Catmull-Clark subdivision surface](https://baltor.ai/gallery/catmull-clark-subdivision): Smooth a polygon cage into a quad mesh by Catmull-Clark subdivision, with B-spline boundary rules and fixed boundary corners. Name `catmull_clark_subdivision`, licence MIT, 10 files.
- [Cubic Bezier evaluation, arc length and resampling](https://baltor.ai/gallery/bezier-curve-arc-length): Evaluate and split cubic Bezier curves by de Casteljau, measure arc length by Gauss-Legendre quadrature and resample paths at even arc-length spacing. Name `bezier_curve_arc_length`, licence MIT, 10 files.
- [NURBS curves with exact circles and conics](https://baltor.ai/gallery/nurbs-curve): Evaluate rational B-spline (NURBS) curves in homogeneous coordinates, with the exact nine-point circle and single-span conic arcs. Name `nurbs_curve`, licence MIT, 10 files.
- [Lathe revolution with partial angles](https://baltor.ai/gallery/lathe-revolve): Revolve an (r, y) profile around the Y axis, fully or through a partial angle with flat cut faces, and compute the exact volume of the polygonal solid. Name `lathe_revolve`, licence MIT, 10 files.
- [Involute spur gear](https://baltor.ai/gallery/involute-spur-gear): Generate a spur gear whose tooth flanks are true involutes of the base circle, sized by module, tooth count and pressure angle, extruded around a bore. Name `involute_spur_gear`, licence MIT, 10 files.
- [Conway polyhedron operators](https://baltor.ai/gallery/conway-polyhedron-operators): Build polyhedra from Conway notation: dual, ambo, kis, truncate, join, expand, ortho, gyro and snub applied to T, C, O, D, I, prisms and antiprisms, with planarizing relaxation. Name `conway_polyhedron_operators`, licence MIT, 10 files.
- [Platonic solids with exact edge length](https://baltor.ai/gallery/platonic-solids): Generate the five regular convex polyhedra with exact coordinates and polygon faces found as supporting planes. Name `platonic_solids`, licence MIT, 10 files.
- [Icosphere by recursive subdivision](https://baltor.ai/gallery/icosphere): Build an evenly tessellated sphere by splitting a regular icosahedron into four triangles per face and projecting onto the sphere. Name `icosphere`, licence MIT, 10 files.

Your agent downloads these through Baltor with Pro, $49 a month: https://baltor.ai/get-started
