LATTICE PLAYGROUND
Web-based prototype for generating a lattice structure inside a closed 2D shape and viewing it as a 3D mesh. The shape is drawn as a closed Bezier path on a 300 mm square board, and the lattice is built from that outline. Three cell types are available: Voronoi cells from a regularized point set, Delaunay triangles, and an adaptive quadtree grid. Cell size, strut width, rounding, height and rim width can be set as constants or driven by grayscale maps painted with a brush. The material is the union of struts and rim, clipped to the shape, and the result is extracted as contour loops and turned into a mesh with a height field. The prototype shows the structure in a 2D outline view and a shaded 3D view with orbit controls. It can be used for design exploration, teaching, prototyping and 3D printing, and it exports STL and SVG files and saves or loads the full state as JSON.

LIVE : https://code.turboflip.de/run/8d49c6860b0fa09f/
CODE : https://code.turboflip.de/p/8d49c6860b0fa09f
- Version: v0.1
- Closed Bezier shape editor with anchors, handles, presets and point insertion
- Voronoi, Delaunay and quadtree grid cell types
- Grayscale maps drive cell size, strut width, rounding, height and rim width
- Airbrush painting with size, hardness, flow and blur mode
- Marching squares contour extraction and mesh generation with height field
- 3D preview with orbit controls, shadows and top view
- STL and SVG export, JSON save and load
- Tech: HTML, CSS, JavaScript, Three.js 0.170.0, OrbitControls, Delaunator 5.0.1, WebGL
- Requires: WebGL-capable browser, internet connection for Three.js loaded from a CDN