Exemple #1
0
        /// <summary>
        /// Given we are meshed with another gear where this and
        /// the other gear might have a profile shift, calculate
        /// the contact length for the two gears
        /// </summary>
        /// <param name="meshedGear">The gear with which we are
        /// meshed</param>
        /// <returns>The length of the path along which the two
        /// gears are in contact before breaking apart</returns>

        public double ContactDistanceWithGear(GearParameters meshedGear)
        {
            if (!CanMeshWith(meshedGear))
            {
                Information = "Gears have differing modules or pressure angles";
                return(0);
            }
            double distanceBetweenCentres
                = PitchCircleDiameter / 2
                  + meshedGear.PitchCircleDiameter / 2
                  + Module * (ProfileShift + meshedGear.ProfileShift);
            double distToPitchPoint = distanceBetweenCentres
                                      * BaseCircleDiameter / (BaseCircleDiameter + meshedGear.BaseCircleDiameter);
            double meshedDistToPitchPoint = distanceBetweenCentres - distToPitchPoint;
            double contactLength
                = Math.Sqrt(Involutes.DiffOfSquares(distToPitchPoint, BaseCircleDiameter / 2))
                  - Math.Sqrt(SquaredUndercutRadius - Involutes.Square(BaseCircleDiameter / 2));
            double meshedContactLength
                = Math.Sqrt(Involutes.DiffOfSquares(meshedDistToPitchPoint, meshedGear.BaseCircleDiameter / 2))
                  - Math.Sqrt(meshedGear.SquaredUndercutRadius - Involutes.Square(meshedGear.BaseCircleDiameter / 2));

            return(contactLength + meshedContactLength);
        }
Exemple #2
0
        /// <summary>
        /// Calculate the sequence of cutout point sequences that make
        /// the spokes in the gear. Used to try and reduce the inertia
        /// of larger gears.
        /// </summary>
        /// <param name="spokes">The number of spokes to put between
        /// the gear hub and the teeth-bearing perimeter</param>
        /// <returns>The point lists that each make up the
        /// outline of the cutouts</returns>

        private List <List <PointF> > CalculateCutouts(int spokes)
        {
            List <List <PointF> > cutouts = new List <List <PointF> >();

            if (spokes < 3)
            {
                return(cutouts);
            }

            // Set some design constants

            double cornerRadius   = Gear.Module;
            double spokeThickness = 2.0 * Gear.Module;
            double minHubDiameter = 8 * Gear.Module;

            // Calculate the minimum hub diameter for a given number of
            // spokes, a specified spoke thickness and corner radius.

            double hubDiameter = (spokeThickness + 2 * cornerRadius)
                                 / Math.Sin(Math.PI / spokes) - cornerRadius;

            if (hubDiameter < minHubDiameter)
            {
                hubDiameter = minHubDiameter;
            }

            // Calculate the corner at the outer end of one side of a spoke.
            // For this reference spoke we assume the spoke runs along the
            // positive X axis. We shall rotate it for other spokes.

            double rimDiameter = Gear.InnerDiameter - 2.0 * spokeThickness;

            if (rimDiameter < hubDiameter + 4 * cornerRadius)
            {
                return(cutouts);
            }

            double cornerCentreY    = spokeThickness / 2 + cornerRadius;
            double rimCornerCentreX = Math.Sqrt
                                          (Involutes.DiffOfSquares(rimDiameter / 2 - cornerRadius, cornerCentreY));
            PointF rimCornerCentre           = Involutes.CreatePt(rimCornerCentreX, cornerCentreY);
            double angleAtRim                = Math.Atan2(cornerCentreY, rimCornerCentreX);
            IEnumerable <PointF> outerCorner = Involutes.CirclePoints
                                                   (-Math.PI / 2, angleAtRim, Involutes.AngleStep, cornerRadius, rimCornerCentre);

            // Calculate the corner at the inner end of a spoke.

            //double hubCornerCentreX = Math.Sqrt(Square(hubDiameter / 2 + cornerRadius)
            //    - Square(cornerCentreY));
            double hubCornerCentreX = Math.Sqrt
                                          (Involutes.DiffOfSquares(hubDiameter / 2 + cornerRadius, cornerCentreY));
            PointF hubCornerCentre = Involutes.CreatePt(hubCornerCentreX, cornerCentreY);
            double angleAtHub      = Math.Atan2(cornerCentreY, hubCornerCentreX);

            IEnumerable <PointF> innerCorner = Involutes.CirclePoints
                                                   (Math.PI + angleAtHub, 3.0 * Math.PI / 2, Involutes.AngleStep, cornerRadius, hubCornerCentre);

            // Calculate the outer rim circle segment

            IEnumerable <PointF> outerRimSegment = Involutes.CirclePoints
                                                       (angleAtRim, 2 * Math.PI / spokes - angleAtRim, Involutes.AngleStep, rimDiameter / 2);

            // Calculate the hub circle segment

            IEnumerable <PointF> hubSegment = Involutes.CirclePoints
                                                  (angleAtHub, 2 * Math.PI / spokes - angleAtHub, Involutes.AngleStep, hubDiameter / 2);

            // Calculate the far side of the cutout. Reflect the inner spoke
            // across the X axis, and reverse its points. Then rotate it round the gear
            // by the angle between adjacent spokes. This gives us the correct
            // list of points.

            IEnumerable <PointF> nearSide = innerCorner.Concat(outerCorner);
            IEnumerable <PointF> farSide  = GearParameters.ReflectY(nearSide)
                                            .Select(p => Involutes.RotateAboutOrigin(2 * Math.PI / spokes, p))
                                            .Reverse();

            // Now create the lists of points for each of the cut outs

            List <PointF> cutout = new List <PointF>();

            cutout.AddRange(nearSide);
            cutout.AddRange(outerRimSegment);
            cutout.AddRange(farSide);
            cutout.AddRange(hubSegment.Reverse());
            cutout = Involutes.LinearReduction(cutout, (float)Gear.MaxError);
            cutouts.Add(cutout);
            for (int i = 1; i < spokes; i++)
            {
                cutouts.Add(new List <PointF>(cutout.Select
                                                  (p => Involutes.RotateAboutOrigin(2 * Math.PI * i / spokes, p))));
            }
            return(cutouts);
        }