SCAD clean up
It would be nice to do a big clean up of the SCAD.
What needs to be done
(Feel free to add to this)
Clean up SCAD file headers
Many of the scad file headers relate to old files that the new file has been copied from. We should:
-
Check each header is up to date with current content -
Remove the project description that is in some but not others -
Be clear what each file does
Clarify what parameters are used
Most files are hard to understand because the key parameters are not in the file itself. This is done for a good reason! But we should
-
Derived parameters should be functions -
Consider passing dictionaries through as arguments see !204 (merged)
Check parameters use is based on meaning:
The name of some parameters do no directly relate to what happens if you change them.
For example. Changing the sample_z optics modules rather than moving them up. This I am pretty sure makes them not functional.
-
Check parameter meanings -
Check function meanings
General code clean up
There is lots of never used code with sections saying this is not used any more" or "this option is redundant". There are also lots of bits of code commented out. For example:

-
Remove commented out code -
Remove unused code sections -
Check for modules defined multiple times -
Stop using the same name for variables and modules -
Stop using param=0 or param=-1 to mean undefined. Use undefandis_undef.
Formatting clean up
-
Replace tabs with 4 spaces -
Correctly break up really long lines (88 char width?)
Improve comments
-
Make sure all modules and all functions have a clear comment describing use -
Make sure comments are clear to a new dev. Many are vague and require significant knowledge of the rest of the code, or the design history. -
Move essential comments from folder README into scad. For example the camera folder has a README. However, if you start in a different scad file and just chase down scad modules in the code you never see this and you think it is all undocumented!
Edited by Julian Stirling