fix magnet hole crush ribs: correct wave center radius and add param - #285
fix magnet hole crush ribs: correct wave center radius and add param#285cbrinker wants to merge 1 commit into
Conversation
…unt param The original implementation passed r=magnetDiameter/2 to cylinder_wavy, treating the intended hole radius as the wave CENTER. This caused the hole to oscillate ±crushDepth around the magnet diameter: at the wave peaks the hole was larger than the magnet (no grip), making the ribs ineffective. Instead we should use the passed magnet hole radius as the wave MAXIMUM, so the hole peaks exactly at the magnet diameter and the ribs press inward from there. Fix: use r = magnetDiameter/2 - magnetCrushDepth as the wave center, so the maximum radius equals magnetDiameter/2. The chamferedCylinder radius remains at magnetDiameter/2 - magnetCrushDepth*2 (the wave inner radius), keeping it inside the wavy shape while its entry flare guides the magnet in. Additional changes: - Add magnetCrushRibCount param (controls wave frequency; default 8) and wire it through CupBaseSettings and gridfinity_basic_cup.scad - Change default crush depth and chamfer from non-zero to 0 (feature off by default; existing users see no change unless they opt in) - Set Customizer step to 0.01 for crush depth and chamfer so values like 0.15 are directly enterable in the UI
|
Thanks for the PR. I think I implemented it so that the magnet diameter was in the centre of the wave amplitude. Half of the amplitude comes in to the magnet diameter, half crates a gap around the magnet. I thought this would be good as it would allow a little variance for the magnet. |
|
Correct, I tried a few test prints with your original implementation and they didn't work. I also tried a few test prints with https://github.com/kennetek/gridfinity-rebuilt-openscad/blob/910e22d8607fd7f5f51ad5e5cbc5287a76810bfd/src/core/gridfinity-rebuilt-holes.scad#L254 and my magnets fit in just fine. So, after investigating it a bit, I saw that your algo took the magnet dia and effectively grow and shrunk it across 8 cycles... whereas the other repo was only shrinking the hole dia down with crushable ribs. So, this PR is just making your algo match the one found in the other repo. |

The original implementation from #252 passed
r=magnetDiameter/2to cylinder_wavy, treating the intended hole radius as the wave CENTER. This caused the hole to oscillate ±crushDepth around the magnet diameter: at the wave peaks the hole was larger than the magnet (no grip), making the ribs ineffective.Instead we should use the passed magnet hole radius as the wave MAXIMUM, so the hole peaks exactly at the magnet diameter and the ribs press inward from there.
Fix: use
r = magnetDiameter/2 - magnetCrushDepthas the wave center, so the maximum radius equalsmagnetDiameter/2. The chamferedCylinder radius remains atmagnetDiameter/2 - magnetCrushDepth*2(the wave inner radius), keeping it inside the wavy shape while its entry flare guides the magnet in.Additional changes:
magnetCrushRibCountparam (controls wave frequency; default 8) and wire it throughCupBaseSettingsand gridfinity_basic_cup.scad