本文整理汇总了C#中Point.ToHostArray方法的典型用法代码示例。如果您正苦于以下问题:C# Point.ToHostArray方法的具体用法?C# Point.ToHostArray怎么用?C# Point.ToHostArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point.ToHostArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ByPoints
/// <summary>
///
/// </summary>
/// <param name="pts"></param>
/// <param name="startTangent"></param>
/// <param name="endTangent"></param>
/// <returns></returns>
public static BSplineCurve ByPoints(Point[] pts, Vector startTangent, Vector endTangent)
{
if (pts == null || startTangent == null || endTangent == null ||
startTangent.IsZeroVector() || endTangent.IsZeroVector())
{
return null;
}
IBSplineCurveHost ent = HostFactory.Factory.BSplineByPoints(pts.ToHostArray(), startTangent, endTangent);
var spline = new BSplineCurve(ent, true);
spline.Points = pts;
spline.Degree = 3;
spline.StartTangent = startTangent;
spline.EndTangent = endTangent;
return spline;
}
示例2: ByControlVertices
/// <summary>
///
/// </summary>
/// <param name="controlVertices"></param>
/// <param name="degree"></param>
/// <param name="makePeriodic"></param>
/// <returns></returns>
public static BSplineCurve ByControlVertices(Point[] controlVertices, int degree, bool makePeriodic)
{
if (controlVertices == null || degree < 3)
{
return null;
}
else if (controlVertices.Length < degree + 1)
{
return null;
}
var ent = HostFactory.Factory.BSplineByControlVertices(controlVertices.ToHostArray(), degree, makePeriodic);
var spline = new BSplineCurve(ent, true);
spline.ControlVertices = controlVertices;
spline.Degree = degree;
return spline;
}