DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

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

 Arc

public class Arc : Curve
using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; using Dynamo.Graph.Nodes; using ProtoGeometryGenerator; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Autodesk.DesignScript.Geometry { [GenerateFromInterface(typeof(IArcEntity), typeof(IGeometryFactory), new Type[] { })] public class Arc : Curve { internal IArcEntity ArcEntity => HostImpl as IArcEntity; public Point CenterPoint => Point.Wrap(ArcEntity.get_CenterPoint()); [Scaling()] public double Radius { get { return ArcEntity.get_Radius() * DesignScriptEntity.scaleFactor; } } public double StartAngle => ArcEntity.get_StartAngle(); public double SweepAngle => ArcEntity.get_SweepAngle(); [NodeCategory("Create")] public static Arc[] ByStartEndAndTangencies(Point point1, Vector vector1, Point point2, Vector vector2) { return Wrap(HostFactory.Factory.ArcByStartEndAndTangencies(Point.Unwrap(point1), Vector.Unwrap(vector1), Point.Unwrap(point2), Vector.Unwrap(vector2))); } internal Arc(IArcEntity host) : base(host) { } internal new static void InitType() { Geometry.RegisterHostType(typeof(IArcEntity), (IGeometryEntity host) => new Arc(host as IArcEntity)); } public static Arc ByThreePoints(Point firstPoint, Point secondPoint, Point thirdPoint) { return Wrap(HostFactory.Factory.ArcByThreePoints(Point.Unwrap(firstPoint), Point.Unwrap(secondPoint), Point.Unwrap(thirdPoint))); } public static Arc ByCenterPointRadiusAngle([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point center, [DefaultArgument("1")] [Scaling()] double radius, [DefaultArgument("0")] double startAngle, [DefaultArgument("90")] double endAngle, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 1)")] Vector normal) { DesignScriptEntity.CheckArgsForAsmExtents(radius); return Wrap(HostFactory.Factory.ArcByCenterPointRadiusAngle(Point.Unwrap(center), radius / DesignScriptEntity.scaleFactor, startAngle, endAngle, Vector.Unwrap(normal))); } public static Arc ByCenterPointStartPointSweepAngle([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point centerPoint, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(1, 0, 0)")] Point startPoint, [DefaultArgument("90")] double sweepAngle, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 1)")] Vector normal) { return Wrap(HostFactory.Factory.ArcByCenterPointStartPointSweepAngle(Point.Unwrap(centerPoint), Point.Unwrap(startPoint), sweepAngle, Vector.Unwrap(normal))); } public static Arc ByCenterPointStartPointEndPoint([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point centerPoint, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(1, 0, 0)")] Point startPoint, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 1, 0)")] Point endPoint) { return Wrap(HostFactory.Factory.ArcByCenterPointStartPointEndPoint(Point.Unwrap(centerPoint), Point.Unwrap(startPoint), Point.Unwrap(endPoint))); } public static Arc ByFillet(Curve curve1, Curve curve2, [Scaling()] double radius) { DesignScriptEntity.CheckArgsForAsmExtents(radius); return Wrap(HostFactory.Factory.ArcByFillet(Curve.Unwrap(curve1), Curve.Unwrap(curve2), radius / DesignScriptEntity.scaleFactor)); } public static Arc ByFilletTangentToCurve(Curve curve1, Curve curveTangentTo, Curve curve2) { return Wrap(HostFactory.Factory.ArcByFilletTangentToCurve(Curve.Unwrap(curve1), Curve.Unwrap(curveTangentTo), Curve.Unwrap(curve2))); } public static Arc ByBestFitThroughPoints(IEnumerable<Point> points) { return Wrap(HostFactory.Factory.ArcByBestFitThroughPoints(Point.Unwrap(points))); } public static Arc ByStartPointEndPointStartTangent(Point startPoint, Point endPoint, Vector startTangent) { return Wrap(HostFactory.Factory.ArcByStartPointEndPointStartTangent(Point.Unwrap(startPoint), Point.Unwrap(endPoint), Vector.Unwrap(startTangent))); } internal static Arc Wrap(IArcEntity host) { if (host != null) return new Arc(host); return null; } internal static Arc[] Wrap(IArcEntity[] hosts) { return hosts.Select(Wrap).ToArray(); } internal static Arc[][] Wrap(IArcEntity[][] hosts) { return hosts.Select(Wrap).ToArray(); } internal static IArcEntity Unwrap(Arc o) { return o.ArcEntity; } internal static IArcEntity[] Unwrap(IEnumerable<Arc> o) { return o.Select(Unwrap).ToArray(); } internal static IArcEntity[] Unwrap(Arc[] o) { return o.Select(Unwrap).ToArray(); } internal static IArcEntity[][] Unwrap(Arc[][] 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("Arc(Normal = ", Normal).Add(", CenterPoint = ", CenterPoint).Add(", Radius = ", Radius) .Add(", StartAngle = ", StartAngle) .Add(", SweepAngle = ", SweepAngle) .Append(")"); } } }