/// <summary>
        /// <para>Method to get the Angle between the Last and 2nd Last position of the Upright</para>
        /// <para>At the end of the this method, the Upright is returned to its 2nd last position. This is because, in this method I cam literally stretching the Upright to a position defined by the <paramref name="_shimsOrLinkLine"/>'s End Point. This is not True. In actuality the Upright is
        /// rotated when the <paramref name="_shimsOrLinkLine"/> is increase/decreased. So the Upright needs to be Rotated by the angle calculated and then the <paramref name="_shimsOrLinkLine"/>'s End Point shoud be set using
        /// <see cref="GetLinkLengthChangeFromUprightAngle(List{Line}, SetupChangeDatabase, CurrentChange, AdjustmentTools)"/> and an iterative loop should be formed until the <paramref name="_shimsOrLinkLine"/> is of length which the user wants</para>
        /// </summary>
        /// <param name="_upright">List of Upright Triangles belonging to <see cref="SetupChangeDatabase"/> with UBJ[0] LBJ[1] and ToeLink[2] </param>
        /// <param name="_vertex1">This could be any of the other 3 points. Remeber UBJ[0] LBJ[1] and ToeLink[2] while passing c</param>
        /// <param name="_vertex2">This could be any of the other 3 points. Remeber UBJ[0] LBJ[1] and ToeLink[2] while passing  </param>
        /// <param name="_vertex3">This could be any of the other 3 points. Remeber UBJ[0] LBJ[1] and ToeLink[2] while passing</param>
        /// <param name="_scd"></param>
        /// <returns></returns>
        public Angle GetNewUprightTrianglePosition(ref List <Triangle> _upright, Point3D _vertex1, Point3D _vertex2, Point3D _vertex3, SetupChangeDatabase _scd, Line _axisOfRotation)
        {
            Angle rotatedAngle = new Angle(0, AngleUnit.Radians);


            _upright.Add(new Triangle(new Point3D(_vertex1.X, _vertex1.Y, _vertex1.Z),
                                      new Point3D(_vertex2.X, _vertex2.Y, _vertex2.Z),
                                      new Point3D(_vertex3.X, _vertex3.Y, _vertex3.Z)));


            for (int i = 0; i < _upright.Count; i++)
            {
                _upright[i].Regen(0);
            }

            rotatedAngle = SetupChangeDatabase.AngleInRequiredView(new MathNet.Spatial.Euclidean.Vector3D(_upright[_upright.Count - 1].Normal.X, _upright[_upright.Count - 1].Normal.Y, _upright[_upright.Count - 1].Normal.Z),
                                                                   new MathNet.Spatial.Euclidean.Vector3D(_upright[_upright.Count - 2].Normal.X, _upright[_upright.Count - 2].Normal.Y, _upright[_upright.Count - 2].Normal.Z),
                                                                   Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Longitudinal));

            //rotatedAngle = SetupChangeDatabase.AngleInRequiredView(new MathNet.Spatial.Euclidean.Vector3D(_upright[_upright.Count - 1].Normal.X, _upright[_upright.Count - 1].Normal.Y, _upright[_upright.Count - 1].Normal.Z),
            //                                           new MathNet.Spatial.Euclidean.Vector3D(_upright[_upright.Count - 2].Normal.X, _upright[_upright.Count - 2].Normal.Y, _upright[_upright.Count - 2].Normal.Z),
            //                                           Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Vertical));

            rotatedAngle = SetupChangeDatabase.AngleInRequiredView(new MathNet.Spatial.Euclidean.Vector3D(_upright[_upright.Count - 1].Normal.X, _upright[_upright.Count - 1].Normal.Y, _upright[_upright.Count - 1].Normal.Z),
                                                                   new MathNet.Spatial.Euclidean.Vector3D(_upright[_upright.Count - 2].Normal.X, _upright[_upright.Count - 2].Normal.Y, _upright[_upright.Count - 2].Normal.Z),
                                                                   Custom3DGeometry.GetMathNetVector3D(/*_scd.LBJToToeLink.Line.DeltaLine[_scd.LBJToToeLink.Line.DeltaLine.Count - 1]*/ _axisOfRotation));

            ///<summary>Reverting the Upright to its original state so it can rotated and brought to the right state</summary>
            _upright[_upright.Count - 1] = (new Triangle(new Point3D(_upright[_upright.Count - 2].Vertices[0].X, _upright[_upright.Count - 2].Vertices[0].Y, _upright[_upright.Count - 2].Vertices[0].Z),
                                                         new Point3D(_upright[_upright.Count - 2].Vertices[1].X, _upright[_upright.Count - 2].Vertices[1].Y, _upright[_upright.Count - 2].Vertices[1].Z),
                                                         new Point3D(_upright[_upright.Count - 2].Vertices[2].X, _upright[_upright.Count - 2].Vertices[2].Y, _upright[_upright.Count - 2].Vertices[2].Z)));

            return(rotatedAngle);
        }
Exemple #2
0
        /// <summary>
        /// Method to construct the Bisector 2
        /// </summary>
        private void ConstructBisector2()
        {
            ///<summary>Drawing the Line of the <see cref="PlaneSTEERING"/></summary>
            Line LineForAngle_PlaneSTEERING = new Line(InstantAxis.MidPoint.Clone() as Point3D, ToeLinkupright.Position.Clone() as Point3D);

            ///<summary>Drawing the Line of the Wishbone Plane depending upon the <see cref="LinkagePair"/></summary>
            Line LineForAngle_PlaneWISHBONE = new Line(0, 0, 0, 1, 1, 1);

            if (LinkagePair == BobillierPair.BottomWishboneAndSteering)
            {
                LineForAngle_PlaneWISHBONE = new Line(InstantAxis.MidPoint.Clone() as Point3D, LBJ_Rear.Position.Clone() as Point3D);
            }
            else if (LinkagePair == BobillierPair.TopWishboneAndSteering)
            {
                LineForAngle_PlaneWISHBONE = new Line(InstantAxis.MidPoint.Clone() as Point3D, UBJ_Rear.Position.Clone() as Point3D);
            }

            ///<summary>Finding the Angle of the Steering Plane with the selected Wishbone Plane </summary>
            Angle Angle_PlaneSTEERING_PlaneWISHBONE = SetupChangeDatabase.AngleInRequiredView(_vAngleOfThis: Custom3DGeometry.GetMathNetVector3D(LineForAngle_PlaneSTEERING),
                                                                                              _vAngleWithThis: Custom3DGeometry.GetMathNetVector3D(LineForAngle_PlaneWISHBONE),
                                                                                              _vNormalToViewPlane: Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.StartPoint, InstantAxis.EndPoint)));

            //Angle_PlaneSTEERING_PlaneWISHBONE = AssignAngleSignBasedOnVectorDirection(Angle_PlaneSTEERING_PlaneWISHBONE, Custom3DGeometry.GetMathNetVector3D(new Line(ICLine.StartPoint, ICLine.EndPoint)));
            ///<summary>Creating a Bisector Line</summary>
            Bisector2 = LineForAngle_PlaneWISHBONE.Clone() as Line;
            Bisector2.Rotate(angleInRadians: Angle_PlaneSTEERING_PlaneWISHBONE.Radians / 2, axis: new Vector3D(InstantAxis.StartPoint.Clone() as Point3D, InstantAxis.EndPoint.Clone() as Point3D), center: InstantAxis.MidPoint);
            //cad1.viewportLayout1.Entities.Add(Bisector2);
        }
Exemple #3
0
        /// <summary>
        /// Method to Construct the <see cref="PlaneB"/> and <see cref="PointB"/>
        /// </summary>
        private void ConstructPlaneBAndPointB()
        {
            ///<summary>Calculating the angle between the <see cref="PlaneRED"/> and the <see cref="Bisector2"/></summary>
            Angle Angle_Bis2_PlaneRED = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(LineForAngle_PlaneRED),
                                                                                Custom3DGeometry.GetMathNetVector3D(Bisector2),
                                                                                Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.StartPoint, InstantAxis.EndPoint)));

            ///<summary>Calculating the angle between the <see cref="PlaneRED2"/> and the <see cref="Bisector2"/></summary>
            Angle Angle_Bis2_PlaneRED2 = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(LineForAngle_PlaneRed2),
                                                                                 Custom3DGeometry.GetMathNetVector3D(Bisector2),
                                                                                 Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.StartPoint, InstantAxis.EndPoint)));

            ///<summary>Depending on which of the above 2 angles is smaller the final angle called <see cref="Angle_Bis2_Final_PlaneREDs"/> is assigned</summary>
            if (Math.Abs(Angle_Bis2_PlaneRED.Degrees) < Math.Abs(Angle_Bis1_PlaneRED.Degrees))
            {
                Angle_Bis2_Final_PlaneREDs = Angle_Bis2_PlaneRED;
                PlaneToConstructPlaneB     = PlaneRED.Clone() as Plane;
            }
            else
            {
                Angle_Bis2_Final_PlaneREDs = Angle_Bis2_PlaneRED2;
                PlaneToConstructPlaneB     = PlaneRED2.Clone() as Plane;
            }

            ///<summary>Rotating the <see cref="PlaneToConstructPlaneB"/> by an amount equal to twice the final angle calculated above</summary>
            PlaneToConstructPlaneB.Rotate(-Angle_Bis2_Final_PlaneREDs.Radians * 2, new Vector3D(InstantAxis.StartPoint, InstantAxis.EndPoint), InstantAxis.MidPoint);

            ///<summary>Depending upon the Position of <see cref="PointA"/> the <see cref="SegmentForPointB"/> is decided</summary>
            if (PointAPos == PositionOfPointA.AboveWishbones)
            {
                SegmentForPointB = new Segment3D(LBJ_Rear.Position, ToeLinkupright.Position);
            }
            else if (PointAPos == PositionOfPointA.BelowWishbones)
            {
                SegmentForPointB = new Segment3D(UBJ_Rear.Position, ToeLinkupright.Position);
            }

            ///<summary>Computing the Intersection between the <see cref="SegmentForPointB"/> and the <see cref="PlaneToConstructPlaneB"/> which results in the <see cref="PointB"/></summary>
            SegmentForPointB.IntersectWith(PlaneToConstructPlaneB, true, out PointB);

            ///<summary>Depending upon whether the <<see cref="PointA"/> is above or below the Wishbones, the Points to draw <see cref="PlaneB"/> (apart from <see cref="PointB"/>!!!) are chosen</summary>
            if (PointAPos == PositionOfPointA.AboveWishbones)
            {
                PlaneB = new Plane(BottomRearInboard.Position, BottomFrontInboard.Position, PointB);
            }
            else if (PointAPos == PositionOfPointA.BelowWishbones)
            {
                PlaneB = new Plane(TopRearInboard.Position, TopFrontInboard.Position, PointB);
            }

            PlanarEntity PlaneB_Ent = new PlanarEntity(PlaneB);
            Joint        PointB_Ent = new Joint(PointB, 5, 2);

            PointB_Ent.Color = Color.AntiqueWhite;
            //cad1.viewportLayout1.Entities.AddRange(new Entity[] { PlaneB_Ent, PointB_Ent });
        }
        public void LinkLengthChanged(double _dLinkLength, Plane _linksPlane, List <Line> _link, List <Vector3D> _linnkVector, List <Line> _counterLink, SetupChangeDatabase _scd, SolverMasterClass _smc)
        {
            AddAdjusterToMasterAdjusterList(_link, _linnkVector);

            Custom3DGeometry _counter = new Custom3DGeometry(new Point3D(_counterLink[_counterLink.Count - 1].StartPoint.X, _counterLink[_counterLink.Count - 1].StartPoint.Y, _counterLink[_counterLink.Count - 1].StartPoint.Z),
                                                             new Point3D(_counterLink[_counterLink.Count - 1].EndPoint.X, _counterLink[_counterLink.Count - 1].EndPoint.Y, _counterLink[_counterLink.Count - 1].EndPoint.Z));

            Angle FV = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(_counter.ViewLines.FrontView.DeltaLine[_counter.ViewLines.FrontView.DeltaLine.Count - 1]),
                                                               Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Vertical),
                                                               Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Longitudinal));

            FV = new Angle(90 + FV.Degrees, AngleUnit.Degrees);

            _counter.PerpAlongY.Aft.Translate(_counterLink[_counterLink.Count - 1].MidPoint.X - _counterLink[_counterLink.Count - 1].StartPoint.X,
                                              _counterLink[_counterLink.Count - 1].MidPoint.Y - _counterLink[_counterLink.Count - 1].StartPoint.Y,
                                              _counterLink[_counterLink.Count - 1].MidPoint.Z - _counterLink[_counterLink.Count - 1].StartPoint.Z);


            Triangle SV = new Triangle(_link[_link.Count - 1].StartPoint, _link[_link.Count - 1].EndPoint, _counterLink[_counterLink.Count - 1].StartPoint);

            SV.Regen(0);

            Angle test = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(_counter.PerpAlongY.Aft),
                                                                 new MathNet.Spatial.Euclidean.Vector3D(SV.Normal.X, SV.Normal.Y, SV.Normal.Z),
                                                                 Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Lateral));

            _counter.PerpAlongY.Aft.Rotate(FV.Radians, Custom3DGeometry.GetdevDeptVector3D(_scd.WheelCentreAxis.Longitudinal));
            _counter.PerpAlongY.Aft.Rotate(test.Radians, Custom3DGeometry.GetdevDeptVector3D(_scd.WheelCentreAxis.Lateral));

            Angle testAngleRotatate = new Angle(_dLinkLength / _counterLink[_counterLink.Count - 1].Length(), AngleUnit.Radians);

Start:
            _counterLink[_counterLink.Count - 1].Rotate(testAngleRotatate.Radians, Custom3DGeometry.GetdevDeptVector3D(_counter.PerpAlongY.Aft));
            _link[_link.Count - 1].EndPoint.X = _counterLink[_counterLink.Count - 1].EndPoint.X;
            _link[_link.Count - 1].EndPoint.Y = _counterLink[_counterLink.Count - 1].EndPoint.Y;
            _link[_link.Count - 1].EndPoint.Z = _counterLink[_counterLink.Count - 1].EndPoint.Z;

            double staticLength = _link[0].Length();
            double newLenggth   = _link[_link.Count - 1].Length();

            double checker = _dLinkLength - (_link[_link.Count - 1].Length() - _link[0].Length());

            if (Math.Abs(checker) > 0.5)
            {
                AddAdjusterToMasterAdjusterList(_link, _linnkVector);
                double testCounter = _counterLink[_counterLink.Count - 1].Length();
                testAngleRotatate = new Angle((checker / _counterLink[_counterLink.Count - 1].Length()), AngleUnit.Radians);
                goto Start;
            }
        }
Exemple #5
0
        /// <summary>
        /// Method to construct the <see cref="Bisector1"/>
        /// </summary>
        private void ConstructBisector1()
        {
            ///<summary>Creating 2 temporay Lines to represent the Top and Bottom Wishbones. Need this to find the angle between the Top and Bottom Wishbone Planes</summary>
            Line LineForAngle_TopWishbone    = new Line(InstantAxis.MidPoint.Clone() as Point3D, UBJ_Rear.Position.Clone() as Point3D);
            Line LineForAngle_BottomWishbone = new Line(InstantAxis.MidPoint.Clone() as Point3D, LBJ_Rear.Position.Clone() as Point3D);

            ///<summary>Calculating the Line between the Top and Bottom Wishbone Planes by calculating the angle between the Lines created above</summary>
            Angle angle = (SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.MidPoint, UBJ_Rear.Position)), Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.MidPoint, LBJ_Rear.Position)),
                                                                   Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.StartPoint, InstantAxis.EndPoint))));

            ///<summary>Drawing a line alonge the LBJ Line </summary>
            Bisector1 = new Line(InstantAxis.MidPoint.Clone() as Point3D, LBJ_Rear.Position.Clone() as Point3D);
            ///<summary>Rotating the Bisector Line by twice the amount of half the angle of the angle between the Top and Bottom Wishbone Planes</summary>
            Bisector1.Rotate(angle.Radians / 2, new Vector3D(InstantAxis.StartPoint.Clone() as Point3D, InstantAxis.EndPoint.Clone() as Point3D), InstantAxis.MidPoint);
            //cad1.viewportLayout1.Entities.Add(Bisector1);
        }
        //private void InitUprightBasedOnAdjustmentTool(Dictionary<string, AdjustmentTools> _adjToolDictionary, SetupChangeDatabase _scd)
        //{
        //    if (_adjToolDictionary["CamberChange"] == AdjustmentTools.TopCamberMount)
        //    {
        //        GetNewUprightTrianglePosition(ref _scd.UprightTriangle, TopCamberShimsLine[TopCamberShimsLine.Count - 1].EndPoint, _scd.LBJ, _scd.ToeLinkUpright, _scd);
        //    }
        //    else if (_adjToolDictionary["CamberChange"] == AdjustmentTools. BottomCamberMount)
        //    {

        //    }


        //}

        /// <summary>
        /// Method to get a Vector and Line which represent the group of Shims.These maybe camber shims at the Camber Mount or Link Shims at the Wishbone Arms (or Toe Link) Obtained by drawing a line at the UBJ or LBJ on the Wishbone Plane and then making it parallel in the
        /// Top View with the Wheel Spindle
        /// </summary>
        /// <param name="_scmPlane"></param>
        /// <param name="_scd"></param>
        /// <param name="_camberShimsLine"></param>
        /// <param name="_camberShimsVector"></param>
        /// <param name="_wishbonePlane"></param>
        /// <param name="_UBJorLBJ"></param>
        private void InitializeShimsGeometry(SuspensionCoordinatesMaster _scmPlane, SetupChangeDatabase _scd, List <Line> _camberShimsLine, List <Vector3D> _camberShimsVector, Plane _wishbonePlane, Point3D _UBJorLBJ)
        {
            ///<summary>Creating a temp line to represent the Camber Shims Line and will added to the <see cref="BottomCamberShimsLine"/> OR <see cref="TopCamberShimsLine"/></summary>
            ///<remarks>
            ///COordinate are passed as (0,0) and (5,0). This is becase the <see cref="TopWishbonePlane"/> and <see cref="BottomWishbonePlane"/> have the UBJ and LBJ as their origins.
            ///Hence, you need to pass 0,0 and 5,0 so that the Camber Line starts at UBJ and extends by 5 in X direction
            ///</remarks>
            Line _tempCamberShimsLine = new Line(_wishbonePlane, /*_UBJorLBJ.X*/ 0, /*_UBJorLBJ.Z*/ 0, /*_UBJorLBJ.X + */ 5, /*_UBJorLBJ.Z*/ 0);


            Angle angle = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(new Line(_tempCamberShimsLine.StartPoint.X, 0, _tempCamberShimsLine.StartPoint.Z, _tempCamberShimsLine.EndPoint.X, 0, _tempCamberShimsLine.EndPoint.Z)),
                                                                  Custom3DGeometry.GetMathNetVector3D(new Line(_scd.WheelSpindle.Line.DeltaLine[0].StartPoint.X, 0, _scd.WheelSpindle.Line.DeltaLine[0].StartPoint.Z,
                                                                                                               _scd.WheelSpindle.Line.DeltaLine[0].EndPoint.X, 0, _scd.WheelSpindle.Line.DeltaLine[0].EndPoint.Z)),
                                                                  Custom3DGeometry.GetMathNetVector3D(_scd.WheelCentreAxis.Vertical));

            _tempCamberShimsLine.Rotate(-angle.Radians, _tempCamberShimsLine.StartPoint, new Point3D(_tempCamberShimsLine.StartPoint.X, _tempCamberShimsLine.StartPoint.Y + 100, _tempCamberShimsLine.StartPoint.Z));

            _camberShimsLine.Add(_tempCamberShimsLine);

            _camberShimsVector.Add(new Vector3D(new Point3D(_tempCamberShimsLine.StartPoint.X, _tempCamberShimsLine.StartPoint.Y, _tempCamberShimsLine.StartPoint.Z), new Point3D(_tempCamberShimsLine.EndPoint.X, _tempCamberShimsLine.EndPoint.Y, _tempCamberShimsLine.EndPoint.Z)));
        }
        /// <summary>
        /// Method to Initialize all the Adjustment tools and decide which the Master Adjusters are going to be
        /// </summary>
        /// <param name="scm"></param>
        /// <param name="scd"></param>
        /// <param name="adjToolDictionary">Dictionary which is initialized with all the <see cref="AdjustmentTools"/> the user has selected for each Setup Change</param>
        public AdjustmentOptions(SuspensionCoordinatesMaster scm, SetupChangeDatabase scd, Dictionary <string, AdjustmentTools> adjToolDictionary, SetupChange_CornerVariables sccv)
        {
            TopWishbonePlane = new Plane(new Point3D(scm.F1x, scm.F1y, scm.F1z), new Point3D(scm.A1x, scm.A1y, scm.A1z), new Point3D(scm.B1x, scm.B1y, scm.B1z));

            TopFrontArm.Add(new Line(new Point3D(scm.A1x, scm.A1y, scm.A1z), new Point3D(scm.F1x, scm.F1y, scm.F1z) /*scd.UBJ*/));

            TopFrontVector.Add(new Vector3D(TopFrontArm[TopFrontArm.Count - 1].StartPoint, TopFrontArm[TopFrontArm.Count - 1].EndPoint));

            TopRearArm.Add(new Line(new Point3D(scm.B1x, scm.B1y, scm.B1z), new Point3D(scm.F1x, scm.F1y, scm.F1z) /*scd.UBJ*/));

            TopRearVector.Add(new Vector3D(TopRearArm[TopRearArm.Count - 1].StartPoint, TopRearArm[TopRearArm.Count - 1].EndPoint));

            BottomWishbonePlane = new Plane(new Point3D(scm.E1x, scm.E1y, scm.E1z), new Point3D(scm.D1x, scm.D1y, scm.D1z), new Point3D(scm.C1x, scm.C1y, scm.C1z));

            BottomFrontArm.Add(new Line(new Point3D(scm.D1x, scm.D1y, scm.D1z), new Point3D(scm.E1x, scm.E1y, scm.E1z) /*scd.LBJ*/));

            BottomFrontArmVector.Add(new Vector3D(BottomFrontArm[BottomFrontArm.Count - 1].StartPoint, BottomFrontArm[BottomFrontArm.Count - 1].EndPoint));

            BottomRearArm.Add(new Line(new Point3D(scm.C1x, scm.C1y, scm.C1z), new Point3D(scm.E1x, scm.E1y, scm.E1z) /*scd.LBJ*/));

            BottomRearArmVector.Add(new Vector3D(BottomRearArm[BottomRearArm.Count - 1].StartPoint, BottomRearArm[BottomRearArm.Count - 1].EndPoint));

            MToeAdjusterLine.Add(new Line(new Point3D(scm.N1x, scm.N1y, scm.N1z), new Point3D(scm.M1x, scm.M1y, scm.M1z) /*scd.ToeLinkUpright*/));

            MToeAdjusterVector.Add(new Vector3D(MToeAdjusterLine[MToeAdjusterLine.Count - 1].StartPoint, MToeAdjusterLine[MToeAdjusterLine.Count - 1].EndPoint));

            PushrodLine.Add(new Line(new Point3D(scm.J1x, scm.J1y, scm.J1z), new Point3D(scm.G1x, scm.G1y, scm.G1z)));

            PushrodVector.Add(new Vector3D(PushrodLine[PushrodLine.Count - 1].StartPoint, PushrodLine[PushrodLine.Count - 1].EndPoint));

            InitializeShimsGeometry(scm, scd, TopCamberShimsLine, TopCamberShimsVector, TopWishbonePlane, scd.UBJ);

            InitializeShimsGeometry(scm, scd, BottomCamberShimsLine, BottomCamberShimsVector, BottomWishbonePlane, scd.LBJ);

            //InitUprightBasedOnAdjustmentTool(adjToolDictionary, scd);

            AssignMasterAdjusters(sccv, adjToolDictionary, scd);
        }
Exemple #8
0
        /// <summary>
        /// Method to construct the <see cref="PlaneRED"/> and the <see cref="PlaneRED2"/>
        /// </summary>
        private void ConstructPlaneREDs()
        {
            ///<summary>Constructing the <see cref="PlaneRED"/> using the <see cref="InstantAxis"/> and the <see cref="PointA"/></summary>
            PlaneRED = new Plane(InstantAxis.StartPoint.Clone() as Point3D, InstantAxis.EndPoint.Clone() as Point3D, PointA.Clone() as Point3D);
            ///<summary>Constructing the Line of the <see cref=PlaneRED"/> needed for the angle</summary>
            LineForAngle_PlaneRED = new Line(InstantAxis.MidPoint.Clone() as Point3D, PointA.Clone() as Point3D);

            ///<summary>Computing the <see cref="Angle"/> between the <see cref="PlaneRED"/> and the <see cref="Bisector1"/></summary>
            Angle_Bis1_PlaneRED = SetupChangeDatabase.AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(LineForAngle_PlaneRED), Custom3DGeometry.GetMathNetVector3D(Bisector1),
                                                                          Custom3DGeometry.GetMathNetVector3D(new Line(InstantAxis.StartPoint, InstantAxis.EndPoint)));

            ///<summary>Cloning <see cref="PlaneRED"/> onto <see cref="PlaneRED2"/> and creating its line</summary>
            PlaneRED2 = PlaneRED.Clone() as Plane;
            LineForAngle_PlaneRed2 = LineForAngle_PlaneRED.Clone() as Line;

            ///<summary>Rotating the <see cref="PlaneRED2"/> and its <see cref="LineForAngle_PlaneRed2"/> by an amount equal to twice the Angle b/w <see cref="Bisector1"/> and <see cref="PlaneRED"/></summary>
            PlaneRED2.Rotate(-Angle_Bis1_PlaneRED.Radians * 2, new Vector3D(InstantAxis.StartPoint.Clone() as Point3D, InstantAxis.EndPoint.Clone() as Point3D), InstantAxis.MidPoint);
            LineForAngle_PlaneRed2.Rotate(-Angle_Bis1_PlaneRED.Radians * 2, new Vector3D(InstantAxis.StartPoint.Clone() as Point3D, InstantAxis.EndPoint.Clone() as Point3D), InstantAxis.StartPoint);

            PlanarEntity PlaneRED_Ent  = new PlanarEntity(PlaneRED);
            PlanarEntity PlaneRED2_Ent = new PlanarEntity(PlaneRED2);
            //cad1.viewportLayout1.Entities.AddRange(new Entity[] { PlaneRED_Ent, PlaneRED2_Ent });
        }
        /// <summary>
        /// <para>Method to the get the change in link length (or Shimslength) using the latest Position of the Upright Triangle</para>
        /// <para>This method will be used for both Gettting the Link Length because of making an angle change with direct user input in the form of Angle OROROR
        /// will be used for an iterative loop approach when the user has requested a length change. Since I don't have a method like Solidworks to constrain the sides of the upright triangle, I will increase the link length long itself thereyby stretching the upright and finding the angle</para>
        /// <para>Then I will return thr upright to its original postion and rotate it about that angle and use this method to get the new length and end point of the LinkLength Line. This will continue iteratively until the i get the length required by the user</para>
        /// </summary>
        /// <param name="_linkOrShimLine">List of the ShimsLine or LinkLine </param>
        /// <param name="_scd"></param>
        /// <param name="_currentChange"></param>
        /// <param name="_adjTool"></param>
        /// <param name="_vIndexUpright">This is the Index of the Vertices of the Upright which the method should Consider. Remeber UBJ[0] LBJ[1] and ToeLink[2] while passing </param>
        /// <returns></returns>
        public double GetLinkLengthChangeFromUprightAngle(List <Line> _linkOrShimLine, List <Vector3D> _linkOrShimVector, SetupChangeDatabase _scd, int _vIndexUpright)
        {
            double latestLinkLengthChange = 0;

            _linkOrShimLine[_linkOrShimLine.Count - 1].EndPoint = new Point3D(_scd.UprightTriangle[_scd.UprightTriangle.Count - 1].Vertices[_vIndexUpright].X,
                                                                              _scd.UprightTriangle[_scd.UprightTriangle.Count - 1].Vertices[_vIndexUpright].Y,
                                                                              _scd.UprightTriangle[_scd.UprightTriangle.Count - 1].Vertices[_vIndexUpright].Z);

            latestLinkLengthChange = _linkOrShimLine[_linkOrShimLine.Count - 1].Length() - _linkOrShimLine[0].Length();

            _linkOrShimVector[_linkOrShimVector.Count - 1] = new Vector3D(new Point3D(_linkOrShimLine[_linkOrShimLine.Count - 1].StartPoint.X, _linkOrShimLine[_linkOrShimLine.Count - 1].StartPoint.Y, _linkOrShimLine[_linkOrShimLine.Count - 1].StartPoint.Z),
                                                                          new Point3D(_linkOrShimLine[_linkOrShimLine.Count - 1].EndPoint.X, _linkOrShimLine[_linkOrShimLine.Count - 1].EndPoint.Y, _linkOrShimLine[_linkOrShimLine.Count - 1].EndPoint.Z));
            return(latestLinkLengthChange);
        }
 /// <summary>
 /// Method to assign the KPI Master Adjuster
 /// </summary>
 /// <param name="_adjToolDictionary">tionary which is initialized with all the <see cref="AdjustmentTools"/> the user has selected for each Setup Change</param>
 private void AssignKPIAdjuster(SetupChange_CornerVariables _sccv, Dictionary <string, AdjustmentTools> _adjToolDictionary, SetupChangeDatabase _scd)
 {
     if (_sccv.kpiAdjustmentTool == AdjustmentTools.TopFrontArm || _sccv.kpiAdjustmentTool == AdjustmentTools.DirectValue)
     {
         _adjToolDictionary["KPIChange"] = _sccv.kpiAdjustmentTool;
         MKPIAdjusterLine   = TopFrontArm;
         MKPIAdjusterVector = TopFrontVector;
         AxisRotation_KPI   = _scd.LBJToToeLink.Line.DeltaLine;
         UprightIndexForKPI = 0;
     }
     else if (_sccv.kpiAdjustmentTool == AdjustmentTools.TopRearArm)
     {
         _adjToolDictionary["KPIChange"] = _sccv.kpiAdjustmentTool;
         MKPIAdjusterLine   = TopRearArm;
         MKPIAdjusterVector = TopRearVector;
         AxisRotation_KPI   = _scd.LBJToToeLink.Line.DeltaLine;
         UprightIndexForKPI = 0;
     }
     else if (_sccv.kpiAdjustmentTool == AdjustmentTools.BottomFrontArm)
     {
         _adjToolDictionary["KPIChange"] = _sccv.kpiAdjustmentTool;
         MKPIAdjusterLine   = BottomFrontArm;
         MKPIAdjusterVector = BottomFrontArmVector;
         AxisRotation_KPI   = _scd.UBJToToeLink.Line.DeltaLine;
         UprightIndexForKPI = 1;
     }
     else if (_sccv.kpiAdjustmentTool == AdjustmentTools.BottomRearArm)
     {
         _adjToolDictionary["KPIChange"] = _sccv.kpiAdjustmentTool;
         MKPIAdjusterLine   = BottomRearArm;
         MKPIAdjusterVector = BottomRearArmVector;
         AxisRotation_KPI   = _scd.UBJToToeLink.Line.DeltaLine;
         UprightIndexForKPI = 1;
     }
 }
 private void AssignToeAdjuster(SetupChangeDatabase _scd)
 {
     AxisRotation_Toe = _scd.SteeringAxis.Line.DeltaLine;
 }
 /// <summary>
 /// Method to assing the Camber Master Adjuster
 /// </summary>
 /// <param name="_adjToolDictionary">tionary which is initialized with all the <see cref="AdjustmentTools"/> the user has selected for each Setup Change</param>
 private void AssignCamberAdjust(SetupChange_CornerVariables _sccv, Dictionary <string, AdjustmentTools> _adjToolDictionary, SetupChangeDatabase _scd)
 {
     if (_sccv.camberAdjustmentTool == AdjustmentTools.TopCamberMount || _sccv.camberAdjustmentTool == AdjustmentTools.DirectValue)
     {
         MCamberAdjusterLine   = TopCamberShimsLine;
         MCamberAdjusterVector = TopCamberShimsVector;
         AxisRotation_Camber   = _scd.LBJToToeLink.Line.DeltaLine;
         _sccv.AdjToolsDictionary["CamberChange"] = _sccv.camberAdjustmentTool;
         UprightIndexForCamber = 0;
     }
     else if (_sccv.camberAdjustmentTool == AdjustmentTools.BottomCamberMount)
     {
         MCamberAdjusterLine   = BottomCamberShimsLine;
         MCamberAdjusterVector = BottomCamberShimsVector;
         AxisRotation_Camber   = _scd.UBJToToeLink.Line.DeltaLine;
         _sccv.AdjToolsDictionary["CamberChange"] = _sccv.camberAdjustmentTool;
         UprightIndexForCamber = 1;
     }
 }
        /// <summary>
        /// Method to Assign the Master Adjusters based on the <see cref="AdjustmentTools"/> which the user has selected for each SetupChange
        /// </summary>
        /// <param name="adjToolDictionary">tionary which is initialized with all the <see cref="AdjustmentTools"/> the user has selected for each Setup Change</param>
        internal void AssignMasterAdjusters(SetupChange_CornerVariables sccv, Dictionary <string, AdjustmentTools> adjToolDictionary, SetupChangeDatabase scd)
        {
            AssignCamberAdjust(sccv, adjToolDictionary, scd);

            AssignToeAdjuster(scd);

            AssignCasterAdjuster(sccv, adjToolDictionary, scd);

            AssignKPIAdjuster(sccv, adjToolDictionary, scd);

            AssignRideHeightAdjuster(adjToolDictionary);
        }