Help creating splines

Jul 9, 2015 at 9:55 PM
I'm trying to create a closed spline that touches four points, e.g. 0,2 4,0 0,-6 -8,0, however it is creating a spline that's near the points but not touching them. I've set the degree to 3 and I think I need to set the knots to be proportionally spaced out as the points are. But despite many hours of trying I can't get the output I'm looking for. Sorry this is probably a rooky question but I am stuck. Any guidance on how the knots work would be greatly appreciated.
PS this is a really useful tool
Jul 11, 2015 at 11:19 AM
When creating a spline you need to pass a list of SplineVertexes that defines the control points of the NURBS. They determine the shape of the curve, like a cage, but the resulting spline do not pass through those points. Additionally you can set the weight of the control point that will push the curve towards or away from it, but it will not touch them. The knot vector will influence how the control points affect the NURBS curve, but many times there is no need to set them, usually they are not helpful from a user's point of view since it is a lot less intuitive than editing the control points.

At the moment, there is no way to build a spline from a set of points that the curve must pass through.

Jul 11, 2015 at 11:42 AM

Thanks very much for the response. It looks as though I’ll have to do some thinking on this one.

I have to say the code is fantastic it has saved me a huge amount of time and effort. On the back of this I’ve got a WPF/XAML viewer that plots the CAD drawing using XAML shapes. Is this something that you feel would be useful to throw into the application? I’m more than happy to tidy it up and add it to the code if others would find that helpful.

Thanks again


Jul 15, 2015 at 5:38 PM
Once in a while, there is someone asking for exactly that; so, sure there will be people interested. If you want to share that code you can open your own project in your code hosting web of choice like codeplex, github, or similar; or make a fork of this project. But, I would recommend to maintain netDxf and your viewer in different dlls.