Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting OBJ generates duplicated faces for triangulated quads #134

Open
alsomar opened this issue Jun 22, 2024 · 0 comments
Open

Exporting OBJ generates duplicated faces for triangulated quads #134

alsomar opened this issue Jun 22, 2024 · 0 comments

Comments

@alsomar
Copy link

alsomar commented Jun 22, 2024

I've been struggling with this issue for quite some time, but since I didn't fully understand what was happening, I couldn't provide useful feedback. Recently, however, I've been able to clearly identify the problem and even managed to resolve it using Meshlab, a free software to clean and improve 3D models.

The Issue

The OBJ files generated with the OBJ exporter from QuadFaceTools have duplicated faces in those quads that have been triangulated in SketchUp.

When you open an OBJ file created with this exporter, software like Blender automatically resolves this issue. However, other software such as Substance Painter or RizomUV may struggle to handle these duplicates correctly.

I believe this issue is the root cause of these issues:

Reproducing the Issue

I created a simple SketchUp model with just two cubes:

240622_skp_cubes

Each cube have 24 quads. The triangulated one (on the left) is a component called 'cube_t', and the other one (on the right) is also a component called 'cube_q'. I exported them separately using the OBJ exporter from QFT to identify the problem, using the following settings:

240622_skp_qft_exporter

After exporting, I obtained these two files: cube_q.obj and cube_t.obj.

Next, I used the free open-source software Meshlab to check the number of faces in each OBJ file. After opening Meshlab, navigate to File > Import Mesh and select cube_q.obj.

240622_skp_meshlab_1B

For the first mesh ('0'), you can see there are 48 faces (24 front + 24 back), as expected. However, when I added cube_t.obj using File > Import Mesh, for the second mesh ('1'), there were 96 faces, TWICE (!) the expected number for the same number of quads.

240622_skp_meshlab_1C

This issue causes Substance Painter to struggle with generating proper automated UVs, while RizomUV fails to correctly utilize OBJ files exported from QFT's OBJ exporter.

Fixing these OBJ Files using Meshlab

Until a potential solution is considered within QFT's OBJ exporter itself, here's a simple and practical solution using MeshLab:

  1. Select the problematic mesh from the Layer Dialog.

  2. Go to Filters > Cleaning and Repairing > Remove Duplicated Faces.
    Step 2 Screenshot

  3. After completing the previous step, verify that the number of faces in cube_t.obj is 48. If correct, proceed to File > Export Mesh and save the corrected file as new_cube_t.obj (or a similar name).

If you try to open this corrected file in RizomUV or Substance Painter (using the auto-UV features), it should work smoothly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant