예제 #1
0
        private Figure curbDeformation(Point3 ptStart, Point3 ptEnd, Screw screw)
        {
            float  distPtStartPtEnd = ptEnd.toVector().substract(ptStart.toVector()).getNorm();
            float  lScrew           = screw.aplicationPoint.substract(ptStart.toVector()).getNorm();
            Figure figure           = new Figure();

            if (distPtStartPtEnd < 2)
            {
                return(figure);
            }
            Projector projector = new Projector(Projector.getUsualBase());

            projector.constructFinalBase(ptEnd.toVector().substract(ptStart.toVector()), ptStart.toVector());
            FloatVector ptStartFinalBase = projector.projectToFinalBase(ptStart.toVector())
            , ptEndFinalBase             = projector.projectToFinalBase(ptEnd.toVector());

            Screw screwFinalBase = screw.project(projector, true);
            float l = distPtStartPtEnd;
            float k = lScrew;

            FunctionPolynomial ftcStartY = this.getDeformationFunctionY(l, k, screwFinalBase.N, screwFinalBase.Y, true, 2);

            //FunctionPolynomial ftcStartZ = this.getDeformationFunctionZ(l, k, screwFinalBase.M, screwFinalBase.Z, true, 2);

            FunctionPolynomial ftcEndY = this.getDeformationFunctionY(l, k, screwFinalBase.N, screwFinalBase.Y, false, 2);

            //FunctionPolynomial ftcEndZ = this.getDeformationFunctionZ(l, k, screwFinalBase.M, screwFinalBase.Z, false, 2);

            FloatVector pointResult = ptStartFinalBase.vectorWhithAllCoordinatesEquals(0);
            float       X           = ptStartFinalBase[0];

            do
            {
                pointResult = ptStartFinalBase.vectorWhithAllCoordinatesEquals(0);
                //pointResult[0] = X;
                if (X == 999)
                {
                    ;
                }
                if (X < lScrew)
                {
                    pointResult[1] = ftcStartY.calcY(X) / (this.E * this.IGz);
                    //pointResult[2] = ftcStartZ.calcY(X) / (this.E * this.IGz);
                }
                else
                {
                    pointResult[1] = ftcEndY.calcY(X) / (this.E * this.IGz);
                    //pointResult[2] = ftcEndZ.calcY(X) / (this.E * this.IGz);
                }
                X += 1;
                figure.Add(projector.projectToOriginalBase(pointResult, false).toPoint3());
            }while (X <= ptEndFinalBase[0]);
            return(figure);
        }
예제 #2
0
        private Figure normalDeformation(Point3 ptStart, Point3 ptEnd, Screw screwPtStart)
        {
            float  distPtStartPtEnd = ptEnd.toVector().substract(ptStart.toVector()).getNorm();
            Figure figure           = new Figure();

            if (distPtStartPtEnd < 2)
            {
                return(figure);
            }
            Projector projector = new Projector(Projector.getUsualBase());

            projector.constructFinalBase(ptEnd.toVector().substract(ptStart.toVector()), ptStart.toVector());
            FloatVector ptStartFinalBase = projector.projectToFinalBase(ptStart.toVector())
            , ptEndFinalBase             = projector.projectToFinalBase(ptEnd.toVector());

            Screw screwPtStartFinalBase = screwPtStart.project(projector, true);
            float l = distPtStartPtEnd;

            FunctionPolynomial ftcY = this.getDeformationFunctionY(l, 0, screwPtStartFinalBase.N, screwPtStartFinalBase.Y, true, 0);

            //FunctionPolynomial ftcZ = this.getDeformationFunctionZ(l, 0, screwPtStartFinalBase.M, - screwPtStartFinalBase.Z, true, 0);

            FloatVector pointResult = ptStartFinalBase.vectorWhithAllCoordinatesEquals(0);
            float       X           = ptStartFinalBase[0];

            do
            {
                if (X == 1)
                {
                    ;
                }
                if (X == 1000)
                {
                    ;
                }
                if (X == 2000)
                {
                    ;
                }
                pointResult = ptStartFinalBase.vectorWhithAllCoordinatesEquals(0);
                //pointResult[0] = X;
                pointResult[1] = ftcY.calcY(X) / (this.E * this.IGz);
                //pointResult[2] = ftcZ.calcY(X)/ (this.E * this.IGz);
                X += 1;
                figure.Add(projector.projectToOriginalBase(pointResult, false).toPoint3());
            }while (X <= ptEndFinalBase[0]);
            return(figure);
        }