Closed dyanawu closed 5 years ago
This raises the ugly question of library versioning. Rolling this out with a new OpenSCAD would break designs based on the old sizes.
Most of the dimensions are similar; the 'breakage' would be in the change from using dimensions across flats instead of corners, and using corners would have resulted in nut traps in the sideways projection not trapping nuts, anyway. I'm not sure what the solution is, as I don't see a point in ensuring backward compat with a design that would have required further workaround.
Unless you meant something else, of course?
Presuming existing designs already implement a workaround, then they will be broken. I don't have an answer, it is another reason to think of the bigger picture for future OpenSCAD directions.
Yes, they will be. But 1) they get fixed because they're actively maintained / used 2) they are not actively maintained / used in which case...
The alternative is to continue working indefinitely around because of unwillingness to break any old designs at all.
And then in 5 years, some newbie who hasn't SCADded for years already (coughs) starts using this, and in a fit of "why in hell are these dimensions wrong", submits basically this same PR, and then that means the question, when it inevitably comes up again, will then relate to a much larger body of work, not that it's a small body now.
There does seem to be extra considerations due to MCAD being bundled with OpenSCAD; however, infinite backward compatibility does not seem feasible even if theoretically desirable.
An alternative is to add a parameter to use the AF dimensions instead, and should the code not pass the parameter for those, meaning suggestively that it was either written before this change or by someone who wasn't aware, then use the old code, and throw an echo to suggest use of AF dimensions, refer file for comments, etc.
This potentially maintains backcompat while nudging into (I think) better dimensions , and is only applicable to nut holes in general. Cap screw head dimensions are similar enough that the change only introduces standardisation.
Right, so now:
It does everything but existing code will throw a warning and build the same thing it used to build. Added another proj option to use the across flats dimensions.
This PR contains a collection of work on nuts_and_bolts:
update the dimension arrays to use ISO dimensions for nuts and cap screw heads I also chose to use across flat dimensions for nuts and use hexagons calculated from that dimension, instead of the existing circle ($fn = 6) so that nut traps are more functional.
default cap_extra_length to 0 in mcad_bolt_hole to avoid an undef warning
extend the cube in mcad_test_nuts_and_bolts_2 to show the entirety of the generated nut and bolt boles, as well as include the linear extrude for the nut hole
tidy up whitespace across the file