Reorganize the shared example code
All checks were successful
/ test (pull_request) Successful in 3m36s

The new layout deviates from what the Rust book suggests

  https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests

and uses the frowned-upon `#[path]` attribute,

  https://doc.rust-lang.org/style-guide/advice.html#modules

but we've decided that having a descriptive module filename instead of
`mod.rs` is worth the cost.
This commit is contained in:
Aaron Fenyes 2025-07-18 10:59:41 -07:00
parent 2137284358
commit 477d6a5064
5 changed files with 30 additions and 51 deletions

View file

@ -1,24 +1,19 @@
mod common;
#[path = "common/print.rs"]
mod print;
use nalgebra::{DMatrix, DVector};
use common::{
print_config,
print_gram_matrix,
print_realization_diagnostics,
print_title
};
use dyna3::engine::{Realization, examples::realize_kaleidocycle};
fn main() {
const SCALED_TOL: f64 = 1.0e-12;
let realization_result = realize_kaleidocycle(SCALED_TOL);
print_title("Kaleidocycle");
print_realization_diagnostics(&realization_result);
print::title("Kaleidocycle");
print::realization_diagnostics(&realization_result);
if let Ok(Realization { config, tangent }) = realization_result.result {
// print the completed Gram matrix and the realized configuration
print_gram_matrix(&config);
print_config(&config);
print::gram_matrix(&config);
print::config(&config);
// find the kaleidocycle's twist motion by projecting onto the tangent
// space