At first I didn't want to make this parametric, but then I decided to.
Update: 2D version added to generate DXF's