Crates.io | c3d-rs |
lib.rs | c3d-rs |
version | 0.1.7 |
source | src |
created_at | 2020-05-29 07:17:18.022709 |
updated_at | 2020-06-10 02:00:01.888957 |
description | A c3d(biomechanics data format) parser written in rust. |
homepage | https://github.com/extraymond/c3d-rs |
repository | https://github.com/extraymond/c3d-rs |
max_upload_size | |
id | 247270 |
size | 26,151 |
This is a c3d file format parser/reader written in rust. C3d is a biomechanics data format wildly used in the field of motion cpature.
The parser is written with the guidance of the c3d.org specification and the python parser from py-c3d.
features
usage
use c3d_rs::C3dAdapter;
let mut file = File::open("somefile")?;
let mut buf: Vec<u8> = vec![];
file.read_to_end(&mut buf)?;
let mut cursor = Cursor::new(buf)
/// adapter accepts impl Read + Seek.
let adapter = C3dAdapter::new(&mut file)?.construct()?;
let adapter = C3dAdapter::new(&mut buf[..])?.construct()?;
/// read labels into Vec<String> with whitespace stripped.
let point_labels: Vec<String> = adapter.get_points_labels().unwrap();
let adapter_labels: Vec<String> = adapter.get_adapter_labels().unwrap();
/// reading (frame, ponts, analog) from iterator
for (frame_idx, points_data, optional_analog_data) in adapter.reader()?.into_iter() {
}
/// working with vendor specific parameter.
let param = adapter.parameter.unwrap().get("GROUP:PARAMETER").unwrap();