How to create simple 2D NURBS using XAML?

I need to create a spline with two endpoints and "n" control points.
As far as I know, the Bezier curve allows you to use only one control point, and the Bezier spline allows you to use two control points. However, I need to be able to add as many milestones as I see fit, not just one or two.

Here is an example of what I want to achieve with four milestones:
(Source: Wikipedia article on NURBS )
343px-NURBstatic.svg.png
So far I have managed to combine the BezierSegments series together like this:
http://img297.imageshack.us/img297/3706/bezierpath .png

<Polyline   Stroke="Green" Stretch="Uniform"
            Points="0,0 1,2 2,1 3,3 4,3 5,2 6,3 7,2 8,1.75 9,2.5" />

<Path Stroke="Red" Stretch="Uniform">
  <Path.Data>
    <PathGeometry>
      <PathGeometry.Figures>
        <PathFigureCollection>
          <PathFigure StartPoint="0,0">
            <PathFigure.Segments>
              <PathSegmentCollection>
                <BezierSegment Point1="1,2" Point2="2,1" Point3="3,3" />
                <BezierSegment Point1="4,3" Point2="5,2" Point3="6,3" />
                <BezierSegment Point1="7,2" Point2="8,1.75" Point3="9,2.5" />
              </PathSegmentCollection>
            </PathFigure.Segments>
          </PathFigure>
        </PathFigureCollection>
      </PathGeometry.Figures>
    </PathGeometry>
  </Path.Data>
</Path>
+3
2

, , , NURBS #, - PathSegment WPF.

+2

NURBS, , , , .

1 , 2 ( 3 ).

(3,3), 2 (2,1), 1 (4,5) (4,3) .

1 (7,4), (5,2) (6,3), , :

 BezierSegment Point1="1,2" Point2="2,1" Point3="3,3"

 BezierSegment Point1="4,5" Point2="5,2" Point3="6,3" 

 BezierSegment Point1="7,4" Point2="8,1.75" Point3="9,2.5" 

, (4,3) (7,2) , . , , point1, .

:

+1

Source: https://habr.com/ru/post/1718216/


All Articles