Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce redudancy when defining boards #2

Closed
dragetd opened this issue Dec 24, 2017 · 2 comments
Closed

Reduce redudancy when defining boards #2

dragetd opened this issue Dec 24, 2017 · 2 comments

Comments

@dragetd
Copy link

dragetd commented Dec 24, 2017

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. :-)

@ubitux
Copy link
Owner

ubitux commented Dec 25, 2017

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.

@dragetd
Copy link
Author

dragetd commented Dec 26, 2017

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants