本文整理汇总了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);
}
示例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]);
}
示例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);
}
示例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;
}
示例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);
}