ubitux / shimonbox

Semi-automatically generated 3D printable cases for development boards using OpenSCAD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reduce redudancy when defining boards

dragetd opened this issue · comments

Hey there,

currently adding one or two more boards. While doing this, I also thought about writing a little doc about how to add new boards.

I noticed that I had to put the board name at several places… like defining the base plate it needs an individual name. Then again I also need to add the board to the top-level file boards.scad.

I did not yet read through all the files completely, thus I do not fully understand why it needs to be defined at so many places. Maybe OpenSCAD has some functions to redcuce the redundancy at some points, thus making it easier to add new ones. When I find more specifig things, I will report back to this issue. :-)

The OpenSCAD language is pretty limited unfortunately. I tried my best to reduce the need for redundancy without the use of an external language, but typically modules and functions can not be mapped to each other (like, you can't have a function that points to a module). If you find a way of simplifying further, patches welcome.

Also, shimonbox provides boards and cases and you want to be able to use the board model only, without the case.

I should have written a doc on adding a board yes... so far only the blog post gives an overview (http://blog.pkh.me/p/24-making-development-board-cases-with-shimonbox.html)

Here is a quick & dirty howto:

  • create boards/<board>.scad following other .scad files in the same directory. This .scad is directly open-able with openscad.
  • if necessary, add the electronic components in electronics/<xxx>.scad. The .scad files are directly open-able with openscad.
  • register the board in boards.scad (include of boards/<board>.scad, mapping array to the info function, and the 2 modules entries)
  • create cases/<board>.scad following other .scad files in the same directory (this one should be pretty simple). This .scad is directly open-able with openscad.
  • if your board has button pushers, you want to register it in cases/Makefile (BOARDS_WITH_BUTTON_PUSHERS)
  • make -j$(nproc) gif will generate the gif (it may take some time)
  • edit the .md files to add the necessary entries (board, cases, electronics). This step could be automatized, but it lacks a description to extract from somewhere. Maybe a // @desc or whatever in the .scad files or whatever could do the trick (extracted with a grep or whatever).

Feel free to correct me if I forgot something.

Yes, I see why you did many things like you did. And I really agree with you on what you wrote in the blog post: OpenSCAD really needs some dev power to improve on a few things. =/

So I will close this issue.

Concerning the contributing guidelines: Will open a new issue once I got around to writing a first version. :)