/// <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);
        }
        /// <summary>
        /// Method to initialize all the Axes involved in the wheel assembly.Called only once during 1st time initialization which happenes using <see cref="SetupChangeDatabase()"/> construction
        /// </summary>
        /// <param name="scm">Object of the SuspensionCoordinateMaster Class</param>
        public void InitializePointsAndVectors(SetupChange_CornerVariables sccv, SuspensionCoordinatesMaster scm, Dictionary <string, AdjustmentTools> adjToolDictionary)
        {
            ///<summary>Creating a vector out the Spindle End Coordinates so that I can use the Mathnet.Euclidean functions to calcualate its angles with respect to space</summary>
            WheelSpindle = new Custom3DGeometry(new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.L1x, scm.L1y, scm.L1z));

            ///<summary>Creating the contact patch point</summary>
            ContactPatch = new ChildPoint_VariablePoint(new Point3D(scm.W1x, scm.W1y, scm.W1z));

            ///<summary>Creatng the Ball Joints</summary>
            LBJ            = new Point3D(scm.E1x, scm.E1y, scm.E1z);
            UBJ            = new Point3D(scm.F1x, scm.F1y, scm.F1z);
            ToeLinkUpright = new Point3D(scm.M1x, scm.M1y, scm.M1z);

            ///<summary>Initializing axes passing through the wheel centre. These will be used to initialize other axes</summary>
            WheelCentreAxis = new StandardAxesLines(new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.K1x, scm.K1y, scm.K1z + 100),
                                                    new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.K1x + 100, scm.K1y, scm.K1z),
                                                    new Point3D(scm.K1x, scm.K1y, scm.K1z), new Point3D(scm.K1x, scm.K1y + 100, scm.K1z));

            ///<summary>
            ///Initializing the SteeringAxis Vector
            ///</summary>
            ///<remarks>Initialization of the Steering Axis</remarks>
            SteeringAxis = new Custom3DGeometry(LBJ, UBJ);
            InitializeAuxillaries(0);

            UprightTriangle.Add(new Triangle(/*new Point3D(UBJ.X, UBJ.Y, UBJ.Z),*/ UBJ, /*new Point3D(LBJ.X, LBJ.Y, LBJ.Z)*/ LBJ, /* new Point3D(ToeLinkUpright.X, ToeLinkUpright.Y, ToeLinkUpright.Z)*/ ToeLinkUpright));

            ///<summary>Initializing the <see cref="LBJToToeLink"/> Vector</summary>
            LBJToToeLink = new Custom3DGeometry(LBJ, ToeLinkUpright);
            ///<summary>Initializing the <see cref="UBJToToeLink"/> Vector</summary>
            UBJToToeLink = new Custom3DGeometry(UBJ, ToeLinkUpright);

            ///<summary></summary>
            AdjOptions = new AdjustmentOptions(scm, this, adjToolDictionary, sccv);
        }
예제 #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 });
        }
예제 #4
0
        public void UpdateComponent(Custom3DGeometry _finalGeometry, int i)
        {
            _finalGeometry.Line.AssignFinalState_3DLine(_finalGeometry.Line.DeltaLine[i].StartPoint, _finalGeometry.Line.DeltaLine[i].EndPoint, i);

            _finalGeometry.PerpAlongX = new ChildLine_LinePair(_finalGeometry.Line.DeltaLine[i].MidPoint, new Point3D(_finalGeometry.Line.DeltaLine[i].MidPoint.X + 100, _finalGeometry.Line.DeltaLine[i].MidPoint.Y, _finalGeometry.Line.DeltaLine[i].MidPoint.Z));

            _finalGeometry.PerpAlongY = new ChildLine_LinePair(_finalGeometry.Line.DeltaLine[i].MidPoint, new Point3D(_finalGeometry.Line.DeltaLine[i].MidPoint.X, _finalGeometry.Line.DeltaLine[i].MidPoint.Y + 100, _finalGeometry.Line.DeltaLine[i].MidPoint.Z));

            _finalGeometry.PerpAlongZ = new ChildLine_LinePair(_finalGeometry.Line.DeltaLine[i].MidPoint, new Point3D(_finalGeometry.Line.DeltaLine[i].MidPoint.X, _finalGeometry.Line.DeltaLine[i].MidPoint.Y, _finalGeometry.Line.DeltaLine[i].MidPoint.Z + 100));

            _finalGeometry.ViewLines.AssignFinalState(new Point2D(_finalGeometry.Line.DeltaLine[i].StartPoint.X, _finalGeometry.Line.DeltaLine[i].StartPoint.Y), new Point2D(_finalGeometry.Line.DeltaLine[i].EndPoint.X, _finalGeometry.Line.DeltaLine[i].EndPoint.Y),
                                                      new Point2D(_finalGeometry.Line.DeltaLine[i].StartPoint.Z, _finalGeometry.Line.DeltaLine[i].StartPoint.Y), new Point2D(_finalGeometry.Line.DeltaLine[i].EndPoint.Z, _finalGeometry.Line.DeltaLine[i].EndPoint.Y),
                                                      new Point2D(_finalGeometry.Line.DeltaLine[i].StartPoint.X, _finalGeometry.Line.DeltaLine[i].StartPoint.Z), new Point2D(_finalGeometry.Line.DeltaLine[i].EndPoint.X, _finalGeometry.Line.DeltaLine[i].EndPoint.Z), i);
        }
        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;
            }
        }
예제 #6
0
        public void AddLineAndPointToDeltaLineAndDeltaPoint(Custom3DGeometry _finalGeometry, int i)
        {
            _finalGeometry.Line.DeltaLine.Add(new Line(_finalGeometry.Line.DeltaLine[i].StartPoint.X, _finalGeometry.Line.DeltaLine[i].StartPoint.Y, _finalGeometry.Line.DeltaLine[i].StartPoint.Z,
                                                       _finalGeometry.Line.DeltaLine[i].EndPoint.X, _finalGeometry.Line.DeltaLine[i].EndPoint.Y, _finalGeometry.Line.DeltaLine[i].EndPoint.Z));

            _finalGeometry.PerpAlongX = new ChildLine_LinePair(_finalGeometry.Line.DeltaLine[i + 1].MidPoint, new Point3D(_finalGeometry.Line.DeltaLine[i + 1].MidPoint.X + 100, _finalGeometry.Line.DeltaLine[i + 1].MidPoint.Y, _finalGeometry.Line.DeltaLine[i + 1].MidPoint.Z));

            _finalGeometry.PerpAlongY = new ChildLine_LinePair(_finalGeometry.Line.DeltaLine[i + 1].MidPoint, new Point3D(_finalGeometry.Line.DeltaLine[i + 1].MidPoint.X, _finalGeometry.Line.DeltaLine[i + 1].MidPoint.Y + 100, _finalGeometry.Line.DeltaLine[i + 1].MidPoint.Z));

            _finalGeometry.PerpAlongZ = new ChildLine_LinePair(_finalGeometry.Line.DeltaLine[i + 1].MidPoint, new Point3D(_finalGeometry.Line.DeltaLine[i + 1].MidPoint.X, _finalGeometry.Line.DeltaLine[i + 1].MidPoint.Y, _finalGeometry.Line.DeltaLine[i + 1].MidPoint.Z + 100));

            _finalGeometry.ViewLines.AddLineToDeltaLine(new Point2D(_finalGeometry.Line.DeltaLine[i + 1].StartPoint.X, _finalGeometry.Line.DeltaLine[i + 1].StartPoint.Y), new Point2D(_finalGeometry.Line.DeltaLine[i + 1].EndPoint.X, _finalGeometry.Line.DeltaLine[i + 1].EndPoint.Y),
                                                        new Point2D(_finalGeometry.Line.DeltaLine[i + 1].StartPoint.Z, _finalGeometry.Line.DeltaLine[i + 1].StartPoint.Y), new Point2D(_finalGeometry.Line.DeltaLine[i + 1].EndPoint.Z, _finalGeometry.Line.DeltaLine[i + 1].EndPoint.Y),
                                                        new Point2D(_finalGeometry.Line.DeltaLine[i + 1].StartPoint.X, _finalGeometry.Line.DeltaLine[i + 1].StartPoint.Z), new Point2D(_finalGeometry.Line.DeltaLine[i + 1].EndPoint.X, _finalGeometry.Line.DeltaLine[i + 1].EndPoint.Z));
        }
예제 #7
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);
        }
        /// <summary>
        /// Method to initialize the steering axis and ALL of its components
        /// </summary>
        /// <param name="i">Index of the <see cref="ChildLine_VariableLine.DeltaLine"/></param>
        public void InitializeAuxillaries(int i)
        {
            ///<remarks>Calculating the Angles that the Steering Axis Makes with the UNROTATED AXIS constructed above. The angles in Front and Side view are calculated</remarks>
            Angle SteeringAxisFV = AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(SteeringAxis.ViewLines.FrontView.DeltaLine[i]), Custom3DGeometry.GetMathNetVector3D(WheelCentreAxis.Vertical), Custom3DGeometry.GetMathNetVector3D(WheelCentreAxis.Longitudinal));
            Angle SteeringAxisSV = AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(SteeringAxis.ViewLines.SideView.DeltaLine[i]), Custom3DGeometry.GetMathNetVector3D(WheelCentreAxis.Vertical), Custom3DGeometry.GetMathNetVector3D(WheelCentreAxis.Lateral));
            Angle SteeringAxisTV = AngleInRequiredView(Custom3DGeometry.GetMathNetVector3D(SteeringAxis.ViewLines.TopView.DeltaLine[i]), Custom3DGeometry.GetMathNetVector3D(WheelCentreAxis.Lateral), Custom3DGeometry.GetMathNetVector3D(WheelCentreAxis.Vertical));

            ///<remarks>Rotating the AXIS which is along Z to make it perpendicular to the Steering Axis</remarks>
            SteeringAxisPerpendicularOperations(SteeringAxisFV, SteeringAxisSV, SteeringAxisTV, SteeringAxis.PerpAlongX.Mid, SteeringAxis.PerpAlongZ.Mid);
            SteeringAxisPerpendicularOperations(SteeringAxisFV, SteeringAxisSV, SteeringAxisTV, SteeringAxis.PerpAlongX.Fore, SteeringAxis.PerpAlongZ.Fore);
            SteeringAxisPerpendicularOperations(SteeringAxisFV, SteeringAxisSV, SteeringAxisTV, SteeringAxis.PerpAlongX.Aft, SteeringAxis.PerpAlongZ.Aft);

            ///<summary>DeltaLine[i]ialize the Fore and Aft components of the Axis which is along Z and perp to the Steering axis</summary>
            SteeringAxis.PerpAlongZ.Fore.Translate(new Vector3D(SteeringAxis.Line.DeltaLine[i].MidPoint, SteeringAxis.Line.DeltaLine[i].EndPoint));
            SteeringAxis.PerpAlongZ.Aft.Translate(new Vector3D(SteeringAxis.Line.DeltaLine[i].MidPoint, SteeringAxis.Line.DeltaLine[i].StartPoint));

            ///<summary>DeltaLine ialize the Fore and Aft components of the Axis which is along X  and perp to the Steering axis</summary>
            SteeringAxis.PerpAlongX.Fore.Translate(new Vector3D(SteeringAxis.Line.DeltaLine[i].MidPoint, SteeringAxis.Line.DeltaLine[i].EndPoint));
            SteeringAxis.PerpAlongX.Aft.Translate(new Vector3D(SteeringAxis.Line.DeltaLine[i].MidPoint, SteeringAxis.Line.DeltaLine[i].StartPoint));
        }
        //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)));
        }
예제 #10
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 });
        }
예제 #11
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);
        }