Overview
Mesh tools operate synchronously: they accept a file and return the processed model directly. Results are streamed back as binary (or a zip when a tool produces multiple files).
| Tool | Endpoint | Premium op |
|---|---|---|
| Decimate | POST /api/mesh/decimate | Yes |
| Repair | POST /api/mesh/repair | Yes |
| Analyze | POST /api/mesh/analyze | No |
| Recalculate normals | POST /api/mesh/recalculate | Yes |
| LOD generation | POST /api/mesh/lod | Yes |
| Texture baking | POST /api/mesh/bake | Yes |
Decimate
Reduce polygon count while preserving silhouette, UV boundaries, and vertex attributes.
| Field | Type | Description |
|---|---|---|
| file | file * | Model to decimate. |
| inputFormat | string | Source format (default glb). |
| outputFormat | string | Output format (default glb). |
| ratio | float | Target polygon ratio, between 0.05 and 0.95 (default 0.5). |
Returns the decimated file as a binary stream.
Repair
Fix common mesh issues such as non-manifold geometry, inverted faces, and holes.
| Field | Type | Description |
|---|---|---|
| file | file * | Model to repair. |
| inputFormat | string | Source format (default glb). |
| outputFormat | string | Output format (default glb). |
Analyze
Returns a JSON report with mesh statistics such as vertex count, triangle count, UV islands, and material count. Not counted against premium operations.
curl -X POST https://api.geometry-labs.com/api/mesh/analyze \
-H "Authorization: Bearer $GL_TOKEN" \
-F "file=@model.glb" \
-F "inputFormat=glb"
Recalculate normals
Recalculate, flip, or smooth normals.
| Field | Type | Description |
|---|---|---|
| file | file * | Model to process. |
| inputFormat | string | Source format (default glb). |
| outputFormat | string | Output format (default glb). |
| direction | string | outward or inward (default outward). |
| shading | string | smooth or flat (default smooth). |
LOD generation
Generate multiple levels of detail as a zip archive.
| Field | Type | Description |
|---|---|---|
| file | file * | Model to process. |
| inputFormat | string | Source format (default glb). |
| outputFormat | string | Output format (default glb). |
| levels | array (JSON) | Reduction levels, e.g. [1.0, 0.5, 0.25, 0.1]. |
Texture baking
Bake maps from a high-poly to a low-poly mesh. Returns a zip of baked maps.
| Field | Type | Description |
|---|---|---|
| highPoly | file * | High-poly model. |
| lowPoly | file * | Low-poly model. |
| inputFormat | string | Source format (default glb). |
| mapTypes | array (JSON) | Maps to bake, e.g. ["normal"]. |
| resolution | int | Output resolution (default 1024). |
| rayOffset | float | Ray offset for baking (default 0.02). |