DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="2.0.0-beta2536" />

 Circle

public class Circle : Curve
using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; using System.Collections.Generic; using System.Globalization; using System.Linq; namespace Autodesk.DesignScript.Geometry { public class Circle : Curve { internal ICircleEntity CircleEntity => HostImpl as ICircleEntity; public Point CenterPoint => Point.Wrap(CircleEntity.get_CenterPoint(), true); [Scaling()] public double Radius { get { return CircleEntity.get_Radius() * DesignScriptEntity.scaleFactor; } } internal Circle(ICircleEntity host, bool persist) : base(host, persist) { } public override string ToString() { return "Circle(Normal = " + base.Normal + ", CenterPoint = " + CenterPoint + ", Radius = " + Radius.ToString(GeometryExtension.DoublePrintFormat, CultureInfo.InvariantCulture) + ")"; } internal new static void InitType() { Geometry.RegisterHostType(typeof(ICircleEntity), (IGeometryEntity host, bool persist) => new Circle(host as ICircleEntity, persist)); } internal static Circle Wrap(ICircleEntity host, bool persist = true) { return Geometry.Wrap(host, false, null) as Circle; } internal static Circle[] Wrap(ICircleEntity[] hosts, bool persist = true) { return (from x in hosts select Wrap(x, persist)).ToArray(); } internal static Circle[][] Wrap(ICircleEntity[][] hosts, bool persist = true) { return (from x in hosts select Wrap(x, persist)).ToArray(); } internal static ICircleEntity[][] Unwrap(Circle[][] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ICircleEntity[] Unwrap(Circle[] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ICircleEntity[] Unwrap(IEnumerable<Circle> o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ICircleEntity Unwrap(Circle o) { return o.CircleEntity; } public static Circle ByCenterPointRadius([DefaultArgument("Point.ByCoordinates(0, 0, 0)")] Point centerPoint, [Scaling()] double radius = 1) { radius /= DesignScriptEntity.scaleFactor; return Wrap(HostFactory.Factory.CircleByCenterPointRadius(Point.Unwrap(centerPoint), radius), true); } public static Circle ByCenterPointRadiusNormal([DefaultArgument("Point.ByCoordinates(0, 0, 0)")] Point centerPoint, [DefaultArgument("1")] [Scaling()] double radius, [DefaultArgument("Vector.ByCoordinates(0, 0, 1)")] Vector normal) { radius /= DesignScriptEntity.scaleFactor; return Wrap(HostFactory.Factory.CircleByCenterPointRadiusNormal(Point.Unwrap(centerPoint), radius, Vector.Unwrap(normal)), true); } public static Circle ByPlaneRadius([DefaultArgument("Plane.XY()")] Plane plane, [Scaling()] double radius = 1) { radius /= DesignScriptEntity.scaleFactor; return Wrap(HostFactory.Factory.CircleByPlaneRadius(Plane.Unwrap(plane), radius), true); } public static Circle ByThreePoints(Point p1, Point p2, Point p3) { return Wrap(HostFactory.Factory.CircleByThreePoints(Point.Unwrap(p1), Point.Unwrap(p2), Point.Unwrap(p3)), true); } public static Circle ByBestFitThroughPoints(IEnumerable<Point> points) { return Wrap(HostFactory.Factory.CircleByBestFitThroughPoints(Point.Unwrap(points)), true); } } }