Skip to content

Sliding lid exposing label#260

Open
wjcarpenter wants to merge 11 commits intoostat:mainfrom
wjcarpenter:sliding_lid_exposing_label
Open

Sliding lid exposing label#260
wjcarpenter wants to merge 11 commits intoostat:mainfrom
wjcarpenter:sliding_lid_exposing_label

Conversation

@wjcarpenter
Copy link
Contributor

@wjcarpenter wjcarpenter commented Feb 16, 2026

This is a full or partial fix for issue #132, depending on your point of view. It adds an option to provide a cutout that exactly matches a back wall label. Labels on other walls are not addressed. I was unclear on what label alignments "leftchamber", "centerchamber", and "rightchamber" did, so I treated them all the same as "center".

Here's an example of a 1x1 cup with a full-width standard sized pred label:

pred-full

Here is a 20mm wide normal label with center alignment:

normal-center

Here it is with left alignment:

normal-left

And here with right alignment:

normal-right

@ostat
Copy link
Owner

ostat commented Feb 16, 2026

I was unclear on what label alignments "containerleft", "containercenter", and "containerright" did, so I treated them all the same as "center".

The labels can be aligned to the bin or to the division. If you add divider walls it becomes clear.

Thanks for the PR.

@wjcarpenter
Copy link
Contributor Author

wjcarpenter commented Feb 16, 2026

Ah, I see it now. I was not treating width as gridfinity units, so things always spanned the entire width. I'll need at least a commit to fix that, and I might tinker with the "*chamber" alignments.

@wjcarpenter
Copy link
Contributor Author

wjcarpenter commented Feb 16, 2026

FWIW, I think there is a small bug in the label placement for "*chamber". It looks like they are shifted left a bit too far in both cases.

This image is a width of 0.60 and alignment of "leftchamber".

labelwrong

Same thing with "rightchamber" alignment.

labelwrong

and "centerchamber":

labelwrong

@wjcarpenter wjcarpenter marked this pull request as draft February 16, 2026 21:16
sliding_lid_lip_enabled);
sliding_lid_lip_enabled,
slidingLidExposesLabel = sliding_lid_exposes_label,
labelSettings = label_settings);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wont work with the latest code, due to how and where the SlidingLidSettings is created.
It's prob not ideal to add the label_settings to the slidingLidSetings anyway, as it creates a dependency issue.

My suggestion would be to pass label_settings, as a parameter to the function that needs it.

@ostat
Copy link
Owner

ostat commented Feb 16, 2026

I think to do this correctly, we need to use similar logic to create the label holes positions as what is used for the label positions.

First we would create the divider locations.

calculated_vertical_separator_positions = calculateSeparators(

Then we need to replicate the logic in gridfinity_label to use that data to position it correctly.
I think we could extract the positioning logic in to a separate module so it could be shared.

Alternatively, we could only support bin aligned labels which might will cover most cases needed and is a lot simpler.

One other thought, I added locking nubs to the lid, this might need to be repositioned, when there is a label cutout.

@wjcarpenter
Copy link
Contributor Author

For the last hour or so, I've been noodling with something along similar lines. Instead of trying to make that explicit extra cutout for the label(s) in SlidingLid(), I've been looking at generating the label footprint and then differencing that from the sliding lid. There is a difference() at the bottom of gridfinity_sliding_lid.scad that doesn't have any subtracted items. It's just begging for someone to put the footprint of the labels there. :-)

Subtracting out the label footprints does leave a nagging problem for multi-chamber cups. The chamber dividers would be left covered by the lid. Since they are pretty narrow, that's kind of undesirable.

But, as you noted, the current code structure makes all of complicated. It might be counterproductive for me to try to refactor all of that myself. (It would be pretty awesome if there were an IDE that had reliable refactoring for OpenSCAD files.)

@wjcarpenter
Copy link
Contributor Author

My suggestion would be to pass label_settings, as a parameter to the function that needs it.

I did a commit that moves it as suggested.

I'm not sure I'll be able to move forward on the alternate strategy (the label footprint) due to the large amount of refactoring and code churn that would be involved.

@wjcarpenter
Copy link
Contributor Author

I figured out a way to refactor things that isn't too brutal. I've got it working locally and will likely push the commit on Wednesday after some more testing.

@wjcarpenter
Copy link
Contributor Author

wjcarpenter commented Feb 18, 2026

The scheme is to find a footprint/projection for the actual labels. The calculations and logic in gridfinity_cup() are pretty complex, so I just added an additional parameter to gridfinity_cup() that determines whether it generates everything or just the labels themselves.

For the *chamber label placement, this can leave slivers where the partition walls show through:

slivers

That's not desirable. For the specific case of full-width labels on a single wall, I used a hull to get rid of those slivers:

hull

This implementation does not adjust the grooves or locking nubs for the sliding lid. It's desirable to make that adjustment (even though it doesn't matter for the stuff I create), but I left a TODO for somebody to look into that down the road.

I didn't do anything about the mis-aligned labels that I mentioned earlier in this thread. If someone fixes that, the fix will automatically be reflected here.

@wjcarpenter wjcarpenter marked this pull request as ready for review February 18, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants