public override Value Evaluate(FSharpList <Value> args) { Curve curve = (Curve)((Value.Container)args[0]).Item; double thickness = ((Value.Number)args[1]).Item; XYZ normal = (XYZ)((Value.Container)args[2]).Item; CurveLoop result = CurveLoop.CreateViaThicken(curve, thickness, normal); if (result == null) { throw new Exception("Could not thicken curve"); } foreach (Curve c in result) { crvs.Add(c); } return(Value.NewContainer(result)); }
public override Value Evaluate(FSharpList <Value> args) { Curve curve = (Curve)((Value.Container)args[0]).Item; double thickness = ((Value.Number)args[1]).Item; XYZ normal = (XYZ)((Value.Container)args[2]).Item; CurveLoop thickenLoop = CurveLoop.CreateViaThicken(curve, thickness, normal); if (thickenLoop == null) { throw new Exception("Could not offset curve"); } CurveLoopIterator CLiter = thickenLoop.GetCurveLoopIterator(); Curve result = null; //relying heavily on the order of curves in the resulting curve loop, based on internal implemen for (int index = 0; CLiter.MoveNext(); index++) { if (index == 2) { result = CLiter.Current.Clone(); } } if (result == null) { throw new Exception("Could not offset curve"); } crvs.Add(result); return(Value.NewContainer(result)); }