IT
OmnvertImage • Document • Network
Apr 11, 2026Updated: Jul 21, 2026advanced22 minmesh · triangulation · height-map · stl · svgPNG / SVG → STL converterMore guides for this tool

Understanding Mesh Generation from 2D Assets

A technical overview of how a 2D PNG/SVG becomes a 3D triangle mesh: sampling, contours, triangulation, normals, watertightness, and STL output constraints.

Step-by-step

  1. Choose a representation: silhouette vs. height field

    Logos often work as “silhouette extrusion” (binary shapes). Grayscale artwork behaves like a height map (brightness → Z height), which can introduce noise if the image is not clean. The input format decides the whole pipeline. An SVG already carries the outline — cubic and quadratic curves the generator flattens to whatever tolerance you ask for, so a circle stays a circle at any size. A PNG carries only a grid of samples, and the outline has to be inferred from wherever alpha or luminance crosses a threshold. That inference is where the artefacts are born. If you still have the vector original, use it; tracing a 512 px PNG back into paths never recovers what the rasteriser threw away.

  2. Normalize alpha and remove micro-islands

    A clean binary silhouette produces predictable walls. Remove dust pixels, close small gaps, and avoid textured backgrounds — they turn into holes or self-intersections downstream. Anti-aliased edges are the single most common cause of ugly geometry from PNG sources. The soft ramp that makes an edge look smooth on screen is a band of partial alpha two to four pixels wide, and a threshold cut through it lands somewhere slightly different on every scanline. The contour comes out as a staircase with a random tread, and after triangulation you are left with thousands of skinny triangles hugging every boundary. Either threshold hard and smooth the resulting polyline, or work at three to four times the size you need and decimate the mesh afterwards.

  3. Control sampling density

    Sampling determines triangle density. If you feed extremely high-resolution rasters, you can create micro-triangles that don’t print. Use the polygon optimization guide to keep meshes efficient: Path simplification is the lever most people never touch. A Douglas–Peucker tolerance of 0.05–0.1 mm strips collinear vertices without visibly changing the silhouette; at 0.5 mm you start seeing straight chords cut across gentle curves. For extruded logos the number to watch is angular deviation on curves: 24 segments around a 20 mm circle leaves 2.6 mm flats you can feel with a thumbnail, while 96 segments is invisible and still cheap.Optimize polygon count.

  4. Generate an STL and inspect topology

    Use the PNG / SVG → STL converter to generate an STL, then check for tiny islands, holes, and excessively dense triangle regions. Look for four things specifically: islands smaller than a nozzle diameter that will never print, hairline bridges where two shapes almost touch, duplicated vertices along the extrusion seam, and inverted normals showing up as dark or striped faces in the viewer. Meshmixer’s Inspector, Blender’s 3D-Print Toolbox and Netfabb’s basic check all report these. A few hundred non-manifold edges usually means the contour itself is noisy; two or three usually means one bad junction you can fix by hand in a minute.

  5. Validate watertightness and scale

    For reliable slicing, the model should be a closed volume. If you see holes/non-manifold warnings, use Fix non-manifold STL. Then confirm dimensions (mm) using Scaling & thickness. Watertight has a precise meaning: every edge belongs to exactly two triangles and the winding is consistent, so all normals face outward. Meshes generated from 2D almost always fail this at the seam where the extruded walls meet the cap, or where two overlapping shapes were extruded independently and left interpenetrating. Slicers cope with a lot of it — Cura and PrusaSlicer both run their own repair pass — but a boolean union of the overlapping parts before export gives you a model that behaves identically in every tool you open it in.

  6. Choose extrusion, revolve, or offset

    A straight extrusion is the right answer for signage, stencils and inlays. A revolve turns a 2D profile into a solid of rotation, which is how you get vases, knobs and bottle shapes from a single outline — but the profile has to be an open curve on one side of the axis, and any part of it that crosses the axis produces self-intersecting geometry. An offset or shell builds a wall of constant thickness around the outline instead of filling it, which is exactly what a cookie cutter needs: a 0.8 mm offset gives two perimeters and a rim stiff enough to push through dough.

  7. Bevel the walls and chamfer the base

    A vertical wall dropped straight from a traced contour prints with a visible seam and shows off every wobble in the path. A small draft or bevel — 0.3–0.5 mm at 45° along the top edge — hides the seam, catches light, and makes the part far more forgiving of a rough contour. On the bottom, a 0.4 mm chamfer counteracts elephant’s foot so the first layer does not spread past the outline. Neither change costs anything in print time, and together they are the difference between a part that looks converted and one that looks designed.

  8. Clean up before you hand it to the slicer

    The final pass is mechanical: merge vertices within 0.01 mm, delete loose shells with fewer than a few dozen faces, recalculate normals outward, and run a decimate that preserves the boundary. Then reopen the file and read the triangle count and the bounding box in the same sitting. A mesh that went from 1.2 M to 180 k triangles with the same silhouette is a win; one that also lost 0.4 mm off its width has been smoothed rather than decimated. Save the cleaned STL under a new name so you can walk it back if the simplification went too far.

1) Sampling the 2D input

For PNG, the engine reads pixels (often in sRGB) and may normalize alpha/background. For SVG, it parses viewBox/paths and rasterizes or samples contours at a chosen density. The sampling stage decides how much detail will exist downstream.

2) From contours/height to triangles

  • Silhouette extrusion: find the boundary of solid pixels, triangulate the 2D region, then extrude with side walls.
  • Height field: treat brightness as height, generate a surface mesh over a grid, then add a base to make it watertight.

3) Normals, watertightness, and STL constraints

STL is triangle-only. For reliable prints, the mesh should be watertight (closed volume) and avoid self-intersections. Even if a slicer can auto-repair, clean topology reduces surprises.

Triangulation and contour extraction (why edges matter)

Most image → STL pipelines boil down to extracting boundaries and then triangulating a 2D region. If your edges are noisy, the contour becomes a zig-zag polyline and triangulation produces a lot of skinny triangles.

Mental modeltext
PNG/SVG → boundary/height sampling
  → 2D contours (polylines) or height grid
  → triangulation (surface + walls + base)
  → watertight STL (closed volume)
Want smaller STLs?

Start by cleaning the 2D input, then use Optimize polygon count. Internal vertex optimization helps, but it can’t fix a noisy contour.

Vector in, raster in: two different problems

With an SVG the generator never has to guess where an edge is. It flattens each Bézier to a polyline at a chosen chord tolerance, stitches the subpaths into closed loops, resolves fill rules so the counters inside letters become holes rather than raised islands, and triangulates the result. Set the tolerance and you have set the smoothness. With a PNG none of that information exists: the pipeline has to threshold, trace, and then decide how much of the resulting jitter was real.

  • SVG: curves stay curves and scale is free, but text must be converted to outlines first or it may not render at all.
  • SVG strokes are not outlines — a 2 pt stroke has no area until you convert stroke to path.
  • PNG: the alpha channel is the silhouette when it exists; otherwise you are thresholding luminance and inheriting its noise.
  • PNG at 300 px or more per printed centimetre gives contours smooth enough to simplify cleanly.
  • Neither format carries units, so the physical size is always something you set later.

Curve smoothness and facet count

Every curve in the output is a chain of flat facets, and the error between a facet and the true curve is what your fingertip finds. For a chord tolerance t on a circle of radius r, the segment count is roughly π / acos(1 − t/r). Halving the tolerance costs about 1.4× the segments rather than 2×, which is why tightening it is usually affordable. Where it stops being affordable is many small curves at once: 200 letters, each with 50-segment bowls, adds up much faster than one large arc.

Facets needed on a 20 mm circletext
r = 10 mm            n  ~=  pi / acos(1 - t/r)
t = 0.10 mm  ->  22 facets, 2.8 mm flats   (you can see them)
t = 0.02 mm  ->  50 facets, 1.3 mm flats   (feels smooth)
t = 0.005 mm ->  99 facets                 (below FDM resolution)

Manifold, watertight, and what a slicer will forgive

Slicers are pragmatic. They will quietly repair a lot of damage, but each repair is a guess about what you meant, and guesses differ between Cura, PrusaSlicer and Bambu Studio — which is how the same STL ends up printing three different ways. Run through this list before export and the guessing stops.

  1. Non-manifold edges: an edge shared by three or more faces, usually where two extruded shapes overlap. Union them instead of stacking them.
  2. Inverted normals: the volume is right but the sign is wrong, and a slicer may print the negative of what you expect.
  3. Zero-area triangles: harmless in a viewer, but they break several repair algorithms. Merging coincident vertices clears them.
  4. Floating islands: separate shells sitting inside the bounding box. Delete anything under a few dozen faces before export.
  5. Self-intersection: geometry passing through itself. This is the case slicers handle worst, so fix it in the mesh.
Tiny islands are invisible until they are not

A stray three-pixel cluster in the source PNG becomes a 0.2 mm pillar in the STL. It slices without complaint, shows up in preview as a single dot, and on the plate it turns into a blob the nozzle drags across the part for the rest of the print. Zoom the source to 100% and clean the background before conversion — it is the cheapest fix in the whole pipeline.

Related