lpe-gears.cpp revision aec1b94c999035922cd8c19878a4618883f5179b
#define INKSCAPE_LPE_DOEFFECT_STACK_CPP
/*
* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-gears.h"
#include <vector>
#include "nodepath.h"
using namespace Geom;
class Gear {
public:
// pitch circles touch on two properly meshed gears
// all measurements are taken from the pitch circle
// base circle serves as the basis for the involute toothe profile
// diametrical pitch
// height of the tooth above the pitch circle
// depth of the tooth below the pitch circle
// root circle specifies the bottom of the fillet between teeth
// outer circle is the outside diameter of the gear
// angle covered by the tooth on the pitch circle
int number_of_teeth() {return _number_of_teeth;}
_number_of_teeth = n;
_module = m;
_clearance = 0.0;
_angle = 0.0;
}
private:
int _number_of_teeth;
double _pressure_angle;
double _module;
double _clearance;
double _angle;
I = I*base_radius() + _centre;
return I;
}
B = B*R + _centre;
return B;
}
// angle of the base circle used to create the involute to a certain radius
double involute_swath_angle(double R) {
if (R <= base_radius()) return 0.0;
}
// angle of the base circle between the origin of the involute and the intersection on another radius
double involute_intersect_angle(double R) {
if (R <= base_radius()) return 0.0;
}
};
for(unsigned d=0;d<2;d++)
a[d][0][0] = b[d];
}
// angle covered by a full tooth and fillet
// angle covered by an involute
double involute_advance = involute_intersect_angle(outer_radius()) - involute_intersect_angle(root_radius());
// angle covered by the tooth tip
double tip_advance = tooth_thickness_angle() - (2 * (involute_intersect_angle(outer_radius()) - involute_intersect_angle(pitch_radius())));
// angle covered by the toothe root
// begin drawing the involute at t if the root circle is larger than the base circle
//rewind angle to start drawing from the leading edge of the tooth
for (int i=0; i < _number_of_teeth; i++)
{
D2<SBasis> leading_I = compose(_involute(cursor, cursor + involute_swath_angle(outer_radius())), Linear(involute_t,1));
cursor += tip_advance;
D2<SBasis> trailing_I = compose(_involute(cursor, cursor - involute_swath_angle(outer_radius())), Linear(1,involute_t));
if (base_radius() > root_radius()) {
prev = leading_end;
}
cursor += root_advance;
if (base_radius() > root_radius()) {
prev = trailing_end;
}
}
return pb;
}
double new_angle = 0.0;
return gear;
}
// #################################################################
namespace Inkscape {
namespace LivePathEffect {
phi(_("Phi"), _("Tooth pressure angle (typically 20-25 deg). The ratio of teeth not in contact."), "phi", &wr, this, 5)
{
/* 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
* are 20 and 25 degrees. The pressure angle affects the force that tends to separate mating
* gears. A high pressure angle means that higher ratio of teeth not in contact. However, this
* allows the teeth to have higher capacity and also allows fewer teeth without undercutting.
*/
}
{
}
{
// iterate through Geom::Curve in path_in
delete gear;
}
delete gear;
return path_out;
}
void
{
np->straight_path = true;
}
} // namespace LivePathEffect
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :