/// <summary> /// Convert a Revit arc to a Nucleus one /// </summary> /// <param name="arc">The arc to convert</param> /// <returns></returns> public static FB.Arc Convert(AD.Arc arc) { if (arc.IsCyclic) { return(new FB.Arc( new Circle( arc.Radius, new CylindricalCoordinateSystem( Convert(arc.Center), Convert(arc.XDirection, 1), Convert(arc.YDirection, 1))))); } else { return(new FB.Arc( Convert(arc.GetEndPoint(0)), Convert(arc.Evaluate(0.5, true)), Convert(arc.GetEndPoint(1)))); } }
public static ArcCurve ToRhino(DB.Arc arc) { return(arc.IsBound ? new ArcCurve ( new Arc(AsPoint3d(arc.GetEndPoint(0)), AsPoint3d(arc.Evaluate(0.5, true)), AsPoint3d(arc.GetEndPoint(1))), arc.GetEndParameter(0), arc.GetEndParameter(1) ) : new ArcCurve ( new Circle(new Plane(AsPoint3d(arc.Center), AsVector3d(arc.XDirection), AsVector3d(arc.YDirection)), arc.Radius), 0.0, 2.0 * Math.PI )); }
public static ArcCurve ToRhino(this DB.Arc arc) { return(arc.IsBound ? new ArcCurve ( new Arc(arc.GetEndPoint(0).ToRhino(), arc.Evaluate(0.5, true).ToRhino(), arc.GetEndPoint(1).ToRhino()), arc.GetEndParameter(0), arc.GetEndParameter(1) ) : new ArcCurve ( new Circle(new Plane(arc.Center.ToRhino(), new Vector3d(arc.XDirection.ToRhino()), new Vector3d(arc.YDirection.ToRhino())), arc.Radius), arc.GetEndParameter(0), arc.GetEndParameter(1) )); }