MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / convert_mesh

Function convert_mesh

splashsurf/src/convert.rs:118–138  ·  view source on GitHub ↗
(cmd_args: &ConvertSubcommandArgs)

Source from the content-addressed store, hash-verified

116}
117
118fn convert_mesh(cmd_args: &ConvertSubcommandArgs) -> Result<(), anyhow::Error> {
119 profile!("mesh file conversion cli");
120
121 let io_params = io::FormatParameters::default();
122 let input_file = cmd_args.input_mesh.as_ref().unwrap();
123 let output_file = &cmd_args.output_file;
124
125 // Try to load surface mesh
126 let mesh: MeshWithData<f32, _> = io::read_surface_mesh(input_file.as_path(), &io_params.input)
127 .with_context(|| {
128 format!(
129 "Failed to load surface mesh from file \"{}\"",
130 input_file.as_path().display()
131 )
132 })?;
133
134 // Write mesh
135 io::write_mesh(&mesh, output_file.as_path(), &io_params.output)?;
136
137 Ok(())
138}
139
140/// Returns an error if the file already exists but overwrite is disabled
141fn overwrite_check(cmd_args: &ConvertSubcommandArgs) -> Result<(), anyhow::Error> {

Callers 1

convert_subcommandFunction · 0.85

Calls 3

read_surface_meshFunction · 0.85
write_meshFunction · 0.85
with_contextMethod · 0.80

Tested by

no test coverage detected