本文整理汇总了C#中Arc.GetEndParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Arc.GetEndParameter方法的具体用法?C# Arc.GetEndParameter怎么用?C# Arc.GetEndParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arc
的用法示例。
在下文中一共展示了Arc.GetEndParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeArcBoundingBox
private static void ComputeArcBoundingBox(Arc arc, IList<XYZ> pts)
{
if (arc == null)
return;
if (arc.IsBound)
{
ComputeArcBoundingBox(arc, pts, arc.GetEndParameter(0), arc.GetEndParameter(1));
}
else
{
ComputeArcBoundingBox(arc, pts, 0.0, Math.PI);
ComputeArcBoundingBox(arc, pts, Math.PI, 2.0 * Math.PI);
}
}
示例2: GetAdjustedEndParameters
private KeyValuePair<double, double> GetAdjustedEndParameters(Arc arc, bool flipped, double offset)
{
double endParam0 = (flipped ? arc.GetEndParameter(1) : arc.GetEndParameter(0)) - offset;
double endParam1 = (flipped ? arc.GetEndParameter(0) : arc.GetEndParameter(1)) - offset;
double angle = endParam1 - endParam0;
endParam0 = MathUtil.PutInRange(endParam0, Math.PI, 2 * Math.PI);
endParam1 = endParam0 + angle;
return new KeyValuePair<double, double>(endParam0, endParam1);
}
示例3: OffsetArc
/// <summary>
/// Offsets an arc along the offset direction from the point on the arc.
/// </summary>
/// <param name="arc">The arc.</param>
/// <param name="offsetPntOnArc">The point on the arc.</param>
/// <param name="offset">The offset vector.</param>
/// <returns>The offset Arc.</returns>
private static Arc OffsetArc(Arc arc, XYZ offsetPntOnArc, XYZ offset)
{
if (arc == null || offset == null)
throw new ArgumentNullException();
if (offset.IsZeroLength())
return arc;
XYZ axis = arc.Normal.Normalize();
XYZ offsetAlongAxis = axis.Multiply(offset.DotProduct(axis));
XYZ offsetOrthAxis = offset - offsetAlongAxis;
XYZ offsetPntToCenter = (arc.Center - offsetPntOnArc).Normalize();
double signedOffsetLengthTowardCenter = offsetOrthAxis.DotProduct(offsetPntToCenter);
double newRadius = arc.Radius - signedOffsetLengthTowardCenter; // signedOffsetLengthTowardCenter > 0, minus, < 0, add
Arc offsetArc = Arc.Create(arc.Center, newRadius, arc.GetEndParameter(0), arc.GetEndParameter(1), arc.XDirection, arc.YDirection);
offsetArc = GeometryUtil.MoveCurve(offsetArc, offsetAlongAxis) as Arc;
return offsetArc;
}