mirror of
https://github.com/CNCKitchen/stlTexturizer.git
synced 2026-04-07 22:11:32 +00:00
fb6e4d232c93f883151f8a18df93e7678dc0fd71
STL Texturizer
Live demo: https://cnckitchen.github.io/stlTexturizer/
A browser-based tool for applying surface displacement textures to STL files — no installation required.
Load any .stl file, pick a texture, tune the parameters, and export a new displaced STL ready for slicing.
Features
- Texture presets — 17 built-in seamless textures (basket, brick, bubble, carbon fiber, crystal, grip surface, hexagons, knitting, knurling, leather, noise, voronoi, weave variations, wood, and more)
- Custom textures — upload your own image as a displacement map
- Projection modes — Triplanar, Cubic (Box), Cylindrical, Spherical, Planar XY/XZ/YZ
- UV transform — independent U/V scale, offset, and rotation controls
- Displacement amplitude — fine-tune depth from subtle grain to deep relief
- Surface mask — skip horizontal top/bottom faces to keep flat surfaces clean
- Surface exclusions / inclusions — paint individual faces with a brush or bucket-fill to exclude or exclusively include them from displacement
- Live preview — real-time textured 3D preview with orbit/pan/zoom controls
- Mesh subdivision — auto-subdivides coarse geometry before displacement for smoother results
- Export — downloads a new binary STL with displacement baked in
- Light / Dark theme — persisted per browser
- Multilingual — English and German UI
Usage
- Open
index.htmlin a modern browser (Chrome, Edge, Firefox, Safari). - Drop an STL file onto the viewport or click Load STL….
- Select a texture preset from the sidebar (or upload a custom image).
- Adjust projection mode, UV scale, offset, rotation, and amplitude.
- Optionally mask or exclude surfaces with the brush/fill tools.
- Click Export STL to download the displaced mesh.
Note: All processing runs entirely in the browser — no data is uploaded to any server.
Project Structure
index.html # Main entry point
style.css # Styles (light/dark theme)
textures/ # Built-in JPG displacement map images
js/
main.js # App bootstrap & UI wiring
viewer.js # Three.js scene / camera / controls
stlLoader.js # Binary & ASCII STL parser
presetTextures.js # Built-in texture presets + custom upload
previewMaterial.js# Three.js material for live preview
mapping.js # UV projection logic
displacement.js # Vertex displacement baking
subdivision.js # Mesh subdivision
decimation.js # QEM mesh decimation
exclusion.js # Face exclusion / inclusion painting
exporter.js # Binary STL export
i18n.js # Translations (EN / DE)
Dependencies
Loaded via CDN — no build step needed:
- Three.js v0.170.0
License
MIT — see LICENSE.
Languages
JavaScript
87.2%
HTML
6.8%
CSS
6%