当前位置: 首页>>代码示例>>C#>>正文


C# Vector3D.Last方法代码示例

本文整理汇总了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 ) );
        }
开发者ID:roice3,项目名称:Honeycombs,代码行数:30,代码来源:PovRay.cs

示例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() );
        }
开发者ID:roice3,项目名称:Honeycombs,代码行数:8,代码来源:Shapeways.cs


注:本文中的Vector3D.Last方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。