DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="4.2.0-beta5530" />

 Sphere

public class Sphere : Solid
using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; using ProtoGeometryGenerator; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Autodesk.DesignScript.Geometry { [GenerateFromInterface(typeof(ISphereEntity), typeof(IGeometryFactory), new Type[] { })] 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) { } internal new static void InitType() { Geometry.RegisterHostType(typeof(ISphereEntity), (IGeometryEntity host) => new Sphere(host as ISphereEntity)); } public static Sphere ByCenterPointRadius([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point centerPoint, [Scaling()] double radius = 1) { DesignScriptEntity.CheckArgsForAsmExtents(radius); return Wrap(HostFactory.Factory.SphereByCenterPointRadius(Point.Unwrap(centerPoint), radius / DesignScriptEntity.scaleFactor)); } 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))); } internal static Sphere Wrap(ISphereEntity host) { if (host != null) return new Sphere(host); return null; } internal static Sphere[] Wrap(ISphereEntity[] hosts) { return hosts.Select(Wrap).ToArray(); } internal static Sphere[][] Wrap(ISphereEntity[][] hosts) { return hosts.Select(Wrap).ToArray(); } internal static ISphereEntity Unwrap(Sphere o) { return o.SphereEntity; } internal static ISphereEntity[] Unwrap(IEnumerable<Sphere> o) { return o.Select(Unwrap).ToArray(); } internal static ISphereEntity[] Unwrap(Sphere[] o) { return o.Select(Unwrap).ToArray(); } internal static ISphereEntity[][] Unwrap(Sphere[][] o) { return o.Select(Unwrap).ToArray(); } public override string ToString() { StringBuilder builder = DesignScriptEntity.GetBuilder(); AppendTo(builder); return builder.ToString(); } internal override void AppendTo(StringBuilder builder) { builder.Add("Sphere(CenterPoint = ", CenterPoint).Add(", Radius = ", Radius).Append(")"); } } }