本文整理汇总了C#中Vector3D.Last方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.Last方法的具体用法?C# Vector3D.Last怎么用?C# Vector3D.Last使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3D
的用法示例。
在下文中一共展示了Vector3D.Last方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EdgeSphereSweep
public static string EdgeSphereSweep( Vector3D[] points, Func<Vector3D,Sphere> sphereFunc, Vector3D color = new Vector3D() )
{
if( points.Length < 2 )
throw new System.ArgumentException();
// For the cubic spline, repeat the first and last points.
List<Vector3D> appended = new List<Vector3D>();
appended.Add( points.First() );
appended.AddRange( points );
appended.Add( points.Last() );
Func<Vector3D,string> formatVecAndSize = v =>
{
Sphere s = sphereFunc( v );
return string.Format( "<{0:G6},{1:G6},{2:G6}>,{3:G6}", s.Center.X, s.Center.Y, s.Center.Z, s.Radius );
};
// b_spline seems best overall http://bugs.povray.org/task/81
// options: b_spline, linear_spline, cubic_spline
string formattedPoints = string.Join( ",", appended.Select( formatVecAndSize ).ToArray() );
//return string.Format( "sphere_sweep {{ b_spline {0}, {1} texture {{tex}} }}", points.Length + 2, formattedPoints );
//return string.Format( "sphere_sweep {{ linear_spline {0}, {1} texture {{tex}} }}", points.Length + 2, formattedPoints );
// With color included.
return string.Format( "sphere_sweep {{ b_spline {0}, {1} finish {{fin}} pigment {{color rgb {2}}} }}",
points.Length + 2, formattedPoints, FormatVec( CHSL2RGB( color ) ) );
//return string.Format( "sphere_sweep {{ b_spline {0}, {1} finish {{fin}} pigment {{color CHSL2RGB({2})}} }}",
// points.Length + 2, formattedPoints, FormatVec( color ) );
}
示例2: AddCurve
public void AddCurve( Vector3D[] points, double[] radii )
{
if( points.Length < 2 )
throw new System.ArgumentException( "AddCurve requires at least two input points." );
List<Vector3D[]> disks = CalcDisks( points, radii );
AddCurve( disks, points, points.First(), points.Last() );
}