We were tasked with writing code that could generate a 3D model for a lattice-structured lampshade with only a few parameters. The lampshade must be big enough to hold a tea light, but small enough to be 3D printed for a reasonable price.
We first hand-sketched the shape of our lampshade and determined the best parameters and equations to define it. Then, we wrote code to generate rings of a specified thickness and radius—arranged layer by layer—into our lampshade shape.
The resultant model is then rendered and exported as an STL. The user can generate a structure by inputting the inner radius (clearance for tea light), ring radius, ring thickness, and number of layers. Adjusting these values radically changes the shape of the lampshade, but the program ensures the final model is both spherical and printable.
The complete code is available on our GitHub repository.