projects
/
antikythera
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of goat:git/antikythera
[antikythera]
/
src
/
gear.cc
diff --git
a/src/gear.cc
b/src/gear.cc
index
e6a5491
..
6a34815
100644
(file)
--- a/
src/gear.cc
+++ b/
src/gear.cc
@@
-9,14
+9,14
@@
Gear::Gear()
{
pdist = 0;
angle = 0;
{
pdist = 0;
angle = 0;
- nteeth = 42;
- radius = 80;
teeth_length = 5;
thickness = 5;
bevel = 1.5;
init_angle = 0;
xform_valid = false;
teeth_length = 5;
thickness = 5;
bevel = 1.5;
init_angle = 0;
xform_valid = false;
+ set_teeth(42, 10);
+
supergear = 0;
mesh = 0;
supergear = 0;
mesh = 0;
@@
-79,6
+79,11
@@
float Gear::get_angular_offset() const
void Gear::set_teeth(int nt, float tooth_pitch)
{
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;
float circ = tooth_pitch * nt;
radius = circ / (2.0 * M_PI);
nteeth = nt;