Updated gear module to correctly display error message when neither circular_pitch or diametral_pitch parameters are

specified.  Previous method of testing for false value did not work because circular_pitch is reassigned and becomes undef
when diametral_pitch is false.
This commit is contained in:
gizmoplex 2015-12-05 13:30:33 -05:00
parent 5ff8ce964c
commit 73909f3a0f

View file

@ -310,7 +310,8 @@ module gear (
involute_facets=0, involute_facets=0,
flat=false) flat=false)
{ {
if (circular_pitch==false && diametral_pitch==false) // Check for undefined circular pitch (happens when neither circular_pitch or diametral_pitch are specified)
if (circular_pitch==undef)
echo("MCAD ERROR: gear module needs either a diametral_pitch or circular_pitch"); echo("MCAD ERROR: gear module needs either a diametral_pitch or circular_pitch");
//Convert diametrial pitch to our native circular pitch //Convert diametrial pitch to our native circular pitch