Has anyone successfully used the gridfinity-rebuilt library?

I’m attempting to leverage the gridfinity-rebuilt library, but it appears that MakerWorld is forcing an import of the example files.

The recommended import command is include <gridfinity-rebuilt-openscad/*.scad>;

This brings in the example. I cannot seem to circumvent this example and get to the actual .scad files used to create my own bins.

Has anyone had luck using this? What is the include or use command that got you just the modules to make your own gridfinity parts?

image

1 Like

Seems like one has to do the manual route around that and include every file except the example :confused:

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);
1 Like

Also, another option for building things with the gridfinity-rebuilt-openscad library is to use the example script, gridfinity-rebuilt-bins.scad, but overriding the defaults. If you just do the include by itself, you’ll get a 2x3 solid bin with a lip.

include <gridfinity-rebuilt-openscad/gridfinity-rebuilt-bins.scad>;

If you supply different params, you can alter how the bin is created. Look into the gridfinity-rebuilt-bins.scad file to see what all is set. In this example you’ll get a 4x4 solid bin:

include <gridfinity-rebuilt-openscad/gridfinity-rebuilt-bins.scad>;

gridx = 4;
gridy = 4;

However, overriding the base options doesn’t seem to work. With this I would expect to get a 4x4 solid bin with base holes for magnets, but it doesnt seem to do anything:

include <gridfinity-rebuilt-openscad/gridfinity-rebuilt-bins.scad>;

gridx = 4;
gridy = 4;
refined_holes = false;magnet_holes = false;

(Sorry for spamming the thread with multiple posts, I keep finding things after posting)

The Parametric Model Maker was officially released on April 11th, 2024, and the gridfinity-rebuilt-openscad project has received a lot of updates since that date. Looking at the project as it existed then (commit 574d9dc) I would surmise that the MakerWorld version of gridfinity-rebuilt-openscad is from around that time period and doesn’t include all the more recent updates. This would explain my above question about why gridfinityBase parameters seem to be different.

So to tinker with either the gridfinity-rebuilt-bins file or the gridfinity-rebuilt-utility file, you need to reference the github repo at or about commit 574d9dc.

Thank you so much! I tried grabbing the gridfinity-rebuilt-utility.scad, but in src/core directory. I never thought to try referencing it from the top level. This makes life much easier!

1 Like