Hi Bruno,
Investigating this led me to find and fix several bugs in the NURBS
implementation, which will give you a MUCH smoother wrong path when
you run your test program.
But that aside, you are seeing a problem because you have very
different weights on your control points, and that is poorly handled
by the algorithm used by linuxcnc, which breaks the NURBS into arcs.
The split we use should do a recursive bisect by arc length, but
instead it uses a fixed number of splits (4 * number of control
points) and splits with equal du, not equal length. Fixing this the
right way is a bit beyond me. Nevertheless, if you understand the
problem I bet you can work around it easily:
Your program, simplified even more, is
G0 X0 Y37.75
G5.2 X39 Y39 P356 L3
X39 Y0 P356
G5.3
So you have three control points. The initial one (0, 37.75) has
weight 1, which is the default weight. The second and third points
have weight 356.
This means the path moves away from the initial point very fast.
This probably doesn't affect the shape you see very much, but it
will affect it a little bit. It does GREATLY affect the algorithm
we use to split into arcs, though -- there are very few points
sampled at the beginning of the curve. That leads to the very poor
path following there (although at least it's smooth now, with one of
my bugfixes.)
If you change your program to weight the points more similarly, you
will get the path you want:
G0 X0 Y37.75
G5.2 P1 (This is how you specify weight for the initial point)
X39 Y39 P10 L3
X39 Y0 P1
G5.3
I think this gives something like the path you want. With the
weights of the control points within a factor of 10, I get very good
path following.
I hope this helps you. It's not perfect and I'm not very happy with
it.
Chris
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers