示例#1
0
        public BezierSubdivision Next() // Next index at current level
        {
            var next = new BezierSubdivision(new List <Vector2>(Points), Level, Index + 1);

            next.ScaleLeft(2);
            next.Reverse();
            return(next);
        }
示例#2
0
        public BezierSubdivision Parent() // Parent subdivision (inverse of BezierSubdivide)
        {
            var parent = new BezierSubdivision(new List <Vector2>(Points), Level - 1, Index >> 1);

            if ((Index & 1) == 0)
            {
                parent.ScaleRight(2);
            }
            else
            {
                parent.ScaleLeft(-1);
            }
            return(parent);
        }