样条曲线

//样条曲线
        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);
            }
        }
posted @ 2009-12-21 13:04  houlinbo  阅读(494)  评论(0编辑  收藏  举报