Jump to content

implicitization of NURBS surface


Richard Baker

Recommended Posts

For simplicity, I am only using second order NURBS. I have a NURBS surface which essentially takes the form of x(u,v) and y(u,v) and z(u,v) are all quadratic functions of u and v.  Would I be correct to say that there exists a quadric of the form 0=ax+ by+ cz+ dxy + eyz + fzx + gx + hy + iz + j which is equivalent to the parametric representation?  I tried applying Kramer's rule to interpolate the test points along the parametric representation but the determinant of the 9x9 matrix = 0 and I get a divide by 0 error.

Link to comment
Share on other sites

56 minutes ago, Richard Baker said:

For simplicity, I am only using second order NURBS. I have a NURBS surface which essentially takes the form of x(u,v) and y(u,v) and z(u,v) are all quadratic functions of u and v.  Would I be correct to say that there exists a quadric of the form 0=ax+ by+ cz+ dxy + eyz + fzx + gx + hy + iz + j which is equivalent to the parametric representation?  I tried applying Kramer's rule to interpolate the test points along the parametric representation but the determinant of the 9x9 matrix = 0 and I get a divide by 0 error.

Show source code...

Whenever a programmer uses a division operator with a non-static denominator he/she must catch a divide by zero in advance or exception. *)

 

The code in C/C++ e.g.

	double a, b, c, d; // initialized
	double e = a * b / ( c * d );

is incorrect/wrong since the beginning.

It should be:

	double a, b, c, d; // initialized
	double x = c * d; // temporary variable
	double e = ( x != 0 ) ? a * b / x : DBL_MAX;

(alternative to DBL_MAX are https://stackoverflow.com/questions/5834635/how-do-i-get-double-max

or https://stackoverflow.com/questions/8690567/setting-an-int-to-infinity-in-c

or https://en.cppreference.com/w/c/numeric/math/INFINITY )

Whether dividing by zero is treated as dividing by a very small value (leading to the result of infinity) depends on the context...

 

*) not obeying this rule will lead to random application crashes..

 

Edited by Sensei
Link to comment
Share on other sites

Perhaps I ill-phrased my question. The problem is not the divide by zero error, it is a fact that when I apply Kramer's rule the determinant of the denominator matrix is zero.  From my understanding this means the system of the equations is not defined.  My question is why is it not defined and how do I make it defined?  

To summarize, I have nine points that I want to interpolate using an implicit quadric surface which may be a sphere, parabolic, hyperboloid, or cylinder etc.  This quadric surface has nine unknowns, the coefficients a - i assuming j equals one.  So why is the surface not defined?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.