how to clean up subdivided surface?

   2874   3   1
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
dear experts, please refer to the attached bgeo files:

how to clean up the subdivided surface as shown in“facade_subdivided.bgeo” and transform it to what is shown in “facade_not_subdivided.bgeo” ?

Thanks!

Attachments:
facade_not_subdivided.rar (437 bytes)
facade_subdivided.rar (23.3 KB)
01.png (18.6 KB)
00.png (8.4 KB)

User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
In this case it's not particularly easy. My first glance would say it is, but after looking at the actual geometry not so much. The geometry is a total mess of overlapping/duplicate polygons and needs to be cleaned up a lot. For example, the top face of the geometry is made up of 3 exact primitives. Attached is a file that attempts to do this.

I tried to split it into 2 parts: the top and the sides. To deal with the top surface I isolated only those primitives that were at the very top ($TY == $YMAX). I then fed the resulting 3 primitives into a custom operator I have that removes duplicate/overlapping polygons to give me just a single top face.

To deal with the sides I needed to get rid of all the horizontal faces. To do that I deleted any faces whose Y component of their normal was equal to the absolute value of 1. This gets all the faces facing up or down. I then use my custom op to remove duplicates again. Next I mapped their normals to color so I could partition based on that and get the side walls all grouped differently. I run the new groups through a ForEach to remove shared edges and just get a giant polygon for each wall. Finally the sides and top get merged back together and fused. This results in something fairly similar to the target geometry.

As I mentioned before, the problem comes with the fact that the source geometry really is a total mess. Depending on exactly what you are doing with your scene, there are better ways to have originally subdivided your geometry. Also in the file, in the network for the not subdivided geometry, I threw in a simple example that gives the same outward appearance of the subdivided geometry but without all the crazy duplicates and stuff going on inside.

Attachments:
cleanup.hip (94.2 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
dear graham, thank you so much for such detailed explanation!

will try to find out why the geometry is massed up in the first place.

Thanks!
User Avatar
Member
8556 posts
Joined: July 2007
Online
just look at the groups of source geometry, then perform cleanup only on needed ones like

courtyard_typology_walls
courtyard_typology_roof
and first prim from courtyard_typology_floors

EDIT:
problem with the messy geometry might be that if you have geometry with many groups and export it as obj, each group is exported as separate object, then if you import it back, you get only one geometry with many groups, each from one object in .obj, so you may get overlapping polygons if your groups before export had overlapping primitives
i am not sure however if you used obj export import in the process so there may be another problem
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links