Solid
using Autodesk.DesignScript.Geometry.Properties;
using Autodesk.DesignScript.Interfaces;
using Autodesk.DesignScript.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
    public class Solid : Topology
    {
        internal ISolidEntity SolidEntity => HostImpl as ISolidEntity;
        [Scaling()]
        public double Area {
            get {
                return SolidEntity.get_Area() * Math.Pow(DesignScriptEntity.scaleFactor, 2);
            }
        }
        [Scaling()]
        public double Volume {
            get {
                return SolidEntity.get_Volume() * Math.Pow(DesignScriptEntity.scaleFactor, 3);
            }
        }
        internal Solid(ISolidEntity host, bool persist)
            : base(host, persist)
        {
        }
        public override string ToString()
        {
            return "Solid";
        }
        internal new static void InitType()
        {
            Geometry.RegisterHostType(typeof(ISolidEntity), (IGeometryEntity host, bool persist) => new Solid(host as ISolidEntity, persist));
        }
        internal static Solid Wrap(ISolidEntity host, bool persist = true)
        {
            return Geometry.Wrap(host, false, null) as Solid;
        }
        internal static Solid[] Wrap(ISolidEntity[] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static Solid[][] Wrap(ISolidEntity[][] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static ISolidEntity[][] Unwrap(Solid[][] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static ISolidEntity[] Unwrap(Solid[] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static ISolidEntity[] Unwrap(IEnumerable<Solid> o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static ISolidEntity Unwrap(Solid o)
        {
            return o.SolidEntity;
        }
        public static Solid ByJoinedSurfaces(IEnumerable<Surface> facesOfSolid)
        {
            return Wrap(HostFactory.Factory.SolidByJoinedSurfaces(Surface.Unwrap(facesOfSolid)), true);
        }
        public static Solid ByLoft(IEnumerable<Curve> crossSections)
        {
            return Wrap(HostFactory.Factory.SolidByLoft(Curve.Unwrap(crossSections)), true);
        }
        [SupressImportIntoVM]
        [Obsolete("This method is deprecated and will be removed in a future version of Dynamo. Use Solid.ByLoft(ICurveEntity[] crossSections, ICurveEntity[] guideCurves) instead")]
        public static Solid ByLoft(IEnumerable<Curve> crossSections, Curve guideCurve)
        {
            return Wrap(HostFactory.Factory.SolidByLoft(Curve.Unwrap(crossSections), Curve.Unwrap(guideCurve)), true);
        }
        public static Solid ByLoft(IEnumerable<Curve> crossSections, IEnumerable<Curve> guideCurves)
        {
            return Wrap(HostFactory.Factory.SolidByLoft(Curve.Unwrap(crossSections), Curve.Unwrap(guideCurves)), true);
        }
        public static Solid ByRuledLoft(IEnumerable<PolyCurve> crossSections, bool checkAndRepair = true)
        {
            return Wrap(HostFactory.Factory.SolidByRuledLoft(PolyCurve.Unwrap(crossSections), checkAndRepair), true);
        }
        [IsVisibleInDynamoLibrary(false)]
        [IsObsolete("solid_bysweep_deprecated", typeof(Resources))]
        [Obsolete("This method is deprecated and will be removed in a future version of Dynamo. Use SolidBySweep(ICurveEntity profile, ICurveEntity path, bool cutEndOff) instead")]
        public static Solid BySweep(Curve profile, Curve path)
        {
            return Wrap(HostFactory.Factory.SolidBySweep(Curve.Unwrap(profile), Curve.Unwrap(path)), true);
        }
        public static Solid BySweep(Curve profile, Curve path, bool cutEndOff = false)
        {
            return Wrap(HostFactory.Factory.SolidBySweep(Curve.Unwrap(profile), Curve.Unwrap(path), cutEndOff), true);
        }
        public static Solid BySweep2Rails(Curve path, Curve guideRail, Curve profile)
        {
            return Wrap(HostFactory.Factory.SolidBySweep2Rails(Curve.Unwrap(path), Curve.Unwrap(guideRail), Curve.Unwrap(profile)), true);
        }
        public static Solid ByRevolve(Curve profile, [DefaultArgument("Autodesk.DesignScript.Geometry.Point.ByCoordinates(0, 0, 0)")] Point axisOrigin, [DefaultArgument("Autodesk.DesignScript.Geometry.Vector.ByCoordinates(0, 0, 1)")] Vector axisDirection, double startAngle = 0, double sweepAngle = 180)
        {
            return Wrap(HostFactory.Factory.SolidByRevolve(Curve.Unwrap(profile), Point.Unwrap(axisOrigin), Vector.Unwrap(axisDirection), startAngle, sweepAngle), true);
        }
        public static Solid ByUnion(IEnumerable<Solid> solids)
        {
            return Wrap(HostFactory.Factory.SolidByUnion(Unwrap(solids)), true);
        }
        public Point Centroid()
        {
            return Point.Wrap(SolidEntity.Centroid(), true);
        }
        public Solid Union(Solid solid)
        {
            return Wrap(SolidEntity.Union(Unwrap(solid)), true);
        }
        [IsObsolete("solid_unionall_deprecated", typeof(Resources))]
        [Obsolete("This method is deprecated and will be removed in a future version of Dynamo. Use Solid.ByUnion instead")]
        public Solid UnionAll(IEnumerable<Solid> solids)
        {
            return Wrap(SolidEntity.UnionAll(Unwrap(solids)), true);
        }
        public Solid Difference(Solid other)
        {
            return Wrap(SolidEntity.Difference(Unwrap(other)), true);
        }
        public Solid DifferenceAll(IEnumerable<Solid> others)
        {
            return Wrap(SolidEntity.DifferenceAll(Unwrap(others)), true);
        }
        public Solid ThinShell([Scaling()] double internalFaceThickness = 1, [Scaling()] double externalFaceThickness = 1)
        {
            DesignScriptEntity.CheckArgsForAsmExtents(new List<double> {
                internalFaceThickness,
                externalFaceThickness
            });
            internalFaceThickness /= DesignScriptEntity.scaleFactor;
            externalFaceThickness /= DesignScriptEntity.scaleFactor;
            return Wrap(SolidEntity.ThinShell(internalFaceThickness, externalFaceThickness), true);
        }
        public Geometry[] ProjectInputOnto(Geometry geometryToProject, Vector projectDirection)
        {
            return Geometry.Wrap(SolidEntity.ProjectInputOnto(Geometry.Unwrap(geometryToProject), Vector.Unwrap(projectDirection)));
        }
        public Solid Fillet(IEnumerable<Edge> edges, [Scaling()] double radius)
        {
            DesignScriptEntity.CheckArgsForAsmExtents(new List<double> {
                radius
            });
            radius /= DesignScriptEntity.scaleFactor;
            return Wrap(SolidEntity.Fillet(Edge.Unwrap(edges), radius), true);
        }
        public Solid Chamfer(IEnumerable<Edge> edges, [Scaling()] double offset)
        {
            DesignScriptEntity.CheckArgsForAsmExtents(new List<double> {
                offset
            });
            offset /= DesignScriptEntity.scaleFactor;
            return Wrap(SolidEntity.Chamfer(Edge.Unwrap(edges), offset), true);
        }
        [AllowRankReduction]
        public Solid[] Separate()
        {
            return Wrap(SolidEntity.Separate(), true);
        }
        public Geometry Repair()
        {
            return Geometry.Wrap(SolidEntity.Repair(), false, null);
        }
    }
}
            