Canguro.Analysis.LineDeformationCalculator.GetCurve C# (CSharp) Метод

GetCurve() публичный Метод

public GetCurve ( LineElement l, AbstractCase ac, int numPoints, float deformationScale, float paintScaleFactorTranslation, float &xPos ) : System.Vector3[]
l Canguro.Model.LineElement
ac Canguro.Model.Load.AbstractCase
numPoints int
deformationScale float
paintScaleFactorTranslation float
xPos float
Результат System.Vector3[]
        public Vector3[] GetCurve(LineElement l, AbstractCase ac, int numPoints, float deformationScale, float paintScaleFactorTranslation, out float[] xPos)
        {
            if (l == null)
            {
                xPos = null;
                return null;
            }

            Vector3 iPos, jPos;
            iPos = new Vector3(model.Results.JointDisplacements[l.I.Id, 0],
                             model.Results.JointDisplacements[l.I.Id, 1],
                             model.Results.JointDisplacements[l.I.Id, 2]);
            iPos = deformationScale * paintScaleFactorTranslation * iPos + l.I.Position;

            jPos = new Vector3(model.Results.JointDisplacements[l.J.Id, 0],
                             model.Results.JointDisplacements[l.J.Id, 1],
                             model.Results.JointDisplacements[l.J.Id, 2]);
            jPos = deformationScale * paintScaleFactorTranslation * jPos + l.J.Position;

            float[,] local2Values = GetCurvedAxis(l, model.Results.ActiveCase.AbstractCase, Analysis.LineDeformationCalculator.DeformationAxis.Local2, numPoints);
            float[,] local3Values = GetCurvedAxis(l, model.Results.ActiveCase.AbstractCase, Analysis.LineDeformationCalculator.DeformationAxis.Local3, numPoints);

            int nVertices = local2Values.GetLength(0);
            Vector3[] curve = new Vector3[nVertices];
            xPos = new float[nVertices];
            for (int i = 0; i < nVertices; i++)
            {
                xPos[i] = local2Values[i, 0];
                curve[i] = iPos + local2Values[i, 0] * (jPos - iPos) +
                    local2Values[i, 1] * deformationScale * paintScaleFactorTranslation * l.LocalAxes[1] +
                    local3Values[i, 1] * deformationScale * paintScaleFactorTranslation * l.LocalAxes[2];
            }

            return curve;
        }