-
Notifications
You must be signed in to change notification settings - Fork 11
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
RuggedBox baseplate dimensions appear to be incorrect? #6
Comments
@ndevenish Perhaps your cross-section view intersects a corner radius which would exaggerate the projected profile? |
No, it's not cut on a corner. Did you try a gridfinity bin that wasn't generated by this repository? The bins generated by this repository fit the box generated by this repository, but they don't match the gridfinity spec - they are narrower at the base; such that:
Here's a comparison of the imported STEP from Clearly - the wider yellow box won't descend past the matching upper slope of your boxes. Again - the gridfinity spec is this (gridfinity.xyz, also replicated here): I took a look at this after seeing someone complaining that they had printed a box from this repository without double checking and it wasn't at all compatible, e.g. wasted filament. |
The good news is that if the ruggedbox baseplate is fixed, then it will continue accepting all of the boxes generated before the fix. But, if you fix the bins then any bins generated after the fix will no longer fix the ruggedbox printed before the fix. So you might have to keep the bins as they are, just slightly out-of-spec, and just fix the bases. Or hope that not many people printed the box (which would be a pity, they look nice). |
The spec images you linked to are correct, the generated geometry isn't. Hmm, this is cadquery 2.4.0 off of conda-forge. I'll try working out how to get cadquery working inside a docker environment. |
Woah! That is way off! This deviation smells a lot like a sqrt(2) scaling issue...the profile for the boxes and baseplates is specified in terms of vertical offsets and angles. CadQuery performs extrusions in terms of vertical distance or vertical distance + taper angle. Therefore, if you have a taper angle (e.g. 45º), then you have to scale your offset accordingly. Thus, in cq-gridfinity, the profiles defined in |
I'm also unsure exactly which portion of the baseplate your view is of. None of the joints look like that on mine, they all look like my image above |
I'm trying downgrading CadQuery. |
I think I might be finding some more clues. It might be a my fault introducing a regression error by changing a function used by |
Confirmed that downgrading to cadquery 2.3.1 fixes the issue (and the label) |
I’m glad that it was neither of us going crazy, which I was starting to doubt for a moment there. |
@ndevenish Thanks for the catch on this. The error was indeed due to different versions of CadQuery/cq-kit/cq-gridfinity. A new version of |
FYI, this bug also explains the weird appearance of the label window too. Any feature which depended on multilevel extruded geometry would have been affected. |
I've tested repo HEAD on CQ 2.3.1 and 2.4.0. 2.3.1 works but it looks like I still get the same behaviour (for both) in CQ 2.4.0. I didn't test pypi directly as I had a struggle getting that to work initially (lack of arm wheels for... something in the dependency chain including cadquery - I initially tried to I haven't spent the time to work out exactly what this is doing, and have no idea if this aids debugging, but amending the change in that commit with: --- a/cqgridfinity/gf_obj.py
+++ b/cqgridfinity/gf_obj.py
@@ -313,9 +313,12 @@ class GridfinityObject:
p0 = profile[0][0] if isinstance(profile[0], (list, tuple)) else profile[0]
r = cq.Workplane(workplane).placeSketch(sketch).extrude(p0, taper=taper)
for level in profile[1:]:
+ print(f"Path taken on level {level}:")
if isinstance(level, (tuple, list)):
+ print(" Is tuple, list")
r = r.faces(">Z").wires().toPending().extrude(level[0], taper=level[1])
else:
+ print(" The Other Path")
r = r.faces(">Z").wires().toPending().extrude(level)
return r I get:
|
I would try the above test with generating simple 1x1 gridfinity bin. You should see the above trace with the expected gridfinity intervals for describing the bottom of a bin as well as describing the top lip. |
I even renamed before importing into fusion, in case it was doing any weird cacheing. happy to run a heavily annotated branch, if it would help |
Interesting. I run the exact same code with debug reporting as yours and it reports the same (correct) extrusion intervals. However, the generated STEP file I get is also correct; whereas yours is clearly not. Therefore, it must be something in CadQuery. FYI, I am runnning CQ 2.2.0. |
Found it! Looks like a change was made to CadQuery to compensate for extrusion height: CadQuery/cadquery#1383. This completely explains it. Looks like I will have to add some code to version check the CQ API and then determine if correction to vertical extrusion height is required or not. Stay tuned. |
@ndevenish I've committed cq-gridfinity v.0.4.4 with changes which should hopefully detect which version of CadQuery's extrusion method is active and therefore decide whether or not to apply compensation to the extruded profile. Can you please test with this update with CQ 2.4.0? |
I've updated a new version v.0.4.5 which (hopefully) finally fixes the extrusion angle errors independent of CadQuery version. |
Partial success, with a couple of roadbumps. Firstly:
Installing from the main branch of the cqkit repository gets past this. Then, the 1x1 bin generates successfully! It's probably close enough - certainly it will fit - but the geometry is still a bit strange; this is an orthographic axis-aligned projection:
However, I don't know if these are "Working as intended" features and thus unrelated to this version-shear issue. Anyhow, with the latest unreleased cqkit the RuggedBox still fails to generate:
Apologies, but I unfortunately don't have any more time to spend debugging this tonight, so am going to have to step away for a bit. |
@ndevenish Thanks so much for your help and testing--much appreciated. Looks like there are a couple more items to clean up (e.g. inconsistent imports from cq-kit). The marginally close geometry is likely due to round off residue in the SQRT2 scaling and is likely tolerable for almost all applications. The ruggedbox fillet issue is not one that I have seen, but I'll have a look--I suspect its dependency issue with CadQuery or cq-kit and might also have a platform dependency. |
A new version v.0.5.0 has been updated with various improvements to the rugged box. I am not sure if this will fix the "fillet" issue above (although that section of code has been changed to make it more robust). The biggest improvements are checks and automatic re-dimensioning of features such as the label, handles, etc. for boxes smaller than the original intended box size of 4U x 4U x 6U. cq-gridfinity can now make viable rugged boxes down to a minimum of 3U x 3U x 4U. The length x width minimum is bounded by the corner reinforcements and hinges and the height minimum is bounded by the function of the latch. |
v.0.5.1 now includes increased resolution for the vertical profiles of baseplates and bins. You should see better agreement of dimensions with the gridfinity specification. |
Yes! On main the geometry appears much cleaner now, and all of the joints just appear to be a single vertex after importing. thanks! |
I, however, appear to be hilariously cursed. This is running on the latest python:3.11 docker image. I get the same results running outside of a container, but I tried the container approach to guarantee a clean environment.
Commands I used to set up the environment:
|
@ndevenish Excellent--glad to hear all is ok! Thanks again for your help. @tehfishmann Since your issue seems to be confined to rendering the side handles of the rugged box, I would try to render a nearly featureless box first. This would at least sanity check that it is building something viable. Then, I would add features to see if and when it breaks. For example, to build the same 5x4x6 box with no features: ruggedbox 5 4 6 -e -v -s -c -a -p -l then add side clasps and stackability: ruggedbox 5 4 6 -e -v +s +c -a -p -l then add a handle and front label: ruggedbox 5 4 6 -e -v +s +c +a -p +l finally add the side handles: ruggedbox 5 4 6 +e -v +s +c +a -p +l Of course, you can change up the combo of features to experiment, but the idea is to see if it is some combo of features that results in a broken model which makes the addition of the side handles break. |
Appears to just be the side handles - generates just fine with |
@ndevenish The geometry has been optimized further (mainly on the inside) such that floor and lip intervals coincide with exact 7.00mm intervals. Furthermore, the lower bin draft terminates at 4.75 mm instead of 5.00 mm |
@tehfishmann Thanks for the tests. One thing that sticks out to me is that the V-grooves on the side walls are not correct. Can you please try to render version(s) of the box without V-grooves, i.e. using |
@tehfishmann For reference, this is the expected front view: |
@tehfishmann I've pushed a new release v.0.5.3 which removed a potential namespace collision when computing the height of boxes/bins. This might explain the unusual vertical placement of objects on the model; however, it is not definitive since theorectically the collision should not occur. In any case, worth a try if you have a moment. |
The behavior appears to be the same in 0.5.4; crash when using all features, no crash when removing sidehandles but then the vertical alignment is off. I did try disabling the vgroove and that fixes the height of the top surface, and doing so also allows the generation of the sidehandles. It would seem as though they are mutually exclusive at the moment. |
@tehfishmann Thanks for the update. I have just pushed a new release v.0.5.5 which might offer a fix for the ruggedbox--although I suspect it will remain the same. |
That actually seems to have fixed it! I examined 4 test cases and they all looked correct; all features, no side handles, no v-groove, and one with no handles and no v-groove all generated as expected. Thanks for all the work you put in on this, the models look really great |
@tehfishmann Excellent! Glad to hear it! Thanks for running the test cases to find clues to eventually make it work. @ndevenish If you folks are ok with the latest release in terms of addressing both the dimensional issues and the broken rugged box--feel free to close out the issue. Coincidentally, the root cause for both issues was the erroneous vertical extrusion scaling as a result of changes in CadQuery. Thankfully, this bug lead to optimizing the geometry so that it is completely compliant with the latest Gridfinity spec. |
Closing out this issue as resolved as of v.0.5.5. @ndevenish @tehfishmann Thanks again for your assistance. |
Standard sized bins don't fit. The overall spacing/dimensions match, but the shape of the base edges appears to be wrong.
Here I've imported the STEP into Fusion360, as compared to one of the bins generated by it's gridfinity plugin
Measuring the generated geometry:
vs the spec:
The text was updated successfully, but these errors were encountered: