From: John Tsiombikas Date: Tue, 11 Oct 2016 13:06:16 +0000 (+0300) Subject: Merge branch 'master' of goat:git/antikythera X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=antikythera;a=commitdiff_plain;h=403be7663d7412d0937b1f611b63363213bb3766;hp=-c Merge branch 'master' of goat:git/antikythera --- 403be7663d7412d0937b1f611b63363213bb3766 diff --combined src/gear.cc index 44c04d3,e6a5491..6a34815 --- a/src/gear.cc +++ b/src/gear.cc @@@ -1,3 -1,4 +1,4 @@@ + #include #include #include "gear.h" #include "meshgen.h" @@@ -8,14 -9,14 +9,14 @@@ Gear::Gear( { pdist = 0; angle = 0; - nteeth = 42; - radius = 80; teeth_length = 5; thickness = 5; bevel = 1.5; init_angle = 0; xform_valid = false; + set_teeth(42, 10); + supergear = 0; mesh = 0; @@@ -78,11 -79,6 +79,11 @@@ float Gear::get_angular_offset() cons void Gear::set_teeth(int nt, float tooth_pitch) { + if(tooth_pitch <= 0) { + tooth_pitch = this->tooth_pitch; + } else { + this->tooth_pitch = tooth_pitch; + } float circ = tooth_pitch * nt; radius = circ / (2.0 * M_PI); nteeth = nt;