kennetek / gridfinity-rebuilt-openscad

A ground-up rebuild of the stock gridfinity bins in OpenSCAD
Other
1.15k stars 166 forks source link

Make scoop radius customizable #60

Closed cibernox closed 1 year ago

cibernox commented 1 year ago

I wanted to maximize the space inside my bins as well as making them faster to print and use less plastic. I found that having a scoop is an absolute must for small parts in small bins, but at the same time it doesn't need to be a huge one like the default design. As long as the corner of the box is not a hard 90° pretty small spoons work fairly well.

I am now printing my boxes with a spoon 25% of the original and I'm find it almost as confortable as the 100% one. I made it a customizable parameter. I attach some screenshots.

100% spoon radius (the default)

Screenshot 2023-01-31 at 20 55 41

50% spoon radius (works just as well as the original for me

Screenshot 2023-01-31 at 20 55 54

25% spoon radius (works almost as well as the original, but good enough for me)

Screenshot 2023-01-31 at 20 56 08

You can also put values over 100% for a bigger radius if you really want.

Ruudjhuu commented 1 year ago

So this would possibly close #55

I really like the idea and the effort, however, I would like to see a absolute value instead off a reference value. 100% of what exactly? @kennetek do you know why the initial scoop calculation is this complex with this many magic numbers? Are we trying to be compatible with the original design? If not, I would suggest just one absolute value for the scoop which can be set in the UI. Even if we try to be compatible, maybe still have the absolute value as it would be an improvement of the original design in my opinion.

cibernox commented 1 year ago

I don't think we have to try to be compatible with the original design for the scoop, as it's an internal feature that doesn't interfere with the base or other bins. We can do whatever we want with it. About the calculation of the scoop, I don't think it can be an absolute value because it seems to be a function of the dimensions of the bin or division. Smaller bins and compartments have smaller radiuses automatically.

The approach that I took, which seemed the simplest, is to multiply that complex calculation (which I don't fully understand) for a number smaller than 1 to reduce the radius, and for a number bigger than 1 to increase it. And since support for decimal points in open-scad UI is pretty bad, it seemed more user friendly to use a percentage.

The end goal is that users don't have to choose between no scoop at all and one scoop that is really big and makes the bin slower and more expensive to print.

cibernox commented 1 year ago

Any more feedback on this PR?

cibernox commented 1 year ago

Solves #55

kennetek commented 1 year ago

I like this idea. I'll break down the formula: scoop = s ? ... : 0; Toggles the scoop on or off (...-r_f2) Since the cutter uses a convex hull with a sphere to get the rounded edges that produce the other internal fillets, that fillet radius needs to be subtracted beforehand. length/2*... the scoop radius is dependent on the bin size. since its a sphere, its divided by 2. This is the same as Zack does in his Fusion file. (($dh-2)/7+1)/6 In Zack's Fusion file, this value is the bin height. However, Zack's file uses a deprecated unit system. In that file, a 6u bin is "1" tall. Originally, the height was also supposed to be in units of 42 instead of 7. My calculation is an artifact of converting my scripts internal heights from units to millimeters ($dh is the millimeter height of the bin). I'm guessing the "-2" is to account for the lip (incorrectly), it gets divided by 7 to convert to a unit height, adds 1 for fun (???), then divides by 6 to convert to Zack's deprecated system. This code blip is definitely not good, and should be something more elegant.

After looking at Zack's Fusion file again, I think his intention was the fillet diameter would be equal to the bin height.

Referenced calculation: scoop = s ? (length*(($dh-2)/7+1)/12-r_f2) : 0;

better formula, maybe? (might be inaccurate): scoop = s ? $dh/2-r_f2 : 0;

Since the scoop radius's ideal value is dependent on the height of the bin, I think the approach of having a multiplier is the most effective way of allowing user customization.

cibernox commented 1 year ago

@kennetek sorry I didn't follow up on this in time. Per you comment, it does seem that you agree that having a multiplier, like the one I implemented, is the most user-friendly way to customize the scoop. Therefore, is there anything else I should do in this PR?

cibernox commented 1 year ago

Great! Happy to be able to use main again and save filament.

kennetek commented 1 year ago

Fixed #55