·3 min read
Turning an SVG logo into a 3D object with Three.js
SVGLoader, ExtrudeGeometry and one bevel setting that quietly breaks the shape. A walkthrough of how the logo on this site became chrome.
Three.js / WebGL / Design

The logo floating at the top of this site is the same SVG used everywhere else, extruded into 3D at runtime. No modelling software, no exported mesh. The identity stays exact because the geometry comes straight from the original paths.
From paths to shapes
Three.js ships an SVGLoader that parses SVG markup into paths, and each path can be turned into flat shapes, including holes:
import { SVGLoader } from 'three/examples/jsm/loaders/SVGLoader.js';
import * as THREE from 'three';
const data = new SVGLoader().parse(svgText);
const shapes = data.paths.flatMap((p) => SVGLoader.createShapes(p));
Extruding
ExtrudeGeometry pushes those shapes into depth and can add a bevel around the edges, which is what makes metal catch the light:
const geometry = new THREE.ExtrudeGeometry(shapes, {
depth: 64,
curveSegments: 20,
bevelEnabled: true,
bevelThickness: 7,
bevelSize: 3,
bevelOffset: 0,
bevelSegments: 5,
});
Then three small fixes:
- Flip it. SVG’s Y axis points down and Three.js’s points up, so the logo arrives upside down.
geometry.rotateX(Math.PI)fixes it. - Center it.
geometry.center()moves the origin to the middle so it rotates around itself, not its top-left corner. - Normalise the size. SVG units are arbitrary. Measure the bounding box and scale to a fixed height so the rest of the scene can rely on it.
The bug: a filled-in cutout
My first version used a negative bevelOffset to keep the bevelled logo the same visual size as the flat one. It looked fine until I zoomed in: one of the inner cutouts, a sharp chevron, was filled with a wedge of solid metal.
The cause is geometric. A negative offset pulls every edge inward. At a sharp inner point, the two edges pulled inward cross each other, and the outline intersects itself. The triangulation step can’t make sense of a self-intersecting outline, so it fills in an area that should be empty.
Setting bevelOffset: 0 and slightly reducing bevelSize fixed it. The general rule: if your shape has sharp inner corners, keep the bevel offset at zero. Compare a flat render of the SVG against the extruded one before you trust it.
Making it look like chrome
The material is MeshPhysicalMaterial with high metalness, low roughness and a clearcoat. But metal has no colour of its own; it only reflects its surroundings. Rather than load a heavy HDR photo, I built the environment from a few glowing rectangles and rings (drei’s Lightformer), in the site’s blue and violet. That gives crisp, on-brand reflections at almost no cost.
Cache it
Parsing and extruding happen once. The geometry is cached in a module-level variable and reused if the component remounts, and the flat SVG stays in the page as a fallback for devices without WebGL.