/***************************************************/ public static List <Curve> ToRevitCurves(this BH.oM.Geometry.Arc curve) { //Split the curve in half when it is closed. if (Math.Abs(2 * Math.PI) - curve.EndAngle + curve.StartAngle < BH.oM.Adapters.Revit.Tolerance.Angle) { double r = curve.Radius.FromSI(UnitType.UT_Length); XYZ centre = curve.CoordinateSystem.Origin.ToRevit(); XYZ xAxis = curve.CoordinateSystem.X.ToRevit().Normalize(); XYZ yAxis = curve.CoordinateSystem.Y.ToRevit().Normalize(); Arc arc1 = Arc.Create(centre, r, 0, Math.PI, xAxis, yAxis); Arc arc2 = Arc.Create(centre, r, 0, Math.PI, -xAxis, -yAxis); return(new List <Curve> { arc1, arc2 }); } else { return new List <Curve> { curve.ToRevit() } }; }
/***************************************************/ public static Arc ToRevit(this BH.oM.Geometry.Arc curve) { double radius = curve.Radius.FromSI(UnitType.UT_Length); return(Arc.Create(curve.CoordinateSystem.ToRevit(), radius, curve.StartAngle, curve.EndAngle)); }