maliput_viz
maliput::viz::mesh Namespace Reference

Functions

std::unique_ptr< ignition::common::Mesh > Convert (const std::string &name, const GeoMesh &geo_mesh)
 
std::unique_ptr< ignition::common::Mesh > Convert (const std::string &name, const maliput::utility::mesh::GeoMesh &geo_mesh)
 Converts a GeoMesh into an ignition::common::Mesh. More...
 

Function Documentation

◆ Convert() [1/2]

std::unique_ptr<ignition::common::Mesh> maliput::viz::mesh::Convert ( const std::string &  name,
const GeoMesh &  geo_mesh 
)

◆ Convert() [2/2]

std::unique_ptr<ignition::common::Mesh> maliput::viz::mesh::Convert ( const std::string &  name,
const maliput::utility::mesh::GeoMesh &  geo_mesh 
)

Converts a GeoMesh into an ignition::common::Mesh.

The ignition::common::Mesh will contain only one ignition::common::SubMesh, and current implementation only supports up to four vertices per GeoFace. Note that generated meshes will point to both sides, consequently for each group of three vertices that represent a triangle in the mesh, there are six indices entries.

Parameters
nameThe name of the mesh.
geo_meshThe GeoMesh to convert into a ignition::common::Mesh. It must have at least once GeoFace with at least three vertices on it.
Returns
A std::unique_ptr<ignition::common::Mesh> with the equivalent mesh construction. The pointer will be nullptr when the mesh has not the correct vertices requirements.