3D normal and curvature calculations

Hi friends,
I need to calculate the normal vector which requires calculating first and second order partial derivatives at a point on a 3D body

I had calculated the derivatives of a point on a Bezier patch(analytically)(Ref: Gerald Farin - Curves and Surfaces for CAGD_ A Practical Guide, Fifth Edition (2001)).

To verify my result I created a cylindrical patch in rhino and I took the parametric details such as u and v and I calculated the required partial derivatives. But answers are not matching for 3D normal vector and also for the principal curvature. you can find details in attached pdf. I would be very thankful if some one can point the mistake.
pic.pdf (603.4 KB)

If you created the cylindrical surface using an arc or a cylinder then the surface is rational with weights other than 1.0. If the surface is rational did you account for the different weights in your calculations?

Dear David , thanks for your reply. I created the cylinder from solid creation>explode all>>to NURBS>>Bezier patches.
I took the CV that are marked in below attachment

The surface is rational. Note that the listing says “Control Points 6 rational points”.
The weights for CV[1][0] and CV[1][1] are 0.70710678118654757 (sqrt(2)/2)
You need to use the weights when calculating the derivatives. See section 13.3 of Gerald Farin - Curves and Surfaces for CAGD_ A Practical Guide, Fifth Edition (2001)

Thanks, David, for your valuable suggestions!

I couldn’t find the derivative of the rational Bezier surface in the textbook we are referring to. Please let me know if you have any references that gives a mathematical expression of the derivative of rational bezier surface.

A Bezier surface is a single span NURBS surface.
The NURBS Book 2nd Edition, Piegl and Tiller, 1995 and 1997, Chapter Four Rational B-Spline Curves and Surfaces

Hi, David, I am really thankful for your suggestions. I calculated the coordinates, and normal vectors by including the weights in my previous mathematical expressions. This is the reference where I found the single and double derivatives of rational Bezier surfaces. (T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes-15.9.1).

But I am facing some issues with validation. I am getting correct values at all points except at some points.

I attached the pdf, please go through it so that you can understand where I am not getting correct values along with the rhino. Please let me know if there are any modifications needed because I am getting the wrong values at (say) nearer to the poles of the body.

ellipsoid_rhino_2_cases.pdf (237 KB)

Hi david,
Thanks for your suggestions for my previous posts.

I have a query regarding the union of two bezier surfaces. Whenever I tried to union to bezier surfaces, rhino converts them to polysurfaces where I cannot get the information of control points.

Is there any way to join to bezier patches so that the resultant surface still be bezier in nature?

Thanks and regards
Sai Charannath Dubba