Ask Your Question

Rviz: STL marker has missing or transparent faces (prevent culling)

asked 2020-08-03 11:44:23 -0500

h3ct0r gravatar image

updated 2020-08-03 16:24:26 -0500


I'm publishing an STL file using a Marker message, and while Rviz can load the mesh file correctly, some faces of the mesh are missing. It seems that the faces that as a negative normal are not displayed. In the following images, the mesh correctly visualized on MeshLab (gray) and in Rviz (green).

Is there a config or plugin that can be used to visualize all faces correctly in Rviz?

Update: it seems that this visualization method is called "culling", maybe there is a way to disable it? A temporary solution I came up was publishing two STL files with the normal's flipped to visualize the two sides of the mesh!

The STL file can be downloaded from:

Bottom visualization: The mesh seems fine. Bottom visualization

Side visualization: some of the faces are not rendered. Side visualization

Top visualization: most faces are not rendered. Top visualization

This is the code I'm using to create the STL marker, nothing out of the ordinary:

visualization_msgs::Marker marker;
marker.header.frame_id = frame_id;
marker.header.stamp = ros::Time::now();

marker.ns = "basic_shapes"; = 0;

marker.type = visualization_msgs::Marker::MESH_RESOURCE;
marker.mesh_resource = "file:// " + stl_filepath;

marker.action = visualization_msgs::Marker::ADD;
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-03-25 17:56:59 -0500

h3ct0r gravatar image

Ended up publishing 2 meshes: one with the normals flipped and other without the normals flipped. This way the mesh can be seen from any angle.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-08-03 11:44:23 -0500

Seen: 133 times

Last updated: Mar 25