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


C# Vector3.ToDoubles方法代码示例

本文整理汇总了C#中System.Vector3.ToDoubles方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.ToDoubles方法的具体用法?C# Vector3.ToDoubles怎么用?C# Vector3.ToDoubles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Vector3的用法示例。


在下文中一共展示了Vector3.ToDoubles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateBodyFromCylTs

        public static IBody2 CreateBodyFromCylTs(this IModeler modeler, Vector3  xyz, Vector3 axis, double radius, double length)
        {
            var array = xyz
                .ToDoubles()
                .Concat(axis.ToDoubles())
                .Concat(new[] {radius, length})
                .ToArray();

            return (IBody2)modeler.CreateBodyFromCyl(array);
        }
开发者ID:Weingartner,项目名称:SolidworksAddinFramework,代码行数:10,代码来源:ModellerExtensions.cs

示例2:

        public static ICurve CreateTrimmedArc
            (this IModeler modeler, Vector3 center, Vector3 axis, Vector3 startPoint, Vector3 endPoint)
        {
            var radius = (startPoint - center).Length();
            var arc =
                (Curve)
                    modeler.CreateArc
                        (center.ToDoubles(), axis.ToDoubles(), (double) radius, startPoint.ToDoubles(), endPoint.ToDoubles());

            var pp0 = arc.GetClosestPointOn(startPoint.X, startPoint.Y, startPoint.Z).CastArray<double>();
            var pp1 = arc.GetClosestPointOn(endPoint.X, endPoint.Y, endPoint.Z).CastArray<double>();

            return arc.CreateTrimmedCurve(pp0[3], pp1[3]);

        }
开发者ID:Weingartner,项目名称:SolidworksAddinFramework,代码行数:15,代码来源:ModellerExtensions.cs

示例3: return

 public static IBody2 CreateCone
     (this IModeler m, Vector3 center, Vector3 axis, double baseRadius, double topRadius, double height)
 {
     var array = center.ToDoubles().Concat(axis.ToDoubles()).Concat(new[] {baseRadius, topRadius, height}).ToArray();
     return (IBody2) m.CreateBodyFromCone(array);
 }
开发者ID:Weingartner,项目名称:SolidworksAddinFramework,代码行数:6,代码来源:ModellerExtensions.cs

示例4: CreateSphereBody

        public static IBody2 CreateSphereBody(this IModeler modeler, Vector3 center, double radius)
        {
            var axis = Vector3.UnitZ;
            var refaxis = Vector3.UnitY;
            var sphere = (ISurface)modeler.CreateSphericalSurface2(center.ToDoubles(), axis.ToDoubles(), refaxis.ToDoubles(), radius);

            var swSurfPara = sphere.Parameterization2();

            var uvrange = new double[]
            {
                swSurfPara.UMin,
                swSurfPara.UMax,
                swSurfPara.VMin,
                swSurfPara.VMax
            };


            var sphereBody = (IBody2) modeler.CreateSheetFromSurface(sphere, uvrange);
            return sphereBody;
        }
开发者ID:Weingartner,项目名称:SolidworksAddinFramework,代码行数:20,代码来源:ModellerExtensions.cs

示例5: CreateSheet

        /// <summary>
        /// Create a bounded sheet.
        /// </summary>
        /// <param name="modeler"></param>
        /// <param name="center">Center of the surface</param>
        /// <param name="vNormal">Direction of the surface</param>
        /// <param name="p0">Point to project onto surface to find UV bounds</param>
        /// <param name="p1">Point to project onto surface to find UV bounds</param>
        /// <returns></returns>
        public static IBody2 CreateSheet(this IModeler modeler, Vector3 center, Vector3 vNormal, double r)
        {
            var surf = (Surface) modeler.CreatePlanarSurface(center.ToDoubles(), vNormal.ToDoubles());
            var mid = surf.GetClosestPointOnTs(center);
            var midPoint = mid.Point.ToVector3();
            var upVector = (surf.PointAt(mid.U, mid.V + 1) - midPoint).Unit();
            var rightVector = (surf.PointAt(mid.U + 1, mid.V) - midPoint).Unit();


            var low = midPoint - upVector*r - rightVector*r;
            var high = midPoint + upVector*r + rightVector*r;

            var uvLow = surf.GetClosestPointOnTs(low);
            var uvHigh = surf.GetClosestPointOnTs(high);
            return modeler.CreateSheetFromSurface(surf, uvLow, uvHigh);
        }
开发者ID:Weingartner,项目名称:SolidworksAddinFramework,代码行数:25,代码来源:ModellerExtensions.cs


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