I’ve been messing with this too, but have had some slight success.
If you want to build your own bin, you need to include
the path to the utility scad file that contains gridfinityInit
. The rebuilt library normally has this file in src/core/gridfinity-rebuilt-utility.scad
, but for some reason MakerWorld has moved the file to the top level. So this works:
include <gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad>;
gridfinityBase(1, 4, 42, 0, 0, 1);
gridfinityInit(1, 4, height(5), 0);
One thing that puzzles me is that the above gridfinityBase
module is different from what I expect. If you look at the official documentation it looks the same as the above (note how the first two params are the grid size, passed in as two separate params.
However if you look in the utility file itself, gridfinityBase
has a different format (note that the grid size is a single parameter, passed in as a vector):
// ===== Modules ===== //
/**
* @brief Create the base of a gridfinity bin, or use it for a custom object.
* @param grid_size Number of bases in each dimension. [x, y]
* @param grid_dimensions [length, width] of a single Gridfinity base.
* @param thumbscrew Enable "gridfinity-refined" thumbscrew hole in the center of each base unit. This is a ISO Metric Profile, 15.0mm size, M15x1.5 designation.
*/
module gridfinityBase(grid_size, grid_dimensions=GRID_DIMENSIONS_MM, hole_options=bundle_hole_options(), off=0, final_cut=true, only_corners=false, thumbscrew=false) {
If I try the above format in the parametric model maker, it throws an error and the base is never rendered.
I assume this must be something I’m doing wrong, or don’t understand about the OpenSCAD language.
A final thing to point out: the parametric model maker will mask/hide errors. This shows a failure to the screen:
include <gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad>;
gridfinityBase([1,4]);
However this doesn’t:
include <gridfinity-rebuilt-openscad/gridfinity-rebuilt-utility.scad>;
gridfinityBase([1,4]);
gridfinityInit(1, 4, height(5), 0);