DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="4.1.0-beta3034" />

 Sphere

public class Sphere : Solid
using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; using System.Collections.Generic; using System.Globalization; using System.Linq; namespace Autodesk.DesignScript.Geometry { public class Sphere : Solid { internal ISphereEntity SphereEntity => HostImpl as ISphereEntity; public Point CenterPoint => Point.Wrap(SphereEntity.get_CenterPoint()); [Scaling()] public double Radius { get { return SphereEntity.get_Radius() * DesignScriptEntity.scaleFactor; } } internal Sphere(ISphereEntity host) : base(host) { } public override string ToString() { return "Sphere(CenterPoint = " + CenterPoint?.ToString() + ", Radius = " + Radius.ToString(GeometryExtension.DoublePrintFormat, CultureInfo.InvariantCulture) + ")"; } internal new static void InitType() { Geometry.RegisterHostType(typeof(ISphereEntity), (IGeometryEntity host) => new Sphere(host as ISphereEntity)); } internal static Sphere Wrap(ISphereEntity host) { if (host == null) return null; return new Sphere(host); } internal static Sphere[] Wrap(ISphereEntity[] hosts) { return (from x in hosts select Wrap(x)).ToArray(); } internal static Sphere[][] Wrap(ISphereEntity[][] hosts) { return (from x in hosts select Wrap(x)).ToArray(); } internal static ISphereEntity[][] Unwrap(Sphere[][] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ISphereEntity[] Unwrap(Sphere[] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ISphereEntity[] Unwrap(IEnumerable<Sphere> o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ISphereEntity Unwrap(Sphere o) { return o.SphereEntity; } public static Sphere ByCenterPointRadius([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point centerPoint, [Scaling()] double radius = 1) { DesignScriptEntity.CheckArgsForAsmExtents(new List<double> { radius }); radius /= DesignScriptEntity.scaleFactor; return Wrap(HostFactory.Factory.SphereByCenterPointRadius(Point.Unwrap(centerPoint), radius)); } public static Sphere ByFourPoints(IEnumerable<Point> points) { return Wrap(HostFactory.Factory.SphereByFourPoints(Point.Unwrap(points))); } public static Sphere ByBestFit(IEnumerable<Point> points) { return Wrap(HostFactory.Factory.SphereByBestFit(Point.Unwrap(points))); } } }