本文整理汇总了C#中Plane.ClosestParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Plane.ClosestParameter方法的具体用法?C# Plane.ClosestParameter怎么用?C# Plane.ClosestParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane
的用法示例。
在下文中一共展示了Plane.ClosestParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rectangle3d
/// <summary>
/// Initializes a new rectangle from a base plane and two corner points.
/// </summary>
/// <param name="plane">Base plane for Rectangle.</param>
/// <param name="cornerA">First corner of Rectangle (will be projected onto plane).</param>
/// <param name="cornerB">Second corner of Rectangle (will be projected onto plane).</param>
public Rectangle3d(Plane plane, Point3d cornerA, Point3d cornerB)
{
m_plane = plane;
double s0, t0;
double s1, t1;
if (!plane.ClosestParameter(cornerA, out s0, out t0))
{
throw new InvalidOperationException("cornerA could not be projected onto rectangle plane.");
}
if (!plane.ClosestParameter(cornerB, out s1, out t1))
{
throw new InvalidOperationException("cornerB could not be projected onto rectangle plane.");
}
m_x = new Interval(s0, s1);
m_y = new Interval(t0, t1);
MakeIncreasing();
}