(UDynamicMesh / Geometry Script): DynamicMesh not connecting properly

MariusPVI
Fri, 11 Apr 2025 09:07:08 +0000
C++

Hi all,

I’m currently working with several surface meshes in UE5 (via UDynamicMeshComponent) that are almost connected, and my goal is to merge them into a single watertight mesh.
I started by creating a UDynamicMeshComponent for each surface (geometry data is imported from an external source). The example I am working on looks consitst of four individual DynamicMeshComponents like this.

I then merged the 4 UDynamicMeshComponents into one Component for easier handling (also meaning there is only one DynamicMesh from now on). The imported data is strucured in a way that these surfaces do not intersect or touch as seen in the next screenshot.

I modified the boundary edges in a way that made all surfaces stick through each other, which looks like this.

Then I perfomed a bool mesh union of the mesh with itself in order to create the geometric connections of the mesh at the new intersection points. Here is a screenshot of before

and after the self-union

I am now looking for the new boundary edges of this modified mesh. However, when I try to obtain the boundary edge I get edges from the individual surfaces but never a new boundary loop for the entire geometry. When getting the number of connected components on my DynamicMeshComponent after the modifications, I also get 4, but I would expect only one connected component since I modified the mesh in the ways mentioned earlier. It also “looks” connected but I am at my wits end. Here is a final screenshot of the modified mesh where I looked up all edge IDs where “IsBoundaryEdge(EdgeID) == true” and drew a debug line between the vertices of each edge.

I also tried finding a shortest vertex path from the first vertex in one loop to the first vertex in another loop and this also fails, further indicating that I have not connected my individual mesh parts properly.

Sorry for the long post but it seems like I am missing something. How can I obtain the connectivity in my mesh that I need? Any help is appreciated!

1 post - 1 participant