Skip to content

Add chamfer to bin magnet cutout#180

Open
colinasmith wants to merge 3 commits intoLe0Michine:masterfrom
colinasmith:master
Open

Add chamfer to bin magnet cutout#180
colinasmith wants to merge 3 commits intoLe0Michine:masterfrom
colinasmith:master

Conversation

@colinasmith
Copy link
Copy Markdown

With the current design, the magnet hole diameter needs to be very precisely dialed in to get the right friction fit. This pull request adds a chamfer that makes the hole diameter more forgiving. There are two parameters controlling the chamfer in the XY and Z directions. They default to 0 mm. If either is 0 mm, no chamfer is added.

Screenshot 2025-12-14 at 15 25 29 Screenshot 2025-12-14 at 15 25 45

Because bins are made so much more often, I only added this functionality to the bin generator. It could also be added to the baseplate generator.

offset: A distance offset on the extrude
taperAngle: A taper angle on the extrude

The default values of these parameters ensure that existing usage of this function is not affected.
To make friction fit magnet insertion more forgiving. This adds two chamfer parameters to the bin magnet cutout. In they UI they are:

Magnet cutout chamfer XY
Magnet cutout chamfer Z

If either is set to 0.0, which is the default, then the chamfer is turned off. I use 0.2 mm for XY and 1.0 for Z.
The UI state initialization logic caused saved user settings to be overwritten by hardcoded defaults upon command startup because it applied hardcoded defaults after loading the saved settings.

This change corrects the behavior by:
1. Modifying initValue to only set a default if a value is not already present in the state.
2. Reordering initDefaultUiState to load saved settings before applying hardcoded defaults.

This ensures that saved user preferences are correctly loaded and respected, and that newly added parameters (like the magnet chamfers) are properly initialized.
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.

1 participant