# OBJ ↔ STL Mesh Converter

Convert pasted OBJ or ASCII STL meshes to OBJ, ASCII STL, or binary STL data URLs. Supports scaling, Y-up/Z-up axis swaps, and triangulation.

## Run it

- **CLI:** `gizza tool mesh-convert "v 0 0 0
v 1 0 0
v 0 1 0
f 1 2 3"`
- **Web:** https://gizza.ai/tools/mesh-convert/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/mesh-convert/tool.json

## Inputs

- `mesh` — Mesh text (OBJ or ASCII STL) _(field)_
- `to` — Convert to _(field)_
- `stl_encoding` — STL encoding _(field)_
- `scale` — Scale factor _(field)_
- `axis` — Axis conversion _(field)_
- `name` — Mesh name _(field)_

## Output

- Converted mesh (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `mesh` — Mesh text (OBJ or ASCII STL)
- `to` — Convert to
- `stl_encoding` — STL encoding
- `scale` — Scale factor
- `axis` — Axis conversion
- `name` — Mesh name

Example: `https://gizza.ai/tools/mesh-convert/?mesh=v%200%200%200%0Av%201%200%200%0Av%200%201%200%0Af%201%202%203&to=stl&stl_encoding=ascii&scale=1&axis=keep&name=mesh`

---

## About this tool

**OBJ ↔ STL Mesh Converter** converts simple triangle meshes between Wavefront
OBJ and STL directly in the browser. Paste OBJ text (`v` and `f` lines) or ASCII
STL text (`solid` / `facet` / `vertex`), choose the output format, and get a
copyable mesh result.

- **OBJ to STL.** OBJ vertices and faces are triangulated and emitted as ASCII
  STL, or as a binary STL `data:model/stl;base64,...` URL you can save.
- **STL to OBJ.** ASCII STL facets are read as triangles and written as a clean
  OBJ object with deduplicated vertices and `f` triangle faces.
- **Geometry options.** Apply a uniform scale factor and optionally rotate between
  graphics-style Y-up coordinates and CAD/3D-print Z-up coordinates.
- **Local conversion.** The parser and writer run as WebAssembly in your browser;
  the pasted mesh is not uploaded.

### Worked example

Paste this OBJ triangle, leave **Convert to** as **STL**, **STL encoding** as
**ASCII STL**, **Scale factor** as `1`, **Axis conversion** as **Keep axes**, and
set **Mesh name** to `triangle`:

```obj
v 0 0 0
v 1 0 0
v 0 1 0
f 1 2 3
```

The output is:

```stl
solid triangle
  facet normal 0 0 1
    outer loop
      vertex 0 0 0
      vertex 1 0 0
      vertex 0 1 0
    endloop
  endfacet
endsolid triangle
```

The normal is recomputed from the face winding. If you choose **Binary STL data
URL**, the output starts with `data:model/stl;base64,` and can be saved as an
`.stl` file.

## FAQ

<details>
<summary>Can I upload a binary STL file?</summary>

No. This page takes pasted text, so it can read Wavefront OBJ text and ASCII STL
text. Binary STL input is raw bytes and cannot be safely pasted into a textarea;
re-export it as ASCII STL first, then convert it here. Binary STL is supported as
an output via a saveable data URL.

</details>

<details>
<summary>What happens to OBJ materials, UVs, normals, and textures?</summary>

They are not preserved. STL stores only triangles, and this converter deliberately
reduces the mesh to triangle geometry. OBJ `vt`, `vn`, `usemtl`, `mtllib`, groups,
and texture references are ignored on input. STL facet normals are recomputed
from triangle winding when STL is written.

</details>

<details>
<summary>How are OBJ quads or polygons handled?</summary>

Faces with more than three vertices are fan-triangulated: `f 1 2 3 4` becomes
triangles `(1,2,3)` and `(1,3,4)`. Negative OBJ indices are supported. Curved
surfaces, NURBS, smoothing groups, and material assignments are not evaluated.

</details>

<details>
<summary>When should I use the Y-up/Z-up axis options?</summary>

Many graphics tools treat Y as the vertical axis, while CAD and 3D-printing
workflows commonly treat Z as vertical. Choose **Y-up → Z-up** when moving a
model from a graphics coordinate frame into a printing/CAD coordinate frame, and
**Z-up → Y-up** for the reverse. Leave it on **Keep axes** if your coordinates are
already correct.

</details>

## Limits & notes

- Input must be text: Wavefront OBJ or ASCII STL. Binary STL input is not
  accepted.
- The converter preserves geometry only: no materials, textures, colors,
  smoothing groups, UVs, or custom metadata.
- OBJ polygon faces are triangulated with a simple fan, which is best for convex
  polygons. Non-planar or self-intersecting polygons may not triangulate the way
  a modeling package would.
- The binary STL option returns a base64 data URL rather than a raw byte preview;
  save it with a `.stl` extension if you need a file.

## Related tools

- [Extract Action Items from Meeting Notes](https://gizza.ai/tools/action-item-extractor/): Extract action items, owners, and decisions from meeting notes or daily notes with deterministic rules. Markdown checklist or JSON, private in-browser.
- [Amazon Order Analyzer](https://gizza.ai/tools/amazon-order-analyzer/): Paste an Amazon order-history CSV export to summarize total spend by month, top items, and category breakdowns. Browser-only, private, with Markdown or JSON output.
- [Base Decoder](https://gizza.ai/tools/base-decoder/): Auto-detect and decode Base16, Base32, Base45, Base58, Base64, and Base85 text, including nested layers, locally in your browser.
- [Budget Planner](https://gizza.ai/tools/budget-planner/): Plan a monthly budget from take-home pay: 50/30/20 needs/wants/savings targets with custom splits, or a zero-based plan showing what's left to allocate.
- [Preview a Bulk File Rename](https://gizza.ai/tools/bulk-file-renamer/): Preview old-to-new filename mappings with find/replace, regex, numbering, case conversion, prefix/suffix, and collision warnings.
