Showing results for 
Search instead for 
Do you mean 
Reply

Extract Y coordinate if X coordinate is known from a 2D spline

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.  

5 REPLIES

Re: Extract Y coordinate if X coordinate is known from a 2D spline

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.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Extract Y coordinate if X coordinate is known from a 2D spline

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.

山田
yamada

Re: Extract Y coordinate if X coordinate is known from a 2D spline

How can we get those equations?

Re: Extract Y coordinate if X coordinate is known from a 2D spline

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.

 

Regards,

Abhi

 

Re: Extract Y coordinate if X coordinate is known from a 2D spline

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

  • 3D control points (poles). There are n of these.
  • Weight values, one for each pole, so there are n of these.
  • An order value, k. If the degree of the curve is m, then k = m+1.
  • Knot values. There are n+k of these

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.

 

 

山田
yamada