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

Function read_particle_positions

splashsurf/src/io.rs:44–65  ·  view source on GitHub ↗

Loads particles positions from the given file path, automatically detects the file format

(
    input_file: P,
    _format_params: &InputFormatParameters,
)

Source from the content-addressed store, hash-verified

42
43/// Loads particles positions from the given file path, automatically detects the file format
44pub fn read_particle_positions<R: Real, P: AsRef<Path>>(
45 input_file: P,
46 _format_params: &InputFormatParameters,
47) -> Result<Vec<Vector3<R>>, anyhow::Error> {
48 let input_file = input_file.as_ref();
49 info!(
50 "Reading particle dataset from \"{}\"...",
51 input_file.display()
52 );
53
54 let particle_positions = {
55 profile!("loading particle positions");
56 io::particles_from_file(input_file)?
57 };
58
59 info!(
60 "Successfully read dataset with {} particle positions.",
61 particle_positions.len()
62 );
63
64 Ok(particle_positions)
65}
66
67/// Tries to read particle positions as well as attributes with the given names from the specified file
68pub fn read_particle_positions_with_attributes<R: Real, P: AsRef<Path>>(

Callers 2

convert_particlesFunction · 0.85

Calls 1

particles_from_fileFunction · 0.85

Tested by

no test coverage detected