openscad / MCAD

OpenSCAD Parametric CAD Library (LGPL 2.1)
http://reprap.org/wiki/MCAD
578 stars 192 forks source link

Nutsandbolts rework #58

Closed dyanawu closed 5 years ago

dyanawu commented 5 years ago

This PR contains a collection of work on nuts_and_bolts:

MichaelAtOz commented 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.

dyanawu commented 5 years ago

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?

MichaelAtOz commented 5 years ago

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.

dyanawu commented 5 years ago

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.

dyanawu commented 5 years ago

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.

dyanawu commented 5 years ago

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.