ISAAR.MSolve.IGA/Postprocessing/ParaviewNurbs3D.cs
/// <summary>
/// Calculates the cartesian coordinate of a parametric point.
/// </summary>
/// <param name="numberOfCPKsi">Number of <see cref="ControlPoint"/> in the parametric axis Ksi.</param>
/// <param name="degreeKsi">Degree of splines for the parametric axis Ksi.</param>
/// <param name="knotValueVectorKsi"> Knot Value Vector for the parametric axis Ksi.</param>
/// <param name="numberOfCPHeta">Number of <see cref="ControlPoint"/> in the parametric axis Heta.</param>
/// <param name="degreeHeta">Degree of splines for the parametric axis Heta.</param>
/// <param name="knotValueVectorHeta"> Knot Value Vector for the parametric axis Heta.</param>
/// <param name="numberOfCPZeta">Number of <see cref="ControlPoint"/> in the parametric axis Zeta.</param>
/// <param name="degreeZeta">Degree of splines for the parametric axis Zeta.</param>
/// <param name="knotValueVectorZeta"> Knot Value Vector for the parametric axis Zeta.</param>
/// <param name="projectiveControlPointCoordinates">A <see cref="double"/> two dimensional array containing the projective coordinates of the control points.</param>
/// <param name="ksiCoordinate">Parametric coordinate Ksi of the physical point to be evaluated.</param>
/// <param name="hetaCoordinate">Parametric coordinate Heta of the physical point to be evaluated.</param>
/// <param name="zetaCoordinate">Parametric coordinate Zeta of the physical point to be evaluated.</param>
/// <returns>A <see cref="Vector"/> containing the physical coordinates of the solid point calculated.</returns>
Calculates the cartesian coordinate of a parametric point.
Calculates the cartesian coordinate of a parametric point .
public static Vector SolidPoint3D(int numberOfCPKsi, int degreeKsi, Vector knotValueVectorKsi,
			int numberOfCPHeta, int degreeHeta, Vector knotValueVectorHeta, int numberOfCPZeta, int degreeZeta,
			Vector knotValueVectorZeta, double[,] projectiveControlPointCoordinates, double ksiCoordinate, double hetaCoordinate,
			double zetaCoordinate)
		{
			var spanKsi = ParaviewNurbs2D.FindSpan(numberOfCPKsi, degreeKsi, ksiCoordinate, knotValueVectorKsi);
			var spanHeta = ParaviewNurbs2D.FindSpan(numberOfCPHeta, degreeHeta, hetaCoordinate, knotValueVectorHeta);
			var spanZeta = ParaviewNurbs2D.FindSpan(numberOfCPZeta, degreeZeta, zetaCoordinate, knotValueVectorZeta);
			var pointFunctionsKsi = ParaviewNurbs2D.BasisFunctions(spanKsi, ksiCoordinate, degreeKsi, knotValueVectorKsi);
			var pointFunctionsHeta = ParaviewNurbs2D.BasisFunctions(spanHeta, hetaCoordinate, degreeHeta, knotValueVectorHeta);
			var pointFunctionsZeta = ParaviewNurbs2D.BasisFunctions(spanZeta, zetaCoordinate, degreeZeta, knotValueVectorZeta);
			var cartesianPoint = Vector.CreateZero(4);
			var indexKsi = spanKsi - degreeKsi;
			for (int k = 0; k <= degreeZeta; k++)
			{
				var indexZeta = spanZeta - degreeZeta + k;
				for (int j = 0; j <= degreeHeta; j++)
				{
					var indexHeta = spanHeta - degreeHeta + j;
					for (int i = 0; i <= degreeKsi; i++)
					{
						var cpIndex = (indexKsi + i) * (numberOfCPHeta + 1) * (numberOfCPZeta + 1) +
									  indexHeta * (numberOfCPZeta + 1) + indexZeta;
						var cpCoordinates = Vector.CreateFromArray(new double[]
						{
							projectiveControlPointCoordinates[cpIndex, 0],
							projectiveControlPointCoordinates[cpIndex, 1],
							projectiveControlPointCoordinates[cpIndex, 2],
							projectiveControlPointCoordinates[cpIndex, 3]
						});
						cpCoordinates.Scale(pointFunctionsKsi[i]);
						cpCoordinates.Scale(pointFunctionsHeta[j]);
						cpCoordinates.Scale(pointFunctionsZeta[k]);
						cartesianPoint = cartesianPoint + cpCoordinates;
					}
				}
			}
			return cartesianPoint;
		}
public static Vector SolidPoint3D ( int numberOfCPKsi , int degreeKsi , Vector knotValueVectorKsi , int numberOfCPHeta , int degreeHeta , Vector knotValueVectorHeta , int numberOfCPZeta , int degreeZeta , Vector knotValueVectorZeta , double [ , ] projectiveControlPointCoordinates , double ksiCoordinate , double hetaCoordinate , double zetaCoordinate ) { var spanKsi = ParaviewNurbs2D . FindSpan ( numberOfCPKsi , degreeKsi , ksiCoordinate , knotValueVectorKsi ) ; var spanHeta = ParaviewNurbs2D . FindSpan ( numberOfCPHeta , degreeHeta , hetaCoordinate , knotValueVectorHeta ) ; var spanZeta = ParaviewNurbs2D . FindSpan ( numberOfCPZeta , degreeZeta , zetaCoordinate , knotValueVectorZeta ) ; var pointFunctionsKsi = ParaviewNurbs2D . BasisFunctions ( spanKsi , ksiCoordinate , degreeKsi , knotValueVectorKsi ) ; var pointFunctionsHeta = ParaviewNurbs2D . BasisFunctions ( spanHeta , hetaCoordinate , degreeHeta , knotValueVectorHeta ) ; var pointFunctionsZeta = ParaviewNurbs2D . BasisFunctions ( spanZeta , zetaCoordinate , degreeZeta , knotValueVectorZeta ) ; var cartesianPoint = Vector . CreateZero ( 4 ) ; var indexKsi = spanKsi - degreeKsi ; for ( int k = 0 ; k <= degreeZeta ; k ++ ) { var indexZeta = spanZeta - degreeZeta + k ; for ( int j = 0 ; j <= degreeHeta ; j ++ ) { var indexHeta = spanHeta - degreeHeta + j ; for ( int i = 0 ; i <= degreeKsi ; i ++ ) { var cpIndex = ( indexKsi + i ) * ( numberOfCPHeta + 1 ) * ( numberOfCPZeta + 1 ) + indexHeta * ( numberOfCPZeta + 1 ) + indexZeta ; var cpCoordinates = Vector . CreateFromArray ( new double [ ] { projectiveControlPointCoordinates [ cpIndex , 0 ] , projectiveControlPointCoordinates [ cpIndex , 1 ] , projectiveControlPointCoordinates [ cpIndex , 2 ] , projectiveControlPointCoordinates [ cpIndex , 3 ] } ) ; cpCoordinates . Scale ( pointFunctionsKsi [ i ] ) ; cpCoordinates . Scale ( pointFunctionsHeta [ j ] ) ; cpCoordinates . Scale ( pointFunctionsZeta [ k ] ) ; cartesianPoint = cartesianPoint + cpCoordinates ; } } } return cartesianPoint ; }
Calculates the cartesian coordinate of a parametric point.
Calculates the cartesian coordinate of a parametric point .
A  containing the physical coordinates of the solid point calculated.
A containing the physical coordinates of the solid point calculated .
numberOfCPKsi
int
Number of  in the parametric axis Ksi.
Number of in the parametric axis Ksi .
degreeKsi
int
Degree of splines for the parametric axis Ksi.
Degree of splines for the parametric axis Ksi .
knotValueVectorKsi
Vector
Knot Value Vector for the parametric axis Ksi.
Knot Value Vector for the parametric axis Ksi .
numberOfCPHeta
int
Number of  in the parametric axis Heta.
Number of in the parametric axis Heta .
degreeHeta
int
Degree of splines for the parametric axis Heta.
Degree of splines for the parametric axis Heta .
knotValueVectorHeta
Vector
Knot Value Vector for the parametric axis Heta.
Knot Value Vector for the parametric axis Heta .
numberOfCPZeta
int
Number of  in the parametric axis Zeta.
Number of in the parametric axis Zeta .
degreeZeta
int
Degree of splines for the parametric axis Zeta.
Degree of splines for the parametric axis Zeta .
knotValueVectorZeta
Vector
Knot Value Vector for the parametric axis Zeta.
Knot Value Vector for the parametric axis Zeta .
projectiveControlPointCoordinates
double[,]
A  two dimensional array containing the projective coordinates of the control points.
A two dimensional array containing the projective coordinates of the control points .
ksiCoordinate
double
Parametric coordinate Ksi of the physical point to be evaluated.
Parametric coordinate Ksi of the physical point to be evaluated .
hetaCoordinate
double
Parametric coordinate Heta of the physical point to be evaluated.
Parametric coordinate Heta of the physical point to be evaluated .
zetaCoordinate
double
Parametric coordinate Zeta of the physical point to be evaluated.
Parametric coordinate Zeta of the physical point to be evaluated .