Showing results for 
Search instead for 
Did you mean: 

Move Nodes onto Curve with Equal Spacing

Valued Contributor
Valued Contributor

Is there a way to move nodes onto a curve and space them out equally?


I am trying to attach a new section of a surface mesh to an existing one, but unfortunately, the spacing on the edge I'm mating to is not equal length (see attached screenshot). This also means that I can't simply do a concident node merge, as there will be gaps and incorrectly merged nodes. My thought is that if I can just create a simple curve along the boundary and move the nodes to the curve with equal spacing, doing a coincident merge would work.


I have already verified that the two edges have the same number of elements and nodes. Any ideas?




Re: Move Nodes onto Curve with Equal Spacing


By far the fastest/easiest way to resolve this problem is to use Rule 1 of surface-based geometry FEA:

Ensure  adjacent surfaces have congruent/coincident edges. 

In this case you have the edge of one surface being long, which is not congruent with the two edges of the smaller surfaces.


To solve, use the Meshing Toolbox -> Geometry Editing -> Curve Break.  First set the Location to Break At (press the Select Coordinates icon), and choose the point where the existing shorter edge curves meet (Use Snap To -> Smart Snap, Point or Node to get the exact location).  Once that is set use the Select (or Select Dialog) icon at the top of the Meshing Toolbox to select ONLY the one long curve.  That curve will then break at the same location as the shorter curves, meaning the big surface will now have two shorter curves defining that long edge, and they will be congruent/coincident with the two edges of the smaller surfaces.  If the mesh sizing does not match now, use the Meshing Toolbox -> Mesh Sizing to get matching mesh - you can use Size Curves-> Set To, or Match Curves or Match Nodes as you wish.  The summary point being that now your surface geometry has matching edges it is very simple to create matching mesh.


Some may suggest you delete exiting local mesh and Geometry -> Surface -> Non-Manifold Add the new geometry to the old (because this "welds" the surfaces together and makes the edges common) and re-mesh.  I use that method mostly myself, but for a quick and easy cut-and-shut or add-on new piece in a hurry, the first method above is quickest / simplest.

Re: Move Nodes onto Curve with Equal Spacing

Valued Contributor
Valued Contributor

Yes, I agree; ensuring that the adjacent surface edges are coincident would have been the best path. I should mentioned, however, that I only have geometry for one surface, and not the other. The section pictured to the left was created by an engineering subcontractor and all I have been provided is a BDF. The section pictured to the right was created by me using a surface I extracted from our geometry.


Also, for reference, the number of elements along the edge is nearly 700, which is why I am trying to find a more automated approach than manually merging nodes one by one.

Re: Move Nodes onto Curve with Equal Spacing


I don't know how it will go with 700 all in one go on a single curve (easy to break into sections anyway), but note the "Match Nodes" option in the method I suggested.  And also note the Method -> "ID Free Edge" in the standard Entity Selection dialog box for nodes, which allows you to pick all the nodes along the free edge of your existing plate mesh very easily.  You'll need to switch off the visibility of your new mesh while you select those existing free edge nodes, so you don't have confused spacing.  This will ensure your new mesh matches the non-equal spacing in the old (ie. because the sizing set on the edge curve(s) of your new surface will match the existing spacing of the old nodes).

Re: Move Nodes onto Curve with Equal Spacing

Valued Contributor
Valued Contributor

I actually discovered a way to do what I was looking for. It's clunky, but it works in my case: I deleted a single row of elements along the length of the surface, and remeshed them using the "Mesh Region" command. To do this, though, I still needed the nodes in order along the curve. Fortunately, the curve runs parallel to the x-axis, so I was able to add those nodes to the Data Table, sort by x-coordinate, copy the ID column to Excel, and then repeat for the second edge. I then copied these lists into the "Mesh Region" command, thus preserving the new selection order.


For the method you were proposing, however, would have to associate the freemeshed edge nodes I was provided with the surface edge curve prior to using the "Match Nodes" option?

Re: Move Nodes onto Curve with Equal Spacing


The "Match Nodes" option does not need the old nodes to be associated with anything.  Its purpose is to apply mesh sizing/spacing on a curve (the edge of your new surface) based on selected nodes (the old nodes = easy to select, using Method-> ID Free Edge and drag a box around them).  The spacing of the old nodes can be equal or unequal - doesn't matter. Unless there was something I misunderstood, the method I suggested was much less work than what you have described, and means that if you need to re-mesh that new surface for any reason, the new mesh will match the old node spacing.


EDIT: Sorry yes, you did say you want them all evenly spaced, not just merged with existing... so, given you had already said the qty of nodes was the same, you could have used a "just sufficiently large" merge tolerance, and then taken advantage of the "Keep ID" functionality of the node merging.  You can very easily select and renumber (Modify -> Renumber -> Node) all the nodes on your new curve eg. so they are all higher numbered nodes, and then set the Keep ID to "Higher ID" when merging.  Then all of your old nodes would move to the position of the (evenly spaced, having ignored my other advice) new nodes.  This will work perfectly for all those nodes where the old node is closer to its corresponding new node than to a "wrong" node - which was the case for at least those nodes pictured (not sure about all your others).

Re: Move Nodes onto Curve with Equal Spacing

Valued Contributor
Valued Contributor

I ended up writing a script that would do it. Maybe it could be of use to someone else.


Sub Main
    Dim App As femap.model
    Set App = feFemap()

    App.feAppMessage(FCM_COMMAND, "Ordered Copy Nodes (along Curve)")

    Dim rc As Long

    Dim crv As femap.Curve
    Set crv = App.feCurve

    Dim crvNodes As femap.Set
    Set crvNodes = App.feSet

    Dim n As femap.Node
    Set n = App.feNode

    Dim nSort As femap.SortSet
    Set nSort = App.feSort

    Dim xyz As Variant
    Dim s As Double
    Dim nList As String
    Dim i As Long

    ' pick curve
    rc = crv.SelectID("Select curve...")
    If rc = FE_CANCEL Then
        Exit Sub
    ElseIf rc = FE_NOT_EXIST Then
        App.feAppMessage(FCM_ERROR, "Selected curve does not exist.")
        Exit Sub
    End If

    ' get nodes on curve
    crv.NodesAsSet(True, True, crvNodes.ID, True)
    If crvNodes.Count() < 2 Then
        App.feAppMessage(FCM_ERROR, "Curve must have 2 or more nodes associated with it.")
        Exit Sub
    End If

    ' get xyz-coords from nodes
    Do While n.NextInSet(crvNodes.ID)
        crv.XYZToParam(, s)
        nSort.AddReal(n.ID, s, 0, 0)

    ' sort by curve coordinate

    ' add ordered nodes to string
    nList = ""
    For i = 1 To nSort.Count()
        nList = nList & CStr(nSort.ID) & vbCrLf
    Next i

    ' copy to clipboard

End Sub