# STL Vertices to CSV

Extract triangle vertex coordinates from ASCII or binary STL into CSV or plain XYZ text — with triangle rows, normals, axis conversion, scale, rounding and dedupe.

## Run it

- **CLI:** `gizza tool stl-vertices-to-csv "solid tri
facet normal 0 0 1
outer loop
vertex 0 0 0
vertex 1 0 0
vertex 0 1 0
endloop
endfacet
endsolid tri"`
- **Web:** https://gizza.ai/tools/stl-vertices-to-csv/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/stl-vertices-to-csv/tool.json

## Inputs

- `stl` — STL mesh _(field)_
- `input_format` — Input format _(field)_
- `rows` — Rows _(field)_
- `columns` — Columns _(field)_
- `normal_source` — Normals _(field)_
- `up_axis` — Up axis _(field)_
- `scale` — Scale _(field)_
- `precision` — Decimal places _(field)_
- `dedupe` — Repeated rows _(field)_
- `every_nth` — Keep every Nth row _(field)_
- `delimiter` — Delimiter _(field)_
- `header` — Include header row _(field)_

## Output

- Vertex CSV (text)

## Query parameters

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

- `stl` — STL mesh
- `input_format` — Input format
- `rows` — Rows
- `columns` — Columns
- `normal_source` — Normals
- `up_axis` — Up axis
- `scale` — Scale
- `precision` — Decimal places
- `dedupe` — Repeated rows
- `every_nth` — Keep every Nth row
- `delimiter` — Delimiter
- `header` — Include header row

Example: `https://gizza.ai/tools/stl-vertices-to-csv/?stl=solid%20tri%0Afacet%20normal%200%200%201%0Aouter%20loop%0Avertex%200%200%200%0Avertex%201%200%200%0Avertex%200%201%200%0Aendloop%0Aendfacet%0Aendsolid%20tri&input_format=auto&rows=vertex&columns=xyz&normal_source=stored&up_axis=keep&dedupe=none&delimiter=comma&header=true`

---

## About this tool

STL Vertices to CSV flattens a triangle mesh into a coordinate table. Paste ASCII STL text directly, or paste a binary STL as base64 or hex bytes. The default output writes three CSV rows per facet, one for each explicit corner stored in the STL file, in file order.

This is different from an STL inspector or repair tool: it does not measure volume, fix topology, weld the mesh, or generate new points. It simply exposes the stored triangle coordinates so you can audit them in a spreadsheet, feed a CAD import, create a point-cloud text file, or compare the raw facets from two exports.

### Worked example

Input STL:

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

Default output:

```csv
x,y,z
0,0,0
1,0,0
0,1,0
```

Switch Rows to `triangle` when you want one row per facet with nine coordinate columns (`v1x` through `v3z`). Switch Delimiter to `space` and turn the header off for a plain XYZ/ASC point-cloud file.

## FAQ

<details>
<summary>Why are there three rows for each STL triangle?</summary>

STL stores every facet as three explicit corner coordinates. The default `rows=vertex` preserves that storage model: one output row per corner, so each triangle contributes three rows. Use `columns=indexed` or `full` to add the triangle and corner numbers, or use `rows=triangle` to keep each facet on one row.

</details>

<details>
<summary>Does this weld duplicate vertices?</summary>

Not by default. STL repeats shared corners in every triangle that touches them, and the default output keeps those repeats. Set Repeated rows to `all` if you want each distinct coordinate only once, which is useful for point-cloud exports.

</details>

<details>
<summary>Can it parse binary STL files?</summary>

Yes. Paste the binary STL bytes as base64 or hex and leave Input format on `auto`, or force `base64`/`hex`. Auto-detection treats a binary STL as binary by its `84 + 50 × triangle_count` byte layout, not by the leading `solid` word, because many binary STL headers also start with `solid`.

</details>

<details>
<summary>What are stored and computed normals?</summary>

Stored normals are the `facet normal` vectors in the STL file. Many exporters write `0 0 0` or stale values there. Computed normals are derived from the triangle corner order with the right-hand rule, so they reflect the geometry being exported.

</details>

<details>
<summary>What are the limits and unsupported cases?</summary>

The tool accepts up to 100,000 triangles and 32 MiB of pasted input. It does not render a 3D preview, repair bad topology, fill holes, sample triangle surfaces, batch files, or convert PLY/OBJ/glTF/3MF containers. For mesh metrics use STL Inspector; for repairs use STL Repair.

</details>

## Related tools

- [OBJ ↔ STL Mesh Converter](https://gizza.ai/tools/mesh-convert/): 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.
- [OBJ Vertices to CSV](https://gizza.ai/tools/obj-vertices-to-csv/): Extract every vertex of a Wavefront OBJ mesh into an x,y,z CSV or plain XYZ point cloud — with unit scaling, Y-up/Z-up conversion, rounding, dedupe and object filters.
- [PLY to OBJ Converter](https://gizza.ai/tools/ply-to-obj/): Convert a Stanford PLY mesh or point cloud to Wavefront OBJ. Reads ascii and binary PLY, keeps vertex colors, normals and UVs, scales and reorients axes.
- [Before / after image slider generator](https://gizza.ai/tools/before-after-slider/): Turn two images into an interactive before/after comparison slider: one self-contained HTML file with inline CSS + JS, no libraries.
- [CMYK JPEG to RGB Converter](https://gizza.ai/tools/cmyk-jpeg-to-rgb/): Convert a CMYK or Adobe YCCK JPEG to a standard RGB PNG, JPEG or WebP in your browser. Choose format, quality and chroma. No upload.
