<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[StepSTL Notes]]></title><description><![CDATA[StepSTL Notes]]></description><link>https://stepstl.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6adac72da48cd2e249e93966/7f3deb0d-3b0f-4665-be98-691a5739f28d.png</url><title>StepSTL Notes</title><link>https://stepstl.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 01 Nov 2026 19:22:32 GMT</lastBuildDate><atom:link href="https://stepstl.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[A STEP file has no triangles: what really happens between the CAD model and the STL]]></title><description><![CDATA[Why the same STEP file produces 12 or 2,142 triangles: tessellation is a sampling setting, and flat faces never subdivide. Measured, browser-side.]]></description><link>https://stepstl.hashnode.dev/a-step-file-has-no-triangles-what-really-happens-between-the-cad-model-and-the-stl</link><guid isPermaLink="true">https://stepstl.hashnode.dev/a-step-file-has-no-triangles-what-really-happens-between-the-cad-model-and-the-stl</guid><category><![CDATA[cad]]></category><category><![CDATA[3dprinting]]></category><category><![CDATA[WebAssembly]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Foreveryoung1010]]></dc:creator><pubDate>Fri, 23 Oct 2026 08:27:15 GMT</pubDate><content:encoded><![CDATA[<p>A STEP file contains no triangles. Open one in a text editor and you will find analytic surfaces, NURBS patches, topology, and a unit declaration — but no mesh. The triangles appear later, when something decides how densely to sample the geometry. That decision is a setting, and it changes the output far more than most people expect.</p>
<p>This article walks through what actually happens between the CAD model and the STL, using measured outputs from a browser-side converter's test suite rather than illustrations.</p>
<h2>The model is a boundary representation</h2>
<p>STEP describes a solid by its boundary. A planar face is stored as a plane plus trimming curves. A curved face is stored as a NURBS surface with its own control points. Edges and vertices record how faces meet. Nothing in that description says "triangle".</p>
<p>An STL, by contrast, holds exactly three things: triangles, their face normals, and (in binary) a small attribute field. To get from one to the other, the converter has to sample every face and connect the samples into a mesh. That sampling step is called tessellation.</p>
<p>The sampling density is controlled by deflection parameters — how far a triangle is allowed to deviate from the true surface, and sometimes how large an angle is allowed between adjacent facets. Different tools expose these differently: a slider, a "quality" preset, or an accuracy value in millimetres.</p>
<h2>Measured: four samples, three presets</h2>
<p>The test suite behind <a href="https://stepstl.com/">stepstl.com</a> converts the same four CAD samples at three presets — Draft, Normal, Fine — and asserts the binary STL byte size against the triangle count. These are the measured results.</p>
<table>
<thead>
<tr>
<th>Sample</th>
<th>Draft</th>
<th>Normal</th>
<th>Fine</th>
</tr>
</thead>
<tbody><tr>
<td><code>cube-10x10.stp</code></td>
<td>12 triangles / 684 B</td>
<td>12 / 684</td>
<td>12 / 684</td>
</tr>
<tr>
<td><code>conical-surface.step</code></td>
<td>286 / 14,384</td>
<td>516 / 25,884</td>
<td>2,142 / 107,184</td>
</tr>
<tr>
<td><code>as1_pe_203.stp</code></td>
<td>3,848 / 192,484</td>
<td>6,088 / 304,484</td>
<td>17,848 / 892,484</td>
</tr>
<tr>
<td><code>as1-oc-214.stp</code></td>
<td>4,900 / 245,084</td>
<td>7,372 / 368,684</td>
<td>21,116 / 1,055,884</td>
</tr>
</tbody></table>
<p>Every row satisfies the binary STL invariant <code>bytes = 84 + 50 × triangles</code>. That is not a coincidence: it is the file format. An 80-byte header, a 4-byte count, and 50 bytes per triangle. If you want the derivation, it is in <a href="https://stepstl.com/verify-step-to-stl/#size-check">this byte-size check</a>.</p>
<p>The interesting part is the shape of the table, not the arithmetic.</p>
<h2>Flat faces do not subdivide</h2>
<p>The 10 mm cube produces 12 triangles at Draft, at Normal, and at Fine. Same file size, same count, three presets.</p>
<p>That is not a bug or a rounding artifact. A planar face is already exact. Two triangles can represent a rectangle with zero deviation from the true surface, so there is nothing for a finer setting to improve. A tessellator that subdivided flat faces anyway would be adding vertices without adding accuracy.</p>
<p>This is the first thing to internalise: <strong>a quality preset acts on curvature</strong>. If your part is all prisms and plates, moving the slider may change nothing at all — and that is the correct behavior.</p>
<h2>Curved faces scale with the setting</h2>
<p>The conical surface tells the opposite story. Draft gives 286 triangles, Normal 516, Fine 2,142. The same geometry, the same file, a 7.5× span in triangle count.</p>
<p>A cone is curved in one direction, so its surface can only be approximated by facets. Finer deflection means more facets. The count rises until the approximation error falls below the tolerance you asked for.</p>
<p>The two assemblies show the same effect with more geometry: 3,848 to 17,848 triangles for one, 4,900 to 21,116 for the other. Roughly a 4× spread, because most of their surface area is curved.</p>
<h2>Triangle count is a setting, not a fidelity score</h2>
<p>It is tempting to read "more triangles" as "more accurate". That is only half true, and the wrong half can cost you.</p>
<p>More triangles means a closer approximation of the same surface. It does not mean the part is more correct, more printable, or better behaved downstream. A dense mesh of a bad model is still a bad model — tessellation samples geometry, it does not repair it.</p>
<p>What the count actually affects:</p>
<ul>
<li><strong>File size.</strong> A 50-byte record per triangle, so 17,848 triangles is 892,484 bytes. The same part at Draft is 192,484 bytes.</li>
<li><strong>Downstream processing.</strong> Slicers, viewers, and simulation tools all iterate over triangles. The count is a direct multiplier on their work.</li>
<li><strong>Surface representation.</strong> For a smooth part, a coarse mesh shows visible facets; a fine one does not.</li>
</ul>
<p>What it does not affect:</p>
<ul>
<li><strong>Whether the topology is valid.</strong> Gaps and open shells in the STEP body are reproduced in the STL.</li>
<li><strong>Whether the unit is right.</strong> A mesh can have the perfect triangle count and be 25.4× the wrong size.</li>
<li><strong>Exact volume or area.</strong> Any number you compute from triangles is a mesh measurement. It converges toward the B-rep value as density rises, but it is never the exact surface value.</li>
</ul>
<h2>Choosing a preset without guessing</h2>
<p>A practical way to decide is to work backwards from what will consume the mesh.</p>
<p>For a visual check or a quick fit test, Draft is usually enough: the shape is right, the file is small, and you are not measuring anything.</p>
<p>For 3D printing, the question is whether facets are visible at the scale you care about. A curved surface sampled coarsely will show flat bands under raking light. If the part is large and smooth, go finer; if it is boxy, the preset will barely matter.</p>
<p>For measurement, remember that the mesh is the measurement. If you need the exact surface, you need the STEP file, not the STL.</p>
<h2>Verify what came out</h2>
<p>Two checks catch most surprises, and both work on any STL from any converter:</p>
<ol>
<li><strong>Byte size.</strong> <code>(bytes - 84) / 50</code> must be a whole number, and it must equal the triangle count the tool reported.</li>
<li><strong>Bounding box.</strong> Measure the STL's extents and compare them with the size stated in the CAD file. This is where unit mistakes show up — a millimetre part and an inch part can share a triangle count and differ by a factor of 25.4.</li>
</ol>
<p>Neither check requires an upload or an account. The first is arithmetic; the second is a ruler.</p>
<h2>What the conversion is, in one sentence</h2>
<p>Tessellation is a sampling decision, not a translation of intent: the STEP file states the surface exactly, and the STL records one approximation of it, with the density chosen by whoever ran the conversion.</p>
<p>Once you see the preset as a sampling rate, the table above stops looking like a quality ranking and starts looking like what it is — three different answers to the question "how closely should this surface be approximated?"</p>
<p><em>Disclosure: I maintain stepstl.com, a static browser-side STEP/IGES to STL converter. The measurements above come from its test suite and are reproducible with <code>npm test</code>. The byte formula applies to any binary STL, including files produced by other tools.</em></p>
]]></content:encoded></item></channel></rss>