I have a 2D spline in XY plane. How do I extract one coordinate if the other is known using UFUNC or NXOPEN? Currently I am constructing a plane parallel to XY plane at known X and using intersection of the curve with that plane to get the point. Is there a direct way? Something which utilizes the equation of spline directly.
Note in a general case, there may also be 0 or (more than 1) intersection point.
If you don't KNOW the spline characteristics, you may want to check for these cases as well.
Offhand, other than walking the spline's parameter (to find the "U" value where the point on the spline at that U is the desired X), I don't know of a better way than you are doing.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled
Intersection is the only way to do this. To find the y value at x=k, you can either intersect the spline with the line x=k, or intersect with the plane x=k.
You can get the equation of the spline in the form x = x(t) y = y(t), and use numerical methods to solve the equation x(t) = k. But, in effect, you'd just be re-implementing NX's intersection function.
Have you tried getting the coordinates of spline in this way?
Dim MyPoint As Point4d = MySpline.GetPoles(i)
where i is the no of poles the spline is having.
An NX spline is just a standard NURBS (Non-uniform Rational B-Spline). You can find the equation in many places on the 'net. One example is this Wikipedia page.
The equation involves
You can get all of the above data by calling NX/Open functions.
But, again, once you have the equation, you still have to do an intersection calculation to get the y corresponding to a given x. Better to use the NX intersection algorithm, rather than one you write yourself.