protected override Body GetCappingBody() { Point startOuter = StartCone.WrapPoint(0, GearData.AddendumRadius * internalGearODScale); Point endOuter = EndCone.WrapPoint(0, GearData.AddendumRadius * internalGearODScale); Point startKnee = StartCone.WrapPoint(0, -(1 + BevelKneeRatio) * GearData.Module); Point endKnee = EndCone.WrapPoint(0, -(1 + BevelKneeRatio) * GearData.Module); Point startCenter = Axis.ProjectPoint(startKnee).Point; Point endCenter = Axis.ProjectPoint(endKnee).Point; IList <ITrimmedCurve> cappingProfile = new Point[] { startCenter, startKnee, startOuter, endOuter, endKnee, endCenter }.AsPolygon(); IList <ITrimmedCurve> revolvePath = new ITrimmedCurve[] { CurveSegment.Create(Circle.Create(StartFrame, 1)) }; Body cappingBody = null; try { cappingBody = Body.SweepProfile(Plane.PlaneZX, cappingProfile, revolvePath); } catch { foreach (ITrimmedCurve curve in cappingProfile) { DesignCurve.Create(Part, curve); } } return(cappingBody); }
protected override void CreateAlignmentBodies(out Body addendumBody, out Body dedendumBody) { addendumBody = ShapeHelper.CreatePolygon(new Point[] { StartCone.WrapPoint(GearData.PitchAngle, GearData.AddendumRadius - GearData.PitchRadius), StartCone.WrapPoint(GearData.PitchAngle, 0), EndCone.WrapPoint(GearData.PitchAngle, 0), EndCone.WrapPoint(GearData.PitchAngle, EndScale * (GearData.AddendumRadius - GearData.PitchRadius)) }, 0); dedendumBody = ShapeHelper.CreatePolygon(new Point[] { StartCone.WrapPoint(0, GearData.BaseRadius - GearData.PitchRadius), StartCone.WrapPoint(0, 0), EndCone.WrapPoint(0, 0), EndCone.WrapPoint(0, EndScale * (GearData.BaseRadius - GearData.PitchRadius)) }, 0); }
protected override Body GetCappingBody() { Point startOuter = StartCone.WrapPoint(0, GearData.AddendumRadius * internalGearODScale); Point endOuter = EndCone.WrapPoint(0, GearData.AddendumRadius * internalGearODScale); Point startKnee = StartCone.WrapPoint(0, -(1 + HypoidKneeRatio) * GearData.Module * StartCone.Radius / A); Point endKnee = EndCone.WrapPoint(0, -(1 + HypoidKneeRatio) * GearData.Module * EndCone.Radius / A); Point startCenter = Axis.ProjectPoint(startKnee).Point; Point endCenter = Axis.ProjectPoint(endKnee).Point; CurveSegment startLine = CurveSegment.Create(startKnee, startOuter); CurveSegment endLine = CurveSegment.Create(endKnee, endOuter); ICollection <IntPoint <CurveEvaluation, CurveEvaluation> > intersections = startLine.IntersectCurve(endLine); IList <ITrimmedCurve> cappingProfile; if (intersections.Count > 0) { Point middlePoint = intersections.First().Point; cappingProfile = new Point[] { startCenter, startKnee, middlePoint, endKnee, endCenter }.AsPolygon(); } else { cappingProfile = new Point[] { startCenter, startKnee, startOuter, endOuter, endKnee, endCenter } }.AsPolygon();