NVIDIAGameWorks / FleX

Other
664 stars 100 forks source link

Unable to properly load .obj files in FleX #28

Closed Amir-Arsalan closed 6 years ago

Amir-Arsalan commented 6 years ago

I apply some mesh simplification operations on a mesh in Blender and then use the export function in Blender to save the mesh in an obj file. I then load the modified mesh in FleX to run some simulations. However, FleX gives me the following warning/error: Face with more than 4 vertices are not supported Here is the mesh I load in FleX after I applying the operations: bus-modified.zip And here's the mesh before applying the operations: bus.zip

I am doing the simulation in the background but I noticed that the simulation is not being done properly (materials go through the shape). So I exported the mesh through FleX and loaded it in Blender to see if the shape is consistent. However, the mesh seems to have lost a lot of vertices and is very inconsistent. Here is what FleX exports: bus-flex.zip

This also happens if I just load the mesh in Blender and export it (without applying any operations). So my guess is that FleX cannot handle slightly different obj file formats and that's why this happens. In contrast, the simulation will be fine if I directly load the mesh in FleX. But I need to apply those mesh simplification operations to and fix the incorrect Normals before running the simulation. I wonder, am I doing something wrong when loading the obj files in FleX? Any help would be highly appreciated.

Amir-Arsalan commented 6 years ago

Here's a screen shot after applying the operations: 1

And after exporting the object from FleX:

2

ghost commented 6 years ago

When you export an .OBJ file from Blender for use in an application which processes triangles/quads and gives a warning "Face with more than 4 vertices are not supported" you should ensure to triangulate your mesh on exporting. If you don't follow a qual topolgy in your mesh, Blender oftten uses polygons which can have much more than 4 vertices. triangulate

Amir-Arsalan commented 6 years ago

@3DdeepAI Thank you. That works