Removing inner Faces of a Mesh

Hi,

take a look at these to Meshes in rendered Mode (with snow - since Christmas is coming up).

This is one Mesh and I would like to cull the inner "ribs" and only keep the outer faces.

So I was wondering, how to do that. Is there a standart Algorithm, I could apply to this kind of mesh. The Faces in this case consist of Quads - but I would like to also find a solution, that potentially also works for szenario in which the Quads are triangulated.

Thanks

- Karl

  • up

    Nate Holland

    I had a similar situation where I wanted to remove the inner faces of stacked blocks. If you know or can identify the plane that the intersection occurs on you can use that to help select and cull the mesh faces. You could also investigate their normals and try to match normal direction(and center point proximity as a double check)

    1
    • up

      David Stasiuk

      I think the method would depend on how your mesh is constructed...if your internal faces are duplicated, then you can extract the centerpoints from the mesh face polylines and test them for adjacency to one another...then identify all of the faces where the centerpoint is sitting on another face centerpoint and use the "delete faces" component.

      However, if your internal faces are not duplicated, this should do it...use a VB component, set an input to be M, and type hint to "mesh":

      Private Sub RunScript(ByVal M As Mesh, ByRef A As Object)

      Dim f_idx As New List(Of Int32)

      For i As int32 = 0 To M.Faces.Count - 1
      Dim f_c() As Int32 = M.Faces.AdjacentFaces(i)
      Dim e_c() As Int32 = M.TopologyEdges.GetEdgesForFace(i)
      If f_c.Length - 1 > e_c.Length Then
      f_idx.Add(i)
      End If
      Next

      A = f_idx

      End Sub

      Basically what it's doing is looking for any mesh face that is connected to more other faces than it has edges, and appending its index to a list that it outputs.  Feed your mesh and this index into a "delete faces" component and it'll pull them out.

      8