DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="0.9.0-beta1" />

 Surface

public class Surface : Topology
using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; using System.Collections.Generic; using System.Linq; namespace Autodesk.DesignScript.Geometry { public class Surface : Topology { internal ISurfaceEntity SurfaceEntity => HostImpl as ISurfaceEntity; public double Area => SurfaceEntity.Area; public double Perimeter => SurfaceEntity.Perimeter; public bool ClosedInU => SurfaceEntity.ClosedInU; public bool ClosedInV => SurfaceEntity.ClosedInV; public bool Closed => SurfaceEntity.Closed; internal Surface(ISurfaceEntity host, bool persist) : base(host, persist) { } public override string ToString() { return "Surface"; } internal new static void InitType() { Geometry.RegisterHostType(typeof(ISurfaceEntity), (IGeometryEntity host, bool persist) => new Surface(host as ISurfaceEntity, persist)); } internal static Surface Wrap(ISurfaceEntity host, bool persist = true) { return Geometry.Wrap(host, false, null) as Surface; } internal static Surface[] Wrap(ISurfaceEntity[] hosts, bool persist = true) { return (from x in hosts select Wrap(x, persist)).ToArray(); } internal static Surface[][] Wrap(ISurfaceEntity[][] hosts, bool persist = true) { return (from x in hosts select Wrap(x, persist)).ToArray(); } internal static ISurfaceEntity[][] Unwrap(Surface[][] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ISurfaceEntity[] Unwrap(Surface[] o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ISurfaceEntity[] Unwrap(IEnumerable<Surface> o) { return (from x in o select Unwrap(x)).ToArray(); } internal static ISurfaceEntity Unwrap(Surface o) { return o.SurfaceEntity; } public static Surface ByLoft(IEnumerable<Curve> crossSections) { return Wrap(HostFactory.Factory.SurfaceByLoft(Curve.Unwrap(crossSections)), true); } public static Surface ByRuledLoft(IEnumerable<Line> crossSections) { return Wrap(HostFactory.Factory.SurfaceByRuledLoft(Line.Unwrap(crossSections)), true); } public static Surface ByLoft(IEnumerable<Curve> crossSections, Curve guideCurve) { return Wrap(HostFactory.Factory.SurfaceByLoft(Curve.Unwrap(crossSections), Curve.Unwrap(guideCurve)), true); } public static Surface ByLoft(IEnumerable<Curve> crossSections, IEnumerable<Curve> guideCurves) { return Wrap(HostFactory.Factory.SurfaceByLoft(Curve.Unwrap(crossSections), Curve.Unwrap(guideCurves)), true); } public static Surface BySweep(Curve profile, Curve path) { return Wrap(HostFactory.Factory.SurfaceBySweep(Curve.Unwrap(profile), Curve.Unwrap(path)), true); } public static Surface ByPerimeterPoints(IEnumerable<Point> points) { return Wrap(HostFactory.Factory.SurfaceByPerimeterPoints(Point.Unwrap(points)), true); } public static Surface BySweep2Rails(Curve rail1, Curve rail2, Curve profile) { return Wrap(HostFactory.Factory.SurfaceBySweep2Rails(Curve.Unwrap(rail1), Curve.Unwrap(rail2), Curve.Unwrap(profile)), true); } public static Surface ByRevolve(Curve profile, [DefaultArgument("Point.ByCoordinates(0, 0, 0)")] Point axisOrigin, [DefaultArgument("Vector.ByCoordinates(0, 0, 1)")] Vector axisDirection, double startAngle = 0, double sweepAngle = 180) { return Wrap(HostFactory.Factory.SurfaceByRevolve(Curve.Unwrap(profile), Point.Unwrap(axisOrigin), Vector.Unwrap(axisDirection), startAngle, sweepAngle), true); } public static Surface ByPatch(Curve closedCurve) { return Wrap(HostFactory.Factory.SurfaceByPatch(Curve.Unwrap(closedCurve)), true); } public Geometry[] SubtractFrom(Solid trimmingEntity) { return Geometry.Wrap(SurfaceEntity.SubtractFrom(Solid.Unwrap(trimmingEntity))); } public UV UVParameterAtPoint(Point point) { return UV.Wrap(SurfaceEntity.UVParameterAtPoint(Point.Unwrap(point)), true); } public Surface TrimWithEdgeLoops(IEnumerable<PolyCurve> loops) { return Wrap(SurfaceEntity.TrimWithEdgeLoops(PolyCurve.Unwrap(loops)), true); } public Vector NormalAtPoint(Point point) { return Vector.Wrap(SurfaceEntity.NormalAtPoint(Point.Unwrap(point)), true); } public NurbsSurface ToNurbsSurface() { return NurbsSurface.Wrap(SurfaceEntity.ToNurbsSurface(), true); } public NurbsSurface ApproximateWithTolerance(double tolerance = 0.001) { return NurbsSurface.Wrap(SurfaceEntity.ApproximateWithTolerance(tolerance), true); } public Solid Thicken(double thickness = 1) { return Solid.Wrap(SurfaceEntity.Thicken(thickness), true); } public Solid Thicken(double thickness = 1, bool both_sides = true) { return Solid.Wrap(SurfaceEntity.Thicken(thickness, both_sides), true); } public Surface Offset(double distance = 1) { return Wrap(SurfaceEntity.Offset(distance), true); } public CoordinateSystem CurvatureAtParameter(double u = 0, double v = 0) { return CoordinateSystem.Wrap(SurfaceEntity.CurvatureAtParameter(u, v), true); } public CoordinateSystem CoordinateSystemAtParameter(double u = 0, double v = 0) { return CoordinateSystem.Wrap(SurfaceEntity.CoordinateSystemAtParameter(u, v), true); } public Vector TangentAtUParameter(double u = 0, double v = 0) { return Vector.Wrap(SurfaceEntity.TangentAtUParameter(u, v), true); } public Vector TangentAtVParameter(double u = 0, double v = 0) { return Vector.Wrap(SurfaceEntity.TangentAtVParameter(u, v), true); } public Vector NormalAtParameter(double u = 0, double v = 0) { return Vector.Wrap(SurfaceEntity.NormalAtParameter(u, v), true); } public Vector[] DerivativesAtParameter(double u = 0, double v = 0) { return Vector.Wrap(SurfaceEntity.DerivativesAtParameter(u, v), true); } public double GaussianCurvatureAtParameter(double u = 0, double v = 0) { return SurfaceEntity.GaussianCurvatureAtParameter(u, v); } public double[] PrincipalCurvaturesAtParameter(double u = 0, double v = 0) { return SurfaceEntity.PrincipalCurvaturesAtParameter(u, v); } public Vector[] PrincipalDirectionsAtParameter(double u = 0, double v = 0) { return Vector.Wrap(SurfaceEntity.PrincipalDirectionsAtParameter(u, v), true); } public Point PointAtParameter(double u = 0, double v = 0) { return Point.Wrap(SurfaceEntity.PointAtParameter(u, v), true); } public Curve[] PerimeterCurves() { return Curve.Wrap(SurfaceEntity.PerimeterCurves(), true); } public Curve GetIsoline(int isoDirection = 0, double parameter = 0) { return Curve.Wrap(SurfaceEntity.GetIsoline(isoDirection, parameter), true); } public Surface FlipNormalDirection() { return Wrap(SurfaceEntity.FlipNormalDirection(), true); } public PolySurface Join(Surface otherSurface) { return PolySurface.Wrap(SurfaceEntity.Join(Unwrap(otherSurface)), true); } public PolySurface Join(IEnumerable<Surface> otherSurfaces) { return PolySurface.Wrap(SurfaceEntity.Join(Unwrap(otherSurfaces)), true); } public Geometry[] ProjectInputOnto(Geometry geometryToProject, Vector projectionDirection) { return Geometry.Wrap(SurfaceEntity.ProjectInputOnto(Geometry.Unwrap(geometryToProject), Vector.Unwrap(projectionDirection))); } } }