« Return to Thread: SVG Reader Feedback

Re: SVG Reader Feedback

by Timothy M. Shead :: Rate this Message:

Reply to Author | View in Thread

Carlos Dominguez wrote:

> To actually import a path from SVG the main problem is to convert the
> bezier curves from the svg file to k3d NURBS. This shouldn't be a
> difficult task and I almost have it right, you just need to change the
> knot, and weight vector accordingly (Figure 1 is how it's supposed to
> be). The problem is that when I do this in k3d no matter how I change
> the two middle control point weights, the curve always goes to the top
> (As shown in figure 2) even when I put a very little weight on
> them(the middle ones) like 0.01 which would mean that those control
> points have very little contribution, but in k3d it looks kind of like
> in figure 3 which made me suspect it is the way it is constructed
> because as of what I know (please correct me if I'm wrong) the curve
> should look more or less like figure 4 with that weights. What do you
> think I should do?  Change the control points accordingly to match the
> original curve? or should the NURBS construction algorithm change?
> Thanks in advance!
Carlos:

To create a Bezier curve, all of the control-point weights must be 1.0.  
You probably aren't setting the knot vector correctly.  My recollection
is that the knot vector for a Bezier curve of order k is:

* k identical values for the first control point.
* k identical values for the last control point.
* k-1 identical values for the other control points.

So for your example of an order 3 curve with 4 control points, a
reasonable knot vector would be

0 0 0 1 1 2 2 3 3 3

Cheers,
Tim


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

 « Return to Thread: SVG Reader Feedback