diff --git a/src/bin/flat/main.rs b/src/bin/flat/main.rs index 9705173..7981c61 100644 --- a/src/bin/flat/main.rs +++ b/src/bin/flat/main.rs @@ -4,20 +4,13 @@ use flo_canvas::*; use flo_draw::*; use glam::*; -use crate::ifaces::{DebugTraceable, Traceable}; +use refraction::ifaces::{DebugTraceable, Traceable}; use refraction::mathx::MatExt; -use riemann::{trace_iter, Metric}; -use tube::metric::Tube; -use tube::Space; -use types::{Location, Object, Ray}; - -mod fns; -mod ifaces; -mod riemann; -mod tube; -mod types; - -const DT: f32 = 0.1; +use refraction::riemann::{trace_iter, Metric}; +use refraction::tube::metric::Tube; +use refraction::tube::Space; +use refraction::types::{Location, Object, Ray}; +use refraction::DT; fn draw_loop(gc: &mut Vec, mut pts: impl Iterator) { gc.new_path(); @@ -163,7 +156,7 @@ fn test_put_object() { use approx::assert_abs_diff_eq; let ε = 1e-5; - let m = riemann::samples::ScaledMetric { + let m = refraction::riemann::samples::ScaledMetric { scale: vec2(3., 4.), }; diff --git a/src/bin/flat/fns.rs b/src/fns.rs similarity index 99% rename from src/bin/flat/fns.rs rename to src/fns.rs index 491df0d..347e24f 100644 --- a/src/bin/flat/fns.rs +++ b/src/fns.rs @@ -1,4 +1,4 @@ -use refraction::mathx::FloatExt2; +use crate::mathx::FloatExt2; pub trait Limiter { fn value(&self, x: f32) -> f32; diff --git a/src/bin/flat/ifaces.rs b/src/ifaces.rs similarity index 100% rename from src/bin/flat/ifaces.rs rename to src/ifaces.rs diff --git a/src/lib.rs b/src/lib.rs index f69adc8..af61334 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,10 @@ +mod fns; +pub mod ifaces; pub mod mathx; pub mod mesh_loader; pub mod mesh_tracer; +pub mod riemann; +pub mod tube; +pub mod types; + +pub const DT: f32 = 0.1; diff --git a/src/bin/flat/riemann.rs b/src/riemann.rs similarity index 99% rename from src/bin/flat/riemann.rs rename to src/riemann.rs index a6e3d39..961bfa4 100644 --- a/src/bin/flat/riemann.rs +++ b/src/riemann.rs @@ -1,5 +1,5 @@ +use crate::mathx::Decomp2; use glam::*; -use refraction::mathx::Decomp2; pub type Tens2 = [Mat2; 2]; diff --git a/src/bin/flat/tube/coords.rs b/src/tube/coords.rs similarity index 100% rename from src/bin/flat/tube/coords.rs rename to src/tube/coords.rs diff --git a/src/bin/flat/tube/metric.rs b/src/tube/metric.rs similarity index 99% rename from src/bin/flat/tube/metric.rs rename to src/tube/metric.rs index b4d4c60..7f923ab 100644 --- a/src/bin/flat/tube/metric.rs +++ b/src/tube/metric.rs @@ -1,7 +1,7 @@ use glam::{f32, vec2, Mat2, Vec2}; -use refraction::mathx::Decomp2; use crate::fns::{self, Limiter}; +use crate::mathx::Decomp2; use crate::riemann::{Metric, Tens2}; #[derive(Copy, Clone, Debug)] @@ -75,10 +75,10 @@ mod test { use glam::{vec2, Vec2}; use itertools_num::linspace; + use crate::mathx::Decomp2; use crate::riemann::Metric; use crate::tube::Space; use crate::types::Ray; - use refraction::mathx::Decomp2; use super::Tube; diff --git a/src/bin/flat/tube/mod.rs b/src/tube/mod.rs similarity index 100% rename from src/bin/flat/tube/mod.rs rename to src/tube/mod.rs diff --git a/src/bin/flat/types.rs b/src/types.rs similarity index 100% rename from src/bin/flat/types.rs rename to src/types.rs