STL Viewer and 3D Print Cost Estimator
Operator: Abdulla Al Fahad. How tools are built and checked
A customer sends an STL and asks what it will cost. Before you can answer, you need three numbers that the file does not state: how much material the part really uses, how long the printer will run, and whether the mesh is sound enough to trust either figure. This page reads the model, shows it in a 3D view, measures its size, volume and surface, tests whether it is closed, and turns those into grams, metres of filament, hours and a price. Several models can be quoted together and exported.
Key features
- Reads binary and ASCII STL, OBJ (as millimetres) and 3MF with its own unit, component and build-item transforms
- Own WebGL 3D viewer with orbit and zoom, and shading that stays correct for meshes with flipped faces
- Dimensions, volume from signed tetrahedra, surface area, triangle and welded-vertex counts, degenerate triangles and shell count
- Manifold check: open edges, edges shared by more than two triangles, and neighbouring triangles that face opposite ways
- Material presets for PLA, PETG, ABS, ASA, TPU and nylon, with editable density, price per kg and filament diameter
- Infill, perimeters, line width, layer height, print speed, electricity, machine rate, setup fee and markup
- Per-model scale and copies, a batch table, and CSV and PDF quote export
How volume, grams and time are estimated
Volume is the sum, over every triangle, of the signed volume of the tetrahedron from the origin to that triangle, which is the dot product of the first corner with the cross product of the other two, divided by 6. For a closed mesh with outward faces the sum is the enclosed volume; a negative sum means the faces point inwards, and the page then uses its absolute value and says so. A mesh with holes has no well-defined volume, which is why the quote flags it.
The closed test welds vertices that coincide within one millionth of the model's diagonal, then lists every edge with the direction each triangle uses it. An edge used once is an open edge, an edge used by more than two triangles is non-manifold, and an edge used twice in the same direction means one neighbour is flipped. Only when none of these occurs does the page call the mesh closed and consistent. Self-intersecting shells are not detected.
How it works
Each file is read in a worker that parses the mesh, welds it and runs the checks, so a 2-million-triangle model does not freeze the page and a slow read can be cancelled. Files up to 80 MB are accepted, with a cap of 3 million triangles per model and 6 million in a batch.
3MF files are unpacked while counting the real bytes that come out of the archive, with a limit of 120 MB across parts, whatever sizes the archive declares. OBJ faces with more than three corners are split into triangles as a fan.
The viewer draws the triangles directly and shades them from the screen-space derivative of position, so it needs no normals and cannot show a face as dark just because its winding is reversed. Above a million triangles it draws every nth one for speed; the numbers still use all of them.
When this helps
- A seller of cable clips gets a 3MF with 24 copies of one clip arranged on a plate. The page treats the whole plate as one model, so the quote is for the plate; for a per-clip price, export the clip alone and set copies to 24.
- A customer's STL turns out to have 38 open edges around a missing lid. The red verdict warns that the volume is unreliable, and a repair in a mesh tool before quoting avoids a price based on a hollow shell.
- A hobbyist compares PLA and PETG for the same 24 cm³ block. Switching the preset changes the density from 1.24 to 1.27 g/cm³ and the price per kg, so the 20% infill job goes from 10.1 g to 10.3 g.
Opening a file
- Drop one or more models; each is checked and listed.
- Pick a material and set infill, layer height and your machine and price figures.
- Set scale and copies per model, read the estimate beside the 3D view, then download the PDF quote or the CSV.
Example
A 20 × 30 × 40 mm block as an STL, PLA preset, 20% infill, 2 perimeters of 0.4 mm, 0.2 mm layers, 60 mm/s at 60% efficiency, 30% markup
block.stl: 12 triangles, 8 welded vertices, price 20 per kg, 120 W at 0.15 per kWh, machine rate 1 per hourEstimate for this model
Volume 24.000 cm³, surface 52.00 cm², closed and consistent
Material 8,128 mm³ = 10.1 g, 3.38 m of 1.75 mm filament
Time about 0.90 h over 200 layers
Material 0.20, electricity 0.02, machine 0.90, markup 0.33, price each 1.45Tips for best results
- Check the Orientation line: negative signed volume means inward faces, which most slicers repair silently but some print as a hollow part.
- Solid volume scales with the cube of the scale and the walls with the square, so at 50% the example block needs 1,432 mm³ of filament instead of 8,128, about a sixth.
- Raise the markup rather than the machine rate when you want a margin that follows the job's size; the machine rate and electricity follow time instead.
- Compare infill by changing only the percentage: the shell is fixed by the surface, so going from 20% to 40% raises the example block from 8,128 to 12,096 mm³ of material.
Limits
The estimate comes from volume and surface, not from slicing. A thin tall part with large overhangs needs supports that this model does not see, and curved parts spend longer on perimeters than the speed factor suggests.
OBJ has no unit field. The page reads the numbers as millimetres, so a model exported in metres will look 1000 times too small; use the scale field to correct it.
Common errors and how to fix them
- "The header says N triangles but the file is M bytes"
- The file is damaged or not a binary STL. Re-export it, or save an ASCII STL.
- "No 3D model part was found inside this 3MF file"
- The archive has no .model part. Open it in your slicer and export again as STL.
- "Adding the file would take the batch past 6,000,000 triangles"
- Quote the models in two batches, or decimate the heavy ones in a mesh tool first.
Best practices
- Check the Size line against the dimensions the customer gave before trusting any price; a model in inches opened as millimetres is the commonest mistake.
- Set the markup high enough to cover failed prints, because supports, rafts and failures are not in the estimate.
The material and time model
The material model is deliberately simple. The shell is the surface area times the perimeters times the line width, plus any extra top and bottom skin above that thickness over the footprint; that is capped at the solid volume. Infill fills the percentage you set of what remains. Time is that material volume divided by the volumetric flow (line width × layer height × speed × an efficiency factor), plus 2 seconds per layer. Supports, rafts, purge towers and failed prints are not included.
Frequently asked questions
How is the price made up?
Material cost is grams times the price per kg. Electricity is machine watts times hours times the price per kWh. Machine time is hours times the hourly rate. The markup percentage is applied to the sum of those three, and the setup fee is added once per model line on top of the copies.
Why does a hollow-looking model give a normal volume?
If the shell is closed, its volume is that of the solid it encloses, and the infill and wall settings then decide how much plastic goes into it. A model that is a thin closed shell by design, like a vase body, has a small volume and gets a small estimate.
Can I quote a model that is not watertight?
Yes, but treat the price as a guide. The volume is still summed from signed tetrahedra, which for a mesh with holes depends on where the holes are, and the page marks the model so the quote can carry a caveat.