=== modified file 'src/live_effects/lpe-gears.cpp' --- src/live_effects/lpe-gears.cpp 2016-09-04 15:36:39 +0000 +++ src/live_effects/lpe-gears.cpp 2016-09-04 19:35:32 +0000 @@ -212,7 +212,8 @@ LPEGears::LPEGears(LivePathEffectObject *lpeobject) : Effect(lpeobject), teeth(_("_Teeth:"), _("The number of teeth"), "teeth", &wr, this, 10), - phi(_("_Phi:"), _("Tooth pressure angle (typically 20-25 deg). The ratio of teeth not in contact."), "phi", &wr, this, 5) + phi(_("_Phi:"), _("Tooth pressure angle (typically 20-25 deg). The ratio of teeth not in contact."), "phi", &wr, this, 5), + min_radius(_("Min Radius:"), _("Minimun radius, low balues can slow"), "min_radius", &wr, this, 5.0) { /* Tooth pressure angle: The angle between the tooth profile and a perpendicular to the pitch * circle, usually at the point where the pitch circle meets the tooth profile. Standard angles @@ -223,8 +224,10 @@ teeth.param_make_integer(); teeth.param_set_range(3, 1e10); - registerParameter( dynamic_cast(&teeth) ); - registerParameter( dynamic_cast(&phi) ); + min_radius.param_set_range(0.01, 9999.0); + registerParameter(&teeth); + registerParameter(&phi); + registerParameter(&min_radius); } LPEGears::~LPEGears() @@ -247,11 +250,13 @@ gear->angle(atan2((*it).initialPoint() - gear_centre)); ++it; - if ( it == gearpath.end() ) return path_out; - gear->pitch_radius(Geom::distance(gear_centre, (*it).finalPoint())); + if ( it == gearpath.end() ) return path_out; + double radius = Geom::distance(gear_centre, (*it).finalPoint()); + radius = radius < min_radius?min_radius:radius; + gear->pitch_radius(radius); path_out.push_back( gear->path()); - + for (++it; it != gearpath.end() ; ++it) { // iterate through Geom::Curve in path_in if (are_near((*it).initialPoint(), (*it).finalPoint())) { === modified file 'src/live_effects/lpe-gears.h' --- src/live_effects/lpe-gears.h 2015-04-27 23:39:29 +0000 +++ src/live_effects/lpe-gears.h 2016-09-04 19:30:30 +0000 @@ -27,6 +27,7 @@ private: ScalarParam teeth; ScalarParam phi; + ScalarParam min_radius; LPEGears(const LPEGears&); LPEGears& operator=(const LPEGears&);