Ortho-planar springs are springs that can undergo a large displacement in either directionwithout (much) rotation. They've got all sorts of practical applications.
This .scad (library with ortho_planar_spiral_spring() module) will generate a flat, ortho-planar spiral spring of whatever size and shape you want. It takes a number of options and there's a bunch of examples in the file so it should be pretty easy to figure out.
I recommend inspecting your springs layer by layer in your slicer before printing because it's real easy to make springs that have walls that are too thin for your 3D printer.
I've found that PETG works great for this style of spring if you don't need it to last more than ~200 cycles or so. If you want it to last I recommend using something with a more robust fatigue index like Nylon or PCTPE (which I've tested and works great--even though it's not as "springy" as PETG).
The author marked this model as their own original creation. Imported from Thingiverse.