kennetek / gridfinity-rebuilt-openscad

A ground-up rebuild of the stock gridfinity bins in OpenSCAD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use

joshcomley opened this issue · comments

Before I continue:

  • I'm relatively new to OpenSCAD but have done quite a lot
  • I've read the docs

What is the correct way to use this to make custom Gridfinity prints?

I don't want to customise the git files because then pulling the latest becomes a bit of a nuisance.

But say I import gridfinity-rebuilt-baseplate.scad into my own .scad file, then the "implementation" section of gridfinity-rebuilt-baseplate.scad renders it out before I can tweak it. I can't modify the variables in my own .scad file. The only option seems to be to call it from the command line with the custom variables, which makes mathematical things tricky.

I would have expected something like this:

include <gridfinity-rebuilt-openscad\gridfinity-rebuilt-baseplate.scad>

gridfinityBaseplate(...);

To me it seems the modules and the default variables should be separated from another scad file that just imports the two and performs a render.

Happy to help with a PR for this.

Unless I'm fundamentally missing something?!

If I understand correctly, the intent of most of the files is to be (more) usable for the beginning user by utilising the "customizer" functionality. The expected utilisation method is this:

image

If you're a power user, you can use the code directly - as you seem to want to do. The easiest way to do that (in my opinion) is to treat the rebuilt-baseplate, -bin, etc. files as examples, and in your own file, either use <gridfinity-rebuilt-baseplate.scad> (as opposed to include), or even go straight to the source and include <gridfinity-rebuilt-utility.scad>

Does that clear it up a bit? I think there's a bit of an assumption made in the docs that you know what you're looking at, and it's just for reference...which isn't very helpful for a new user!

Perhaps a way to help with this would be to have a NEW USER, START HERE heading at the top?

I can say that I'm an expert user who doesn't generally remember that the customizer exists :) and I started by working directly with the code, importing the "bins" file it with use and setting up a module invocation to produce a bin, and it's not very friendly for direct use this way. The friendly parameters used by the customizer have cryptic abbreviations when calling the modules, and they lack (documented) defaults, but in particular, there is reliance on parameter passing through global variables (e.g. style_lip), so you cannot just use or include that file without having to modify it. If you want to use gridfinity-rebuilt-utility then you must use include because there is no way to set the required global parameter(s) with use. If global variable parameter passing is the strategy of choice, it would be better to use $ variables so that they can be set from outside. But generally I'd favor an API that does not use global variable parameter passing, but instead allows parts to be created by calls into the library with regular parameters. (If global $ variables are needed internally this can be hidden from the user.)

It's also unclear why the base call is a separate call. Does that enable some capability?

commented

I do fully agree with the global variables. I tried multiple times to get rid of it, but they are a big pain in the ass. Any pull request regarding improvements here are welcome. (also due to no proper tests (and this is very difficult in openscad), I am scared to touch some parts of the code).

Regarding the separate base call is to let the power-users decides for themselves what they want to put on the base. It does not have to be a bin with walls. Could also be a figure of Yoda if they like.