Omni 3D SVG supports .svg icons as well as .ttf, .otf, and .woff font files.
Standalone ES Module / Global window.OmniSVG3D Reference
{
mode: 'auto', // 'auto' | 'stroke' | 'fill'
density: 'medium', // 'low' (fast/low-poly) | 'medium' (balanced) | 'high' (3D print/close-up)
compressGeometry: true, // Boolean — welds & indexes shared vertices (~60% smaller files)
thickness: 1.8, // Number (0.1 - 10.0) — 3D extrusion depth in canonical units
strokeWidth: 2.0, // Number (0.5 - 6.0) — 2D stroke offset width (on 24px basis)
bevelEnabled: true, // Boolean — enables 3D edge beveling
bevelSize: 0.24, // Number (0.0 - 0.55) — bevel width
bevelThickness: 0.24, // Number (0.0 - 0.55) — bevel z-depth
bevelSegments: 5, // Integer (1 = flat chamfer, 2-8 = smooth rounded fillet)
curveSegments: 28, // Integer — base curve subdivision steps
creaseAngle: 38, // Number (degrees) — smooth shading threshold on side walls
color: '#18181b', // Hex string — mesh color (or volume attenuation tint on glass)
useSvgColor: false, // Boolean — preserves per-path native SVG fill/stroke colors
materialPreset: 'clay', // 'clay' | 'plastic' | 'metallic' | 'rough-glass' | 'glass'
environment: 'studio', // 'studio' | 'city' | 'dawn' | 'forest' | 'lobby'
badge: 'none', // 'none' | 'circle' | 'squircle' | 'square'
fitToBadge: true, // Boolean — scales icon by 0.72x to sit neatly inside badge
wireframe: false // Boolean — renders triangle wireframe overlay
}
window.OmniSVG3D)await OmniSVG3D.createMesh(svgString, config?)
Parses any raw <svg> string, performs 2D Clipper stroke expansion & boolean union, and returns a centered THREE.Group ready to add to your scene.
await OmniSVG3D.createTextMesh(text, { fontName, fontUrl, fontBuffer, letterSpacing, lineHeight, align, ...config })
Converts single or multi-line text (\n) into vector glyph paths via opentype.js (using preloaded font or automatic fallback to DEFAULT_FONT_URL) and returns a 3D THREE.Group.
await OmniSVG3D.preloadFont(urlOrArrayBuffer, cacheKey?)
Preloads and caches any .ttf, .otf, or .woff font from a URL or ArrayBuffer for instant text generation.
await OmniSVG3D.exportGLB(svgOrObject3D, config?, { download: true, filename: 'icon.glb' })
Generates a binary .glb Blob (with physical materials intact) from either a raw SVG string or an existing THREE.Object3D.
await OmniSVG3D.exportSTL(svgOrObject3D, config?, { download: true, filename: 'icon.stl' })
Generates a watertight binary .stl Blob ready for 3D printing slicers.
const viewer = OmniSVG3D.createViewer(domContainer, initialConfig?)
Mounts a complete interactive Three.js studio viewport. Exposes viewer.loadSVG(svg, cfg), viewer.loadText(text, opts), viewer.update(partialCfg), viewer.getMeshStats(), viewer.downloadGLB(), and viewer.downloadSTL().