Understanding 3D STL Files for CNC Machining
An STL file stores a part surface as triangles and nothing else. No units, no features, no tolerances. This page explains how that mesh becomes a CNC toolpath, where the format stops being enough, and how to set chordal deviation and orientation so a 5-axis job holds ±0.005 mm.

What an STL file actually contains
An STL file is a list of triangles. Each triangle is written as three vertex coordinates plus a normal vector, and that is the whole data model. There is no feature tree, no sketch history, no hole callout, no surface finish note, no material. A Ø12 mm bore and the flat face next to it are stored the same way: as a patch of facets.
Two encodings exist. Binary STL packs each facet into 50 bytes and is the default for anything above a few thousand triangles. ASCII STL writes the same data as readable text and can be five to ten times larger. Geometry is identical, so the choice only affects file size and transfer time.
Because a mesh carries no units, the numbers inside the file are just numbers. A vertex at 25.4 means 25.4 mm or 25.4 inches depending on a convention nobody wrote down. CAM software guesses, and a wrong guess produces a part 25.4 times too large or too small.
Facet count scales with surface area and curvature. A 100 × 100 × 50 mm bracket with drilled holes might land at 50,000 facets. A turbine blade with freeform surfaces can pass 2 million. Tessellation density is set at export time, and it is the single setting that decides whether the mesh is usable.
- 1Binary over ASCIISame geometry, smaller file, fewer transfer errors.
- 2No units storedConfirm mm or inches before the first toolpath.
- 3No feature dataHoles and pockets must be re-detected in CAM.
How a triangulated mesh becomes a CNC toolpath
CAM software does not machine triangles. It slices them. The toolpath engine intersects the mesh with a series of offset surfaces, one per pass, and fits tool center points to those intersections. On a 3-axis roughing cycle the stepover might be 2 mm; on a 5-axis finishing pass over a curved surface it can drop to 0.2 mm.
Chordal deviation is the gap between a flat facet and the true curve it replaces. Export at 0.01 mm and every machined curve can sit up to 0.01 mm inside the nominal geometry. Export at 0.05 mm and the same curve drifts five times further. File size grows roughly with the square of the reduction, so 0.005 mm tessellation can be four times heavier than 0.01 mm.
The mesh also drives gouge checking. If two facets overlap or a normal points the wrong way, the collision model is wrong and the simulation will not catch a real interference. Watertight geometry matters more than facet count. A clean 80,000-facet mesh cuts better than a leaky 400,000-facet one.
Facet size sets the floor on achievable accuracy, but it is not the only limit. Machine positioning, tool deflection, and thermal drift all add error. Keeping tessellation at roughly one tenth of the part tolerance leaves room for those other sources. For a ±0.05 mm part, 0.005 mm chordal deviation is a reasonable target.
- 1One tenth ruleSet chordal deviation near 10% of the part tolerance.
- 2Watertight firstFix gaps and flipped normals before adding facets.
Where 3D STL files for CNC machining stop being enough
STL is a surface format. It cannot carry a position tolerance, a datum reference frame, or a surface finish callout. If a drawing says the two bores must be coaxial within 0.02 mm, that requirement lives on the drawing or in a STEP file, never in the mesh. The machinist has to read it somewhere else.
Sharp edges are another boundary. A tessellated fillet is a chain of flat facets, so the CAM system sees a faceted surface where the designer intended a smooth radius. On a large radius this is invisible. On a 0.5 mm edge break it changes how the tool approaches the corner and can leave visible facets on a Ra 0.8 μm finish.
Thin walls and small internal radii are where mesh resolution hurts most. A 1 mm wall modelled with 0.5 mm facets has only two triangles across its thickness. The toolpath engine may read that as a taper or miss the wall entirely. For features under 2 mm, tessellate finer or supply STEP instead.
The practical boundary is this: use STL when the geometry is organic, the tolerance is looser than ±0.05 mm, and the part is a single body. Switch to STEP when the part carries GD&T, threaded features, tight bores, or anything that has to assemble with another component.
- 1Use STL forFreeform shells, scan data, single organic bodies.
- 2Use STEP forGD&T, threads, tight bores, mating assemblies.
Tessellation, units, and orientation choices
Export tolerance and export units are two separate settings in SolidWorks, Fusion 360, and most other CAD tools. Set both. A model exported at 0.02 mm chordal deviation in millimeters is fine for a ±0.1 mm casting pattern and useless for a ±0.01 mm medical component.
Orientation decides how many setups the job needs. A part with a deep pocket on one face and a flat datum on the opposite face wants the flat face down. That single decision can remove a re-fixturing step and keep two features in the same coordinate frame. On a 5-axis machine with a Ø400 mm rotary table, orientation also decides whether the part fits the work envelope at all.
Support strategy is not just for printing. On a machined part, the equivalent question is where the stock sits. A mesh with no flat face to clamp on forces custom soft jaws. Adding a 3 mm sacrificial pad at export time is often faster than building a fixture.
Check the bounding box after export. If a part that should be 200 mm long reads 7.87, the units are wrong. If it reads 5,080 mm, someone exported in inches and the CAM system read millimeters. Both errors are trivial to catch and expensive to miss.
- 1Set both fieldsChordal deviation and units, every export.
- 2Check bounding boxOne number catches both unit errors.
Running an STL mesh through 5-axis CAM
Mesh repair comes first. Most CAM suites include a healing tool that closes gaps, stitches open edges, and flips inverted normals. Run it, then check the model is a single watertight shell. A model with 12 open edges will produce unpredictable toolpaths near those edges.
Feature recognition on a mesh is weaker than on a solid. Holes rarely come through as clean cylinders. Expect to sketch or fit cylinders manually for any bore that has to hold a size. On a mesh, a Ø8 mm hole might come through with a 0.03 mm ovality error from tessellation alone.
Toolpath strategy on a mesh leans toward constant stepover and rest machining. Rough with a 12 mm end mill at 2 mm stepover, then finish with a 6 mm ball nose at 0.3 mm stepover for Ra 1.6 μm surfaces. For Ra 0.8 μm, drop the stepover or switch to a 3 mm ball nose. Mesh faceting shows up as chatter marks when stepover is too coarse for the surface.
Verification matters more with mesh input. Simulate the full cycle and check the stock removal against the mesh, not against a nominal solid. If the simulation shows a gouge on a curved surface, the usual cause is a facet normal that points inward. Fix the mesh and re-post.
- 1Heal before CAMWatertight shell, no open edges, normals outward.
- 2Match stepover to finish0.3 mm for Ra 1.6 μm, finer for Ra 0.8 μm.
STL vs STEP vs IGES for CNC jobs
Pick the format from the tolerance and the feature type, not from habit.
| Format | Carries GD&T | Best for | Watch out for |
|---|---|---|---|
| STL | No | Organic surfaces, scan data, single bodies | No units, no features, coarse curves |
| STEP | Yes | Parts with bores, threads, datums | Translator version mismatches |
| IGES | Partial | Legacy surfaces and older CAM seats | Gaps between trimmed surfaces |
| Parasolid | Yes | Complex solids exchanged between CAD seats | Fewer CAM tools read it directly |
| STL, fine mesh | No | Thin walls under 2 mm, small edge breaks | File size grows fast, slow CAM load |
| STL, coarse mesh | No | Roughing stock, pattern work, visual checks | Visible facets on finished surfaces |
When to send STL and when to send STEP
Send STL when the part is a single organic body with tolerances looser than ±0.05 mm and no GD&T. Send STEP the moment a drawing carries a datum, a thread, or a bore that has to hold size. If both apply, send both.
Frequently asked questions
Can an STL file hold a ±0.005 mm tolerance?
The file itself cannot state a tolerance, but it can carry enough geometry. Export at 0.001 mm chordal deviation and the mesh error stays well below ±0.005 mm.
In practice the machine and tool decide whether that tolerance is reachable. We hold ±0.005 mm on 5-axis work, and mesh resolution only needs to stay out of the way.
Why does my STL import 25.4 times too large?
The file was exported in inches and the CAM system read the numbers as millimeters. STL stores no unit label, so both sides have to agree.
Check the bounding box on import. A 200 mm part that reads 5,080 mm is the classic symptom. Re-export with units set or scale by 1/25.4 in CAM.
How many triangles should an STL file have for CNC?
There is no fixed number. Facet count should follow surface area and curvature, not a target.
A better rule is to set chordal deviation near one tenth of the part tolerance. That produces a mesh dense enough for the toolpath without slowing CAM to a crawl.
Should I repair the mesh myself or let the machine shop do it?
Simple repairs like closing small gaps and flipping normals are worth doing before upload. It shortens the DFM review.
If the mesh has hundreds of open edges or self-intersecting facets, the source model needs fixing. Re-exporting from CAD is faster than patching triangles by hand.
Does STL work for threads and tapped holes?
Thread geometry does not survive tessellation well. A modelled thread becomes a stack of facets that no tap or thread mill will follow cleanly.
Send tapped holes as plain cylinders with a note on the drawing, or supply STEP. We cut threads from the callout, not from the mesh.
What file do you prefer for a 5-axis job?
STEP for anything with datums, bores, or mating features. It keeps the feature data intact and removes guesswork.
STL is fine for organic shells and scan data. If the part is a blend of both, send both files and note which one is authoritative.
Send an STL or STEP and get a DFM review
Upload the mesh or solid. We check watertightness, units, and tessellation density, then return a quotation with free DFM analysis within 12 hours. No minimum order quantity, from one prototype to 10,000+ part runs.
12-hour quote100% inspectionNDA on requestNo MOQ