u- and v-Radius of a Face

Hello,

i'm searching for a function to get the Radius of a face in U-Direction and in V-Direction at a given point.
I tried the function "Askfaceprops" but it gives me just the principal radii. These radii are not die radii in u and v-direction.
Is it possible to get these radii?
In Siemens NX (Menu --> Analysis --> Local Radius) you can see the right radii them but i need them as values in my VB-Code.
I also looked it up in the snap library, but i could not find something.

Thanks for your help!
Jo

I took a quick look through the docs and couldn't find anything that looked useful. But, I have an idea for a workaround. You could extract the U and V isoparametric curves at the desired point, then use AskCurveProps to find the radius of curvature of each of the curves.

Thank you! That sounds good.
To get the isoparametric curves i would set one parameter (for example u) constant an get points for different v on the face.
Then create a spline through all these points.
Or is there an easier way to ge the isoparametric curves?

More recent versions of NX have a command that will extract UV curves from surfaces (isoparametric curve). I'm fairly sure it is in NX 8.5, but may have shown up earlier. The command has various ways to specify what curves to extract, one of which is through a specific point. I'd suggest recording a journal while using this command to see what code is output (if any).

I'm using NX9 so this function should be available.
I can't use NX right now but i will try it on Monday.
Thank you for the help!

Since you seem to have access to the SNAP library, getting isoparametric curves is easy. There are functions face.IsoCurveU and face.IsoCurveV that return the curves. Then you can get the curvature of these curves using curve.Curvature.

I don't know exactly what you're doing, but these curvatures are probably not what you want. Take a sphere, for example. The iso-curves in one direction will be circles of varying radii; these radii will be very small at points near the north or south pole of the sphere. The radius values tell you (almost) nothing about the shape of the sphere. In most circumstances, the principal radii are much more meaningful.

I want to calculate the value of the Gaussian curvature for a specific point on my surface.
I use the formula K=(1/r1)*(1/r2).
The problem is, that the function "askfaceprops" returns two values the principal radii for example (r1=-200;r2=1000).
But if i take this point with the function "Local Radius" in NX there are 4 values.
1. Max. radius
2. Min radius
3. radius in u
4. radius in v
I think that max and min radius are the same radii which i get from the "askfaceprops".
But for some points the value for "max radius" is something like "1000" and the value "radius in v" is "infinity".
So there is no sense that there is a radius which is higher than the "max radius".
At the moment i'm not sure which values i have to take for the Gaussian curvature and thats why i wanted to get access to the radii in u and v direction to test it.
But maybe someone knows which values i have to take for this?

If I were in your position, I'd calculate Gaussian curvature from first principles. It's not very hard once you have first and second partial derivatives of the surface. That way, you're absolutely sure of what you're getting.

You can get the partial derivatives you need by calling NXOpen.UF.UFEvalsf.Evaluate.

Here is a C# function that calculates Gaussian curvature at a (u,v) location on a face. It uses the Snap.Vector class, for convenience.


public static double GaussianCurvature(Snap.NX.Face face, params double[] uv)
{
NXOpen.UF.UFSession ufs = NXOpen.UF.UFSession.GetUFSession();
NXOpen.UF.ModlSrfValue surfaceValues = new NXOpen.UF.ModlSrfValue();
int mode = NXOpen.UF.UFConstants.UF_MODL_EVAL_DERIV2;
ufs.Modl.EvaluateFace(face.NXOpenTag, mode, uv, out surfaceValues);

Vector Su = surfaceValues.srf_du;
Vector Sv = surfaceValues.srf_dv;
Vector Suu = surfaceValues.srf_d2u;
Vector Suv = surfaceValues.srf_dudv;
Vector Svv = surfaceValues.srf_d2v;

Vector C = Vector.Cross(Su, Sv);

double numer = (C*Suu)*(C*Svv) - (C*Suv)*(C*Suv);
double denom = (C*C)*(C*C);

return numer/denom;
}

Thank you for your help.
The code for the Gaussian curvature works. ;)
But i don't understand the calculation of the two doubles numer and denom.
Can you explain this part for me?
Thank you!

It's standard differential geometry. You can find similar formulas in many textbooks. I developed this particular formula myself, but it's very similar to one given in "Modern Differential Geometry of Curves and Surfaces" by Alfred Gray. I'm glad it worked.

I used another formula so i was confused. But now i found the formula that you use in the code.
Perfect help. The code works as it should now. Thank you very much!