NurbsSurface
using Autodesk.DesignScript.Interfaces;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
public class NurbsSurface : Surface
{
internal INurbsSurfaceEntity NurbsSurfaceEntity => HostImpl as INurbsSurfaceEntity;
public int DegreeU => NurbsSurfaceEntity.get_DegreeU();
public int DegreeV => NurbsSurfaceEntity.get_DegreeV();
public int NumControlPointsU => NurbsSurfaceEntity.get_NumControlPointsU();
public int NumControlPointsV => NurbsSurfaceEntity.get_NumControlPointsV();
public bool IsPeriodicInU => NurbsSurfaceEntity.get_IsPeriodicInU();
public bool IsPeriodicInV => NurbsSurfaceEntity.get_IsPeriodicInV();
public bool IsRational => NurbsSurfaceEntity.get_IsRational();
internal NurbsSurface(INurbsSurfaceEntity host, bool persist)
: base(host, persist)
{
}
public override string ToString()
{
return "NurbsSurface(DegreeU = " + DegreeU + ", DegreeV = " + DegreeV + ")";
}
internal new static void InitType()
{
Geometry.RegisterHostType(typeof(INurbsSurfaceEntity), (IGeometryEntity host, bool persist) => new NurbsSurface(host as INurbsSurfaceEntity, persist));
}
internal static NurbsSurface Wrap(INurbsSurfaceEntity host, bool persist = true)
{
return Geometry.Wrap(host, false, null) as NurbsSurface;
}
internal static NurbsSurface[] Wrap(INurbsSurfaceEntity[] hosts, bool persist = true)
{
return (from x in hosts
select Wrap(x, persist)).ToArray();
}
internal static NurbsSurface[][] Wrap(INurbsSurfaceEntity[][] hosts, bool persist = true)
{
return (from x in hosts
select Wrap(x, persist)).ToArray();
}
internal static INurbsSurfaceEntity[][] Unwrap(NurbsSurface[][] o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static INurbsSurfaceEntity[] Unwrap(NurbsSurface[] o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static INurbsSurfaceEntity[] Unwrap(IEnumerable<NurbsSurface> o)
{
return (from x in o
select Unwrap(x)).ToArray();
}
internal static INurbsSurfaceEntity Unwrap(NurbsSurface o)
{
return o.NurbsSurfaceEntity;
}
public static NurbsSurface ByPoints(Point[][] points, int uDegree = 3, int vDegree = 3)
{
return Wrap(HostFactory.Factory.NurbsSurfaceByPoints(Point.Unwrap(points), uDegree, vDegree), true);
}
public static NurbsSurface ByPointsTangents(Point[][] points, IEnumerable<Vector> startUTangents, IEnumerable<Vector> endUTangents, IEnumerable<Vector> startVTangents, IEnumerable<Vector> endVTangents)
{
return Wrap(HostFactory.Factory.NurbsSurfaceByPointsTangents(Point.Unwrap(points), Vector.Unwrap(startUTangents), Vector.Unwrap(endUTangents), Vector.Unwrap(startVTangents), Vector.Unwrap(endVTangents)), true);
}
public static NurbsSurface ByPointsTangentsKnotsDerivatives(Point[][] points, IEnumerable<Vector> startUTangents, IEnumerable<Vector> endUTangents, IEnumerable<Vector> startVTangents, IEnumerable<Vector> endVTangents, double[] uKnots, double[] vKnots, IEnumerable<Vector> cornerTwistDerivatives)
{
return Wrap(HostFactory.Factory.NurbsSurfaceByPointsTangentsKnotsDerivatives(Point.Unwrap(points), Vector.Unwrap(startUTangents), Vector.Unwrap(endUTangents), Vector.Unwrap(startVTangents), Vector.Unwrap(endVTangents), uKnots, vKnots, Vector.Unwrap(cornerTwistDerivatives)), true);
}
public static NurbsSurface ByControlPoints(Point[][] controlVertices, int uDegree = 3, int vDegree = 3)
{
return Wrap(HostFactory.Factory.NurbsSurfaceByControlPoints(Point.Unwrap(controlVertices), uDegree, vDegree), true);
}
public static NurbsSurface ByControlPointsWeightsKnots(Point[][] controlVertices, double[][] weights, double[] knotsU, double[] knotsV, int uDegree = 3, int vDegree = 3)
{
return Wrap(HostFactory.Factory.NurbsSurfaceByControlPointsWeightsKnots(Point.Unwrap(controlVertices), weights, knotsU, knotsV, uDegree, vDegree), true);
}
public Point[][] ControlPoints()
{
return Point.Wrap(NurbsSurfaceEntity.ControlPoints(), true);
}
public double[][] Weights()
{
return NurbsSurfaceEntity.Weights();
}
public double[] UKnots()
{
return NurbsSurfaceEntity.UKnots();
}
public double[] VKnots()
{
return NurbsSurfaceEntity.VKnots();
}
}
}