×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NX Journal - Test for B-spline surface Closed or Not?

NX Journal - Test for B-spline surface Closed or Not?

NX Journal - Test for B-spline surface Closed or Not?

(OP)
How do I determine from the askbsurf (or other information) if a B-surface/parametric surface is closed  (ie. like a tube)?

Thanks,
Jeff

RE: NX Journal - Test for B-spline surface Closed or Not?

One simplistic method would be to count the number of edges. If there are only 2 edges, you have a tube-like surface.

CODE

Option Strict Off  
Imports System  
Imports NXOpen  
Imports NXOpen.UI  
Imports NXOpen.UF  

Module Module1  

    Sub Main()  

        Dim theSession As Session = Session.GetSession()  

        Dim lw As ListingWindow = theSession.ListingWindow  
        Dim body As Body = Nothing  

        lw.Open()  

        While select_a_sheet_body(body) = Selection.Response.Ok  
            lw.WriteLine("Number of edges: " & body.GetEdges.Length)  
        End While  

    End Sub  

    Function select_a_sheet_body(ByRef obj As Body)  
        Dim ui As UI = GetUI()  
        Dim mask(0) As Selection.MaskTriple  
        With mask(0)  
            .Type = UFConstants.UF_solid_type  
            .Subtype = UFConstants.UF_solid_body_subtype  
            .SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_SHEET_BODY  
        End With  
        Dim cursor As Point3d = Nothing  

        Dim resp As Selection.Response = _  
        ui.SelectionManager.SelectObject("Select a sheet body", "Select a sheet body", _  
            Selection.SelectionScope.AnyInAssembly, _  
            Selection.SelectionAction.ClearAndEnableSpecific, _  
            False, False, mask, obj, cursor)  

        If resp = Selection.Response.ObjectSelected Or _  
           resp = Selection.Response.ObjectSelectedByName Then  
            Return Selection.Response.Ok  
        Else  
            Return Selection.Response.Cancel  
        End If  
    End Function  

    Public Function GetUnloadOption(ByVal dummy As String) As Integer  

 'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination  

    End Function  

End Module  
 

www.nxjournaling.com

RE: NX Journal - Test for B-spline surface Closed or Not?

(OP)
Interesting solution.  Unfortunately, if the "ends" of the tube consist of multiple edges (eg. a locating notch in the tube) then it will report more than 2 edges, yet it is still a closed surface.

I'm thinking more in terms of the poles & knots of a b-surface, but I can't remember how to use that to define if it is closed or not.

Jeff

RE: NX Journal - Test for B-spline surface Closed or Not?

I ran across this function today:
NXOpen.UF -> UFModl -> AskFaceTopology Method

I have not tried it out, but it looks like it may help get the info you are looking for. Not the total solution, but maybe a piece of the puzzle.

www.nxjournaling.com

RE: NX Journal - Test for B-spline surface Closed or Not?

Being that I don't write NX Open programs I'm not familiar with what the function you mentioned does but if it does provide useful information one key word you might look for is the term 'periodic'.  A surface, such as a cylinder, which 'wraps' around and meets itself without a seam or edge, like a piece of 'seamless tubing', is said to be 'periodic'.  Generally speaking, NX creates ALL cylindrical faces as periodic faces, something that is not done in many other systems, including Catia, and at one time, Pro-E (this may still be true just that I haven't seen any new Pro-E parts recently).

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

To an Engineer, the glass is twice as big as it needs to be.
 

RE: NX Journal - Test for B-spline surface Closed or Not?

(OP)
I used AskFaceTopology and that seems to work well.

Thanks,
Jeff

RE: NX Journal - Test for B-spline surface Closed or Not?

A open surface has end knots at 0 and 1.  A closed surface has end knots at < 0 and > 1.  For example consider a closed surface representing a square extrusion then for the square section we would have four degree 2 segements and the knot vector would be {-0.25,0.0,0.0,0.25,0.25,0.5,0.5,0.75,0.75,1.0,1.0,1.25}.

So if you get the surface properties and determine the end knots you have another method for determining open or closed status.

Frank Swinkels

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources