Showing results for 
Search instead for 
Do you mean 
Reply

Revolved spline says its surface type is a torus

See attached file.  The two planar faces work fine.  But UF_MODL_ask_face_type (same with UF_MODL_ask_face_data) returns "toroidal" for the type of the revolved spline face.  Is this expected behavior?

 

For what it's worth, it appears that coercing the toroidal face to a spline using UF_MODL_extract_face seems to give a correct B-surface.  This is expensive, so I do not want to do it for all surfaces that claim to be toroidal.  How do I know which cases are the bad ones?

5 REPLIES

Re: Revolved spline says its surface type is a torus

In this case, NX did not make the surface toroidal (though it will, if it can).

 

The interactive Info-->Object function correctly identifies the surface type as "Revolved".

 

I think there's something wrong with the UF_MODL_Ask_Face functions, or the set of constants used as type codes. I don't know exactly what the problem is, but I found some old code of mine that contained a bizarre workaround. In that code, when I encounter a surface that is claimed to be toroidal, I read the minor radius. If that minor radius is zero, then I conclude that the "toroidal" claim is a lie, and the surface is actually of type "Revolved".

 

I realize that this is a pretty vague answer, but maybe it points you in the right direction.

 

If you can isolate the problem, please send in a PR.

 

 

山田
yamada

Re: Revolved spline says its surface type is a torus

[ Edited ]

SNAP gets the right answers, and SNAP is just calling NX/Open functions, so there must be a way. Using this code:

public class NXJournal
{
   public static void Main()
   {
      foreach(var body in Snap.Globals.WorkPart.Bodies)
      {
         foreach(var face in body.Faces) 
            Snap.InfoWindow.WriteLine(face.ObjectSubType.ToString());
      }
   }
}

I got the following results for your model: 

FacePlane
FaceRevolved
FacePlane

 Here is what I did in some old code:

myType = myFace.SolidFaceType;

if (myType == NXOpen.Face.FaceType.SurfaceOfRevolution)
{
   double minorRadius = GetSurfaceRadii(myFace)[1];
   if (minorRadius != 0)  myType = NX.ObjectTypes.SubType.FaceTorus;
   else myType = NX.ObjectTypes.SubType.FaceRevolved;
}

 

山田
yamada

Re: Revolved spline says its surface type is a torus

It may be off interest why NX still call the face toriodal.  The image below shows the poles for the revolved face.  Note that it is treating as having a major radius and two minor radii instead of the traditional major and single minor radius.

 

Image1.jpg

 

 

 

 

 

 

 

 

 

 

Frank Swinkels

Re: Revolved spline says its surface type is a torus

I should mention that Nx can treat this like a toriod only because the spline has the correct number of poles (4 poles which is what is used for a standard torus.  I am not saying that we have two radii.

 

Frank Swinkels

Re: Revolved spline says its surface type is a torus

This seems to work:

public class NXJournal
{
   public static void Main()
   {
      var workPart = NXOpen.Session.GetSession().Parts.Work;

      foreach(NXOpen.Body body in workPart.Bodies)
      {
         foreach(NXOpen.Face face in body.GetFaces()) 
            Snap.InfoWindow.WriteLine(face.SolidFaceType.ToString());
      }
   }
}
山田
yamada