After playing with the previous model and hearing feedback, here is a new and improved example model and scripts.
IMPORTANT! When slicing, make sure that seams are not on the pins or inside the holes! Paint them on manually to ensure that.
Also for 100% infill I just set perimeters count to 20 and infill to 0%. This is cleaner and prints faster than rectilinear 100%.
Changes from previous model:
Script is kind of half baked and not too user friendly, but it works. I left some comments to help you out =)
To generate your own model, add the GenRings file to the Scripting view of an empty blender project then change values (they are in cm) on the bottom side of the file and hit play. IMPORTANT, first thing it does is deletes everything in project, so you can generate few times until you like the result.
Make sure you have changed the path on the top of the GenRings file.
For keychain to work make sure the path to link stl is correct.
I tried to print the chain as well, but with limited success, if you want to try make sure to use angled link stl.
Parameters for included model.
outer_radius = 2.5
ring_width = 0.4
pin_inset = ring_width * 0.6
tip_clearence = 0.06
side_clear = 0.08
ring_height = 0.5
gap = 0.07
num_of_rings = 4
vertices = 120
start_angle = 0
offset_angle = math.pi / 4
add_chain = True
chain_links = 0
The author remixed this model.