maliput::utility

Function generate_obj_file

Source
pub fn generate_obj_file(
    road_network: &RoadNetwork,
    dirpath: impl AsRef<Path>,
    fileroot: impl AsRef<str>,
    obj_features: &ObjFeatures,
) -> Result<PathBuf, Box<dyn Error>>
Expand description

Generates a Wavefront and a Material file from the road_network.

§Arguments

  • road_network - The road network to generate the Wavefront file from.
  • dirpath - The directory where the files will be created.
  • fileroot - The base name of the files. This means without the extension.
  • obj_features - Customization features for the Wavefront file.

§Returns

A PathBuf object containing the path to the generated Wavefront file.

§Details

These are written under the dirpath directory as fileroot.obj and fileroot.mtl. In case dirpath doesn’t exist, or if the files can’t be created, an error is returned.