6 #include <gmath/gmath.h>
9 /* distance unit: millimeters
22 /* position in polar coordinates on the parent gear */
23 float pos_dist, pos_angle;
25 GearSlot *conn_slot; /* slot connection */
32 /* position in polar coordinates on the parent gear */
33 float pos_dist_min, pos_dist_max, pos_angle;
35 GearPin *conn_pin; /* pin connection */
43 void calc_matrix() const;
45 float contour(float u);
49 Vec3 pos, axis; /* implicitly defines a plane eqn. */
50 float pdist; /* derived: distance of plane from origin */
52 float init_angle; /* initial starting angle */
53 float angle; /* current angle of the gear */
55 int nteeth; /* number of teeth */
57 float radius; /* total radius of the gear, including teeth */
58 float teeth_length; /* how far teeth extend past the radius */
59 float thickness; /* thickness of the gear along the Z axis */
61 float bevel; /* bevel size */
63 std::vector<GearPin> pins;
64 std::vector<GearSlot> slots;
69 // sets the supplied number of teeth, and calculates the radius
70 // of the gear, to achieve the required tooth pitch
71 void set_teeth(int nt, float tooth_pitch);
73 float get_rotation() const;
75 // returns the angle (in radians) from one tooth to the next
76 float get_angular_pitch() const;