Customizable Chain Link

Chain link which is customizable for amount of links, type (if the chain loops back into itself, or is straight), and how close the links are to each other (leave at 5, normally). I found part of source code online (on the OpenSCAD github wiki), but I changed it enough to be significantly different.
It probably won't print without a lot of supports (it has floating sections), and plastic isn't a recommended material for chains.
It may have to be scaled up/down, but that is a simple operation on a slicing program.
Currently, each link is about 4mm diameter on the ends, and is about 24mm from one end to another (approx. 17mm the short way)
None of this is by any means accurate; however, a person 3d printing a plastic chain probably doesn't need accuracy (or strength, for that matter).
A stretch of 0, or a number of links below 8, causes links in some configurations to fuse together. If problems occur, try setting stretch to 5, and the links to a large even number.
Straight chains can have any number of links without causing problems, however, stretch levels at either extreme may cause fusing of links.
About quality: Thingiverse's server works really slow in terms of rendering. The quality of the rendered parts may not be ideal. I built in a quality selection selector that would work if thingiverse was faster, but it isn't fast enough- in my testing, a 20 link circular piece would take about an hour- overloading their server, and making it take longer for everyone else. The .scad file includes a quality selector, to run on computers that have OpenSCAD installed; however, some may not want to do this. Some high resolution models are available (10 link straight, 20 link circle), so that they can be downloaded immediately, without waiting for processing. Otherwise, the normal quality setting will be fine (most printers don't even have the detail to distinguish between different resolutions), and it will take only a few minutes.

First 2 gallery photos: High Resolution (Quality setting: 30. Note that this is different then $fn if you want to download OpenSCAD and adjust it)
Second 2 gallery photos: Normal Resolution (Generated with Customizer, which chooses a decent quality setting, with good speed. See the gallery models. This is the quality you will see when you customize it. If you aren't happy with this, download a high resolution pre-made file, or use OpenSCAD for more fine adjustments.)