本文整理汇总了C#中System.Vector3.Unit方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Unit方法的具体用法?C# Vector3.Unit怎么用?C# Vector3.Unit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector3
的用法示例。
在下文中一共展示了Vector3.Unit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTrimmedLine
public static ICurve CreateTrimmedLine(this IModeler modeler, Vector3 p0, Vector3 v0, double length)
{
v0 = v0.Unit() * (double) length;
var p1 = p0 + v0;
return CreateTrimmedLine(modeler,p0, p1);
}
示例2: ProjectOn
public static Vector3 ProjectOn(this Vector3 point, Vector3 axis)
{
return ProjectOnUnit(point, axis.Unit());
}
示例3: return
public static IBody2 CreateSemiCirclularSheet
( this IModeler modeler
, Vector3 center
, Vector3 vNormal
, Vector3 vRef // Horizontal
, double radius)
{
// Should be orthogonal
Debug.Assert(vRef.Dot(vNormal)<1e-9);
var math = SwAddinBase.Active.Math;
var centerSw = center.ToSwMathPoint();
var vNormalSw = vNormal.ToSwMathPoint();
var vNormalOrthSw = vRef.ToSWVector(math).Normalise();
var centerDbls = centerSw.ArrayData;
var vNormalDbls = vNormalSw.ArrayData;
var vNormalOrthDbls = vNormalOrthSw.ArrayData;
var surf = (Surface) modeler.CreatePlanarSurface2(centerDbls, vNormalDbls, vNormalOrthDbls);
var startPoint = center + radius*vRef.Unit();
var endPoint = center - radius*vRef.Unit();
var startPointDbls = startPoint.ToDoubles();
var endPointDbls = endPoint.ToDoubles();
var arco = modeler.CreateArc
(centerDbls, vNormalDbls, radius, startPointDbls, endPointDbls);
var arc = (Curve) arco;
var arcStartPoint = startPoint;
var arcEndPoint = endPoint;
var trimmedArc = arc.CreateTrimmedCurve2(arcStartPoint.X,arcStartPoint.Y,arcStartPoint.Z,arcEndPoint.X,arcEndPoint.Y,arcEndPoint.Z);
var line = modeler.CreateTrimmedLine(arcEndPoint, arcStartPoint);
return (IBody2) surf.CreateTrimmedSheet(new[] {trimmedArc, line});
}