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

Some STL meshes appear black since assimp was used to load them #1451

Closed
guihomework opened this issue Nov 22, 2019 · 2 comments · Fixed by #1452
Closed

Some STL meshes appear black since assimp was used to load them #1451

guihomework opened this issue Nov 22, 2019 · 2 comments · Fixed by #1452

Comments

@guihomework
Copy link

In noetic, some STL meshes appear black when others look fine. (so it is NOT the decimal point issue #1298 with colors being all black )

rviz_bug_stl_normals

The behavior is not existing in melodic.

The reason was tracked down to be zero normals in the STL file as shown in this hexdiff

NormalsZeroComment

and the culprit was blender 2.69 which had a bug (already fixed) exporting empty normals in some cases. https://developer.blender.org/T39755

however this could still be the case in other STL in the world and would appear only with the use of assimp as it does not recompute the normals if they are zero as did the original internal script of rviz
https://github.com/ros-visualization/rviz/blob/melodic-devel/src/rviz/ogre_helpers/stl_loader.cpp#L209

There are three options

  • Expect the world to find this issue and then fix their STLs , one way to do so is to re-export them using meshlab (thanks @rhaschke )
meshlabserver -i myfile.stl -o myfile.stl

this solves the display issue

rviz_fixed_stl_normals

  • Add a check of the normal, and tell the world to fix their STL normals.
  • Fix the normals if they are wrong as before.

maybe a combination of the last two options would be ideal for now.

Your environment

  • OS Version: e.g. Ubuntu 18.04
  • ROS Distro: [Melodic]
  • RViz, Qt, OGRE, OpenGl version as printed by rviz:
rviz version 1.13.5
compiled against Qt version 5.9.5
compiled against OGRE version 1.9.0 (Ghadamon)
Forcing OpenGl version 0.
Stereo is NOT SUPPORTED 
OpenGl version: 4.5 (GLSL 4.5).
  • If source build, which git commit?

04d4c5f

@rhaschke
Copy link
Contributor

The STL loading was changed in #1365 to use assimp. Thus, this issue should affect all rviz releases >= 1.13.4, i.e. including the two latest melodic releases.

@rhaschke
Copy link
Contributor

We already pass the post-processing flag aiProcess_GenNormals to the assimp importer. Looks like, assimp doesn't check for null normals.

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

Successfully merging a pull request may close this issue.

2 participants