本文整理汇总了C#中Curve.ComputeNormalizedParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Curve.ComputeNormalizedParameter方法的具体用法?C# Curve.ComputeNormalizedParameter怎么用?C# Curve.ComputeNormalizedParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curve
的用法示例。
在下文中一共展示了Curve.ComputeNormalizedParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawInsulation
/// <summary>
/// DrawInsulation
/// </summary>
public double drawInsulation(List<ElementId> grp, Document doc, Curve lower, double distance, Curve upper, ref bool leftwing, List<Interruption> Breaks, bool zigzag)
{
double dist = distance / lower.Length;
if (dist > 1) return 100;
XYZ P1 = lower.Evaluate(dist, true);
IntersectionResultArray result = new IntersectionResultArray();
XYZ normal = lower.GetCurveTangentToEndPoint(P1);
SetComparisonResult scr = Line.CreateUnbound(P1, normal).Intersect(upper, out result);
if (result == null || result.Size == 0)
{
if (dist > 0.5) return 100;
else
{
upper = upper.Clone();
upper.MakeUnbound();
scr = Line.CreateUnbound(P1, normal).Intersect(upper, out result);
}
}
XYZ P3 = result.get_Item(0).XYZPoint;
double height = P1.DistanceTo(P3);
double r = height / 4;
double distr = (distance + r) / lower.Length;
if (distr > 1) return 100;
foreach (Interruption interrupt in Breaks)
{
if (distr > lower.ComputeNormalizedParameter(interrupt.from) && distr < lower.ComputeNormalizedParameter(interrupt.to)) return r;
}
XYZ P2 = (distr < 1) ? lower.Evaluate(distr, true) : P1;
double disth = (distance + height) / lower.Length;
SetComparisonResult scr2 = Line.CreateUnbound(P2, lower.GetCurveTangentToEndPoint(P2)).Intersect(upper, out result);
if (result == null || result.Size == 0) return 100;
XYZ P4 = (P1 != P2) ? result.get_Item(0).XYZPoint : upper.GetEndPoint(1);
if (zigzag)
drawZigZag(grp, doc, P1, P2, P3, P4, leftwing);
else
drawSoftLoop(grp, doc, P1, P2, P3, P4, leftwing);
if (leftwing) leftwing = false; else leftwing = true;
return r;
}