DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="4.3.0-beta5657" />

 BoundingBox

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(IBoundingBoxEntity), typeof(IGeometryFactory), new Type[] { })] public class BoundingBox : DesignScriptEntity { internal IBoundingBoxEntity BoundingBoxEntity => HostImpl as IBoundingBoxEntity; public Point MinPoint => Point.Wrap(BoundingBoxEntity.get_MinPoint()); public Point MaxPoint => Point.Wrap(BoundingBoxEntity.get_MaxPoint()); public CoordinateSystem ContextCoordinateSystem => CoordinateSystem.Wrap(BoundingBoxEntity.get_ContextCoordinateSystem()); [SupressImportIntoVM] [GenerateShadowing("FromJson", new Type[] { typeof(string), typeof(double) })] public static BoundingBox FromJson(string json) { return Wrap(HostFactory.Factory.BoundingBoxFromJson(json, DesignScriptEntity.scaleFactor)); } [SupressImportIntoVM] public string ToJson() { return HostImpl.ToJson(DesignScriptEntity.scaleFactor); } internal BoundingBox(IBoundingBoxEntity host) : base(host) { } public BoundingBox Intersection(BoundingBox other) { return Wrap(BoundingBoxEntity.Intersection(Unwrap(other))); } public bool Intersects(BoundingBox other) { return BoundingBoxEntity.Intersects(Unwrap(other)); } public bool IsEmpty() { return BoundingBoxEntity.IsEmpty(); } public bool Contains(Point point) { return BoundingBoxEntity.Contains(Point.Unwrap(point)); } public Cuboid ToCuboid() { return Cuboid.Wrap(BoundingBoxEntity.ToCuboid()); } public PolySurface ToPolySurface() { return PolySurface.Wrap(BoundingBoxEntity.ToPolySurface()); } public static BoundingBox ByGeometry(IEnumerable<Geometry> geom) { return Wrap(HostFactory.Factory.BoundingBoxByGeometry(Geometry.Unwrap(geom))); } public static BoundingBox ByMinimumVolume(IEnumerable<Geometry> geom) { return Wrap(HostFactory.Factory.BoundingBoxByMinimumVolume(Geometry.Unwrap(geom))); } [IsVisibleInDynamoLibrary(false)] public static BoundingBox ByGeometryCoordinateSystem(Geometry geom, [DefaultArgument("Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0)")] CoordinateSystem cs) { return Wrap(HostFactory.Factory.BoundingBoxByGeometryCoordinateSystem(Geometry.Unwrap(geom), CoordinateSystem.Unwrap(cs))); } [IsVisibleInDynamoLibrary(false)] public static BoundingBox ByGeometryCoordinateSystem(IEnumerable<Geometry> geom, [DefaultArgument("Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0)")] CoordinateSystem cs) { return Wrap(HostFactory.Factory.BoundingBoxByGeometryCoordinateSystem(Geometry.Unwrap(geom), CoordinateSystem.Unwrap(cs))); } public static BoundingBox ByCorners([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point min, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(1, 1, 1)")] Point max) { return Wrap(HostFactory.Factory.BoundingBoxByCorners(Point.Unwrap(min), Point.Unwrap(max))); } [IsVisibleInDynamoLibrary(false)] public static BoundingBox ByCornersCoordinateSystem([DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point min, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(1, 1, 1)")] Point max, [DefaultArgument("Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin(0, 0, 0)")] CoordinateSystem cs) { return Wrap(HostFactory.Factory.BoundingBoxByCornersCoordinateSystem(Point.Unwrap(min), Point.Unwrap(max), CoordinateSystem.Unwrap(cs))); } internal static BoundingBox Wrap(IBoundingBoxEntity host) { if (host != null) return new BoundingBox(host); return null; } internal static BoundingBox[] Wrap(IBoundingBoxEntity[] hosts) { return hosts.Select(Wrap).ToArray(); } internal static BoundingBox[][] Wrap(IBoundingBoxEntity[][] hosts) { return hosts.Select(Wrap).ToArray(); } internal static IBoundingBoxEntity Unwrap(BoundingBox o) { return o.BoundingBoxEntity; } internal static IBoundingBoxEntity[] Unwrap(IEnumerable<BoundingBox> o) { return o.Select(Unwrap).ToArray(); } internal static IBoundingBoxEntity[] Unwrap(BoundingBox[] o) { return o.Select(Unwrap).ToArray(); } internal static IBoundingBoxEntity[][] Unwrap(BoundingBox[][] o) { return o.Select(Unwrap).ToArray(); } protected override bool Equals(DesignScriptEntity other) { if (base.Equals(other)) return true; BoundingBox boundingBox = other as BoundingBox; if (boundingBox != null && MinPoint.Equals(boundingBox.MinPoint)) return MaxPoint.Equals(boundingBox.MaxPoint); return false; } protected override int ComputeHashCode() { return HashCode.Combine(MinPoint, MaxPoint); } public override string ToString() { StringBuilder builder = DesignScriptEntity.GetBuilder(); AppendTo(builder); return builder.ToString(); } internal override void AppendTo(StringBuilder builder) { builder.Add("BoundingBox(MinPoint = ", MinPoint).Add(", MaxPoint = ", MaxPoint).Append(")"); } } }