Skip to content

Commit

Permalink
moved back from Chiron
Browse files Browse the repository at this point in the history
  • Loading branch information
cvhammond committed Nov 29, 2023
1 parent 628e427 commit e2155b1
Show file tree
Hide file tree
Showing 228 changed files with 5,434 additions and 1,936 deletions.
20 changes: 15 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "c3dio"
version = "0.3.0"
authors = ["Claire V. Hammond <claire@biomech.dev>"]
version = "0.6.0"
authors = ["Claire V. Hammond <me@cvhammond.com>"]
edition = "2021"
categories = ["science", "simulation", "parser-implementations", "game-development", "science::robotics"]
description = "A library for reading and writing C3D files."
description = "A library for reading and writing C3D motion capture files."
license = "MIT OR Apache-2.0"
homepage = "https://biomech.dev/c3dio"
homepage = "https://chiron.rs/c3dio"
repository = "https://github.com/cvhammond/c3dio"
readme = "README.md"
keywords = ["c3d", "parser", "motion-capture", "mocap", "biomechanics"]
Expand All @@ -15,5 +15,15 @@ exclude = ["tests", "tests/*", "examples", "examples/*"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
nalgebra = "0.32"
grid = "0.10"

[dev-dependencies]
test-files = "0.1.2"

[[example]]
name = "write-simple"
path = "examples/write-simple.rs"

[[example]]
name = "read-write"
path = "examples/read-write.rs"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Crates.io](https://img.shields.io/crates/v/c3dio.svg)

A c3d parser and eventually also a writer and editor written in Rust. It can be compiled to WebAssembly and, as a result, is **available in 20+ languages**.
A c3d parser, writer and editor written in Rust.

## Usage

Expand All @@ -26,4 +26,6 @@ PRs, feature requests, and issues are welcome!

## Support

c3dio is part of the [biomech.dev](https://biomech.dev) family of open-source libraries. Consider supporting our work to help us contribute more to the body of biomechanics software.
`c3dio` is a stand-alone crate used in [Chiron](https://chiron.rs), an open-source biomechanics simulation and modeling package supported by the Biomechanics Foundation.

Consider supporting our work to help us contribute more to the body of biomechanics software.
28 changes: 28 additions & 0 deletions examples/read-write.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use std::assert_eq;

use c3dio::file_formats::Sto;
use c3dio::file_formats::Trc;
use c3dio::prelude::*;

fn main() {
let c3d = C3d::load("tests/c3d_org_samples/sample_30/admarche2.c3d").unwrap();

// Sto::from_c3d(&c3d).write("examples/short-copy2.sto").unwrap();
let c3d = c3d.write("examples/short-copy.c3d").unwrap();
let c3d2 = C3d::load("examples/short-copy.c3d").unwrap();
// let c3d2 = C3d::load("tests/c3d_org_samples/sample_01/Eb015pr.c3d").unwrap();
assert_eq!(c3d, c3d2);
dbg!(c3d.points.descriptions);
dbg!(c3d2.points.descriptions);
// assert_eq!(c3d.points.size(), c3d2.points.size());
// for i in 0..c3d.points.size().0 {
// for j in 0..c3d.points.size().1 {
// if c3d.points[i][j] != c3d2.points[i][j] {
// dbg!(i, j);
// dbg!(c3d.points[i][j]);
// dbg!(c3d2.points[i][j]);
// dbg!(c3d2.points.scale_factor);
// }
// }
// }
}
Binary file added examples/short-copy.c3d
Binary file not shown.
File renamed without changes.
Binary file added examples/simple.c3d
Binary file not shown.
6 changes: 6 additions & 0 deletions examples/write-simple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use c3dio::prelude::*;

fn main() {
let c3d = C3d::new();
c3d.write("examples/simple.c3d").unwrap();
}
Loading

0 comments on commit e2155b1

Please sign in to comment.