The filament swatch Rolodex by 3D Printy is a great idea! However, while printing a bunch of swatches, I found the file sometimes took minutes to render - which really slowed down my experimentation to find the right size and text for each swatch. So to learn some more SCAD and more deeply understand the model, I have done some significant code refactors on this file. This is a work in progress as I learn SCAD optimization techniques. There may be more performance gains in the future!
Initial load+preview(F5) times, on Windows 10 with OpenSCAD 2021.01 (YMMV), opened by double-clicking the .scad file:
Text change preview times, by adding a trailing ‘e’ to line 1 text and previewing:
Full render(F6) times after a fresh reload:
In this version, you will find:
["left", "center"].This file is licensed CC-Attribution, the same as the original file. Use it the same way you would have the original.
Refactor changelog:
width/2 calculations, and confusing Y and Z coordinates. Plus, it enables:translate call surrounding each object.fillet function to round corners, generates a 2D negative round instead of removing cubes and re-adding cylinders in 3D.Line_x_Position variables take the same values as the halign argument. Saved a bunch of code for relocating text, and each line is generated on exactly one line of code for easier modification.$fn used for extrusion to 32 - not a significant quality impact at Rolodex size. This has the biggest performance impact, but is not shipped by default - I printed with 100, and have not tested it yet. Control with the extrude_fn variable at the top.TODOs / investigations:
render() call give additional benefits?This was an interesting exercise in learning OpenSCAD! I hope someone can learn from seeing two different code approaches to the exact same model.
The author remixed this model.