We’re big fans of OpenSCAD here at Hackaday — it’s free and open source software, runs on pretty much anything, and the idea of describing objects via code seems like a natural fit for producing functional parts. Rather than clicking and dragging elements on the screen, you can knock out a quick bracket or other simple component with just a few lines of code. But one of the things we don’t often get a chance to showcase is the incredible potential of generating 2D and 3D objects algorithmically.
In a recent Reddit post, [ardvarkmadman] dropped an extremely impressive snippet of OpenSCAD code that he calls TerrainGen. In fewer than fifteen lines of code, it’s able to create randomized “islands” which range from simple plateaus to craggy mountain ranges. After dropping the code in the OpenSCAD editor, you can just keep hitting F5 until you get a result that catches your eye. This seems like an excellent way to generate printable terrain elements for gaming purposes, but that’s just one possibility.
Continue reading “Procedurally Generated Terrain In OpenSCAD”