样条曲线
//样条曲线
public static NurbCurve3d ToNurbCurve3d(Spline spl)
{
NurbsData ndata = spl.NurbsData;
KnotCollection knots = new KnotCollection();
foreach (Double knot in ndata.GetKnots())
{
knots.Add(knot);
}
if (ndata.Rational)
{
return
new NurbCurve3d(
ndata.Degree,
knots,
ndata.GetControlPoints(),
ndata.GetWeights(),
ndata.Periodic);
}
else
{
return
new NurbCurve3d(
ndata.Degree,
knots,
ndata.GetControlPoints(),
ndata.Periodic);
}
}
public static NurbCurve3d ToNurbCurve3d(Spline spl)
{
NurbsData ndata = spl.NurbsData;
KnotCollection knots = new KnotCollection();
foreach (Double knot in ndata.GetKnots())
{
knots.Add(knot);
}
if (ndata.Rational)
{
return
new NurbCurve3d(
ndata.Degree,
knots,
ndata.GetControlPoints(),
ndata.GetWeights(),
ndata.Periodic);
}
else
{
return
new NurbCurve3d(
ndata.Degree,
knots,
ndata.GetControlPoints(),
ndata.Periodic);
}
}