From b0b77a106138d6a898191805efbb23709794d215 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Tue, 26 Mar 2024 08:51:45 -0400 Subject: [PATCH] Move types out of eval module --- CHANGELOG.md | 2 + fidget/src/core/eval/mod.rs | 10 +- fidget/src/core/eval/test/grad_slice.rs | 5 +- fidget/src/core/eval/test/interval.rs | 4 +- fidget/src/core/mod.rs | 1 + fidget/src/core/types/grad.rs | 279 +++++++++++++++++ .../core/{eval/types.rs => types/interval.rs} | 289 +----------------- fidget/src/core/types/mod.rs | 6 + fidget/src/core/vm/mod.rs | 2 +- fidget/src/jit/aarch64/grad_slice.rs | 2 +- fidget/src/jit/aarch64/interval.rs | 2 +- fidget/src/jit/grad_slice.rs | 2 +- fidget/src/jit/mod.rs | 2 +- fidget/src/jit/x86_64/grad_slice.rs | 2 +- fidget/src/jit/x86_64/interval.rs | 2 +- fidget/src/mesh/cell.rs | 2 +- fidget/src/render/render2d.rs | 3 +- fidget/src/render/render3d.rs | 3 +- 18 files changed, 312 insertions(+), 306 deletions(-) create mode 100644 fidget/src/core/types/grad.rs rename fidget/src/core/{eval/types.rs => types/interval.rs} (62%) create mode 100644 fidget/src/core/types/mod.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index be943aa5..d0b10c46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ (where you don't want to remap the underlying shape) - It's a more general solution: for example, we can use the same type to change bounds for meshing (by translating + scaling the underlying model). +- Move `Interval` and `Grad` to `fidget::types` module, instead of + `fidget::eval::types`. # 0.2.2 - Added many transcendental functions: `sin`, `cos`, `tan`, `asin`, `acos`, diff --git a/fidget/src/core/eval/mod.rs b/fidget/src/core/eval/mod.rs index c1cfbbd4..965accb9 100644 --- a/fidget/src/core/eval/mod.rs +++ b/fidget/src/core/eval/mod.rs @@ -20,7 +20,11 @@ //! assert_eq!(value, 0.25); //! # Ok::<(), fidget::Error>(()) //! ``` -use crate::{context::Node, Context, Error}; +use crate::{ + context::Node, + types::{Grad, Interval}, + Context, Error, +}; use std::collections::HashMap; #[cfg(any(test, feature = "eval-tests"))] @@ -30,8 +34,6 @@ mod bulk; mod tracing; mod transform; -pub mod types; - mod vars; // Re-export a few things @@ -40,8 +42,6 @@ pub use tracing::TracingEvaluator; pub use transform::TransformedShape; pub use vars::Vars; -use types::{Grad, Interval}; - /// A shape represents an implicit surface /// /// It is mostly agnostic to _how_ that surface is represented; we simply diff --git a/fidget/src/core/eval/test/grad_slice.rs b/fidget/src/core/eval/test/grad_slice.rs index e9e35edd..233175b4 100644 --- a/fidget/src/core/eval/test/grad_slice.rs +++ b/fidget/src/core/eval/test/grad_slice.rs @@ -5,9 +5,8 @@ use super::{build_stress_fn, test_args, CanonicalBinaryOp, CanonicalUnaryOp}; use crate::{ context::Context, - eval::{ - types::Grad, BulkEvaluator, EzShape, MathShape, Shape, ShapeVars, Vars, - }, + eval::{BulkEvaluator, EzShape, MathShape, Shape, ShapeVars, Vars}, + types::Grad, }; /// Helper struct to put constrains on our `Shape` object diff --git a/fidget/src/core/eval/test/interval.rs b/fidget/src/core/eval/test/interval.rs index 469c6541..fe0d1783 100644 --- a/fidget/src/core/eval/test/interval.rs +++ b/fidget/src/core/eval/test/interval.rs @@ -10,9 +10,9 @@ use super::{ use crate::{ context::Context, eval::{ - types::Interval, EzShape, MathShape, Shape, ShapeVars, Tape, - TracingEvaluator, Vars, + EzShape, MathShape, Shape, ShapeVars, Tape, TracingEvaluator, Vars, }, + types::Interval, vm::Choice, }; diff --git a/fidget/src/core/mod.rs b/fidget/src/core/mod.rs index 44046077..b092ab99 100644 --- a/fidget/src/core/mod.rs +++ b/fidget/src/core/mod.rs @@ -58,6 +58,7 @@ pub use context::Context; pub mod compiler; pub mod eval; +pub mod types; pub mod vm; #[cfg(test)] diff --git a/fidget/src/core/types/grad.rs b/fidget/src/core/types/grad.rs new file mode 100644 index 00000000..3f375380 --- /dev/null +++ b/fidget/src/core/types/grad.rs @@ -0,0 +1,279 @@ +/// A point in space with associated partial derivatives. +#[derive(Copy, Clone, Debug, Default, PartialEq)] +#[repr(C)] +pub struct Grad { + /// Value of the distance field at this point + pub v: f32, + /// Partial derivative with respect to `x` + pub dx: f32, + /// Partial derivative with respect to `y` + pub dy: f32, + /// Partial derivative with respect to `z` + pub dz: f32, +} + +impl std::fmt::Display for Grad { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "({}, {}, {}, {})", self.v, self.dx, self.dy, self.dz) + } +} + +impl Grad { + /// Constructs a new gradient + pub fn new(v: f32, dx: f32, dy: f32, dz: f32) -> Self { + Self { v, dx, dy, dz } + } + + /// Looks up a gradient by index (0 = x, 1 = y, 2 = z) + /// + /// # Panics + /// If the index is not in the 0-2 range + pub fn d(&self, i: usize) -> f32 { + match i { + 0 => self.dx, + 1 => self.dy, + 2 => self.dz, + _ => panic!("invalid index {i}"), + } + } + + /// Returns a normalized RGB color, or `None` if the gradient is 0 + pub fn to_rgb(&self) -> Option<[u8; 3]> { + let s = (self.dx.powi(2) + self.dy.powi(2) + self.dz.powi(2)).sqrt(); + if s != 0.0 { + let scale = u8::MAX as f32 / s; + Some([ + (self.dx.abs() * scale) as u8, + (self.dy.abs() * scale) as u8, + (self.dz.abs() * scale) as u8, + ]) + } else { + None + } + } + + /// Absolute value + pub fn abs(self) -> Self { + if self.v < 0.0 { + Grad { + v: -self.v, + dx: -self.dx, + dy: -self.dy, + dz: -self.dz, + } + } else { + self + } + } + + /// Square root + pub fn sqrt(self) -> Self { + let v = self.v.sqrt(); + Grad { + v, + dx: self.dx / (2.0 * v), + dy: self.dy / (2.0 * v), + dz: self.dz / (2.0 * v), + } + } + + /// Sine + pub fn sin(self) -> Self { + let c = self.v.cos(); + Grad { + v: self.v.sin(), + dx: self.dx * c, + dy: self.dy * c, + dz: self.dz * c, + } + } + /// Cosine + pub fn cos(self) -> Self { + let s = -self.v.sin(); + Grad { + v: self.v.cos(), + dx: self.dx * s, + dy: self.dy * s, + dz: self.dz * s, + } + } + /// Tangent + pub fn tan(self) -> Self { + let c = self.v.cos().powi(2); + Grad { + v: self.v.tan(), + dx: self.dx / c, + dy: self.dy / c, + dz: self.dz / c, + } + } + /// Arcsin + pub fn asin(self) -> Self { + let r = (1.0 - self.v.powi(2)).sqrt(); + Grad { + v: self.v.asin(), + dx: self.dx / r, + dy: self.dy / r, + dz: self.dz / r, + } + } + /// Arccos + pub fn acos(self) -> Self { + let r = (1.0 - self.v.powi(2)).sqrt(); + Grad { + v: self.v.acos(), + dx: -self.dx / r, + dy: -self.dy / r, + dz: -self.dz / r, + } + } + /// Arctangent + pub fn atan(self) -> Self { + let r = self.v.powi(2) + 1.0; + Grad { + v: self.v.atan(), + dx: self.dx / r, + dy: self.dy / r, + dz: self.dz / r, + } + } + /// Exponential function + pub fn exp(self) -> Self { + let v = self.v.exp(); + Grad { + v, + dx: v * self.dx, + dy: v * self.dy, + dz: v * self.dz, + } + } + /// Natural log + pub fn ln(self) -> Self { + Grad { + v: self.v.ln(), + dx: self.dx / self.v, + dy: self.dy / self.v, + dz: self.dz / self.v, + } + } + + /// Reciprocal + pub fn recip(self) -> Self { + let v2 = -self.v.powi(2); + Grad { + v: 1.0 / self.v, + dx: self.dx / v2, + dy: self.dy / v2, + dz: self.dz / v2, + } + } + + /// Minimum of two values + pub fn min(self, rhs: Self) -> Self { + if self.v < rhs.v { + self + } else { + rhs + } + } + + /// Maximum of two values + pub fn max(self, rhs: Self) -> Self { + if self.v > rhs.v { + self + } else { + rhs + } + } + + /// Checks that the two values are roughly equal, panicking otherwise + #[cfg(test)] + pub(crate) fn compare_eq(&self, other: Self) { + let d = (self.v - other.v) + .abs() + .max((self.dx - other.dx).abs()) + .max((self.dy - other.dy).abs()) + .max((self.dz - other.dz).abs()); + if d >= 1e-6 { + panic!("lhs != rhs ({self:?} != {other:?})"); + } + } +} + +impl From for Grad { + fn from(v: f32) -> Self { + Grad { + v, + dx: 0.0, + dy: 0.0, + dz: 0.0, + } + } +} + +impl From for nalgebra::Vector4 { + fn from(g: Grad) -> Self { + nalgebra::Vector4::new(g.dx, g.dy, g.dz, g.v) + } +} + +impl std::ops::Add for Grad { + type Output = Self; + fn add(self, rhs: Self) -> Self { + Grad { + v: self.v + rhs.v, + dx: self.dx + rhs.dx, + dy: self.dy + rhs.dy, + dz: self.dz + rhs.dz, + } + } +} + +impl std::ops::Mul for Grad { + type Output = Self; + fn mul(self, rhs: Self) -> Self { + Self { + v: self.v * rhs.v, + dx: self.v * rhs.dx + rhs.v * self.dx, + dy: self.v * rhs.dy + rhs.v * self.dy, + dz: self.v * rhs.dz + rhs.v * self.dz, + } + } +} + +impl std::ops::Div for Grad { + type Output = Self; + fn div(self, rhs: Self) -> Self { + let d = rhs.v.powi(2); + Self { + v: self.v / rhs.v, + dx: (rhs.v * self.dx - self.v * rhs.dx) / d, + dy: (rhs.v * self.dy - self.v * rhs.dy) / d, + dz: (rhs.v * self.dz - self.v * rhs.dz) / d, + } + } +} + +impl std::ops::Sub for Grad { + type Output = Self; + fn sub(self, rhs: Self) -> Self { + Self { + v: self.v - rhs.v, + dx: self.dx - rhs.dx, + dy: self.dy - rhs.dy, + dz: self.dz - rhs.dz, + } + } +} + +impl std::ops::Neg for Grad { + type Output = Self; + fn neg(self) -> Self { + Self { + v: -self.v, + dx: -self.dx, + dy: -self.dy, + dz: -self.dz, + } + } +} diff --git a/fidget/src/core/eval/types.rs b/fidget/src/core/types/interval.rs similarity index 62% rename from fidget/src/core/eval/types.rs rename to fidget/src/core/types/interval.rs index 2d51e0f8..6a053c70 100644 --- a/fidget/src/core/eval/types.rs +++ b/fidget/src/core/types/interval.rs @@ -1,288 +1,5 @@ -//! Custom types used during evaluation use crate::vm::Choice; -/// A point in space with associated partial derivatives. -#[derive(Copy, Clone, Debug, Default, PartialEq)] -#[repr(C)] -pub struct Grad { - /// Value of the distance field at this point - pub v: f32, - /// Partial derivative with respect to `x` - pub dx: f32, - /// Partial derivative with respect to `y` - pub dy: f32, - /// Partial derivative with respect to `z` - pub dz: f32, -} - -impl std::fmt::Display for Grad { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "({}, {}, {}, {})", self.v, self.dx, self.dy, self.dz) - } -} - -impl Grad { - /// Constructs a new gradient - pub fn new(v: f32, dx: f32, dy: f32, dz: f32) -> Self { - Self { v, dx, dy, dz } - } - - /// Looks up a gradient by index (0 = x, 1 = y, 2 = z) - /// - /// # Panics - /// If the index is not in the 0-2 range - pub fn d(&self, i: usize) -> f32 { - match i { - 0 => self.dx, - 1 => self.dy, - 2 => self.dz, - _ => panic!("invalid index {i}"), - } - } - - /// Returns a normalized RGB color, or `None` if the gradient is 0 - pub fn to_rgb(&self) -> Option<[u8; 3]> { - let s = (self.dx.powi(2) + self.dy.powi(2) + self.dz.powi(2)).sqrt(); - if s != 0.0 { - let scale = u8::MAX as f32 / s; - Some([ - (self.dx.abs() * scale) as u8, - (self.dy.abs() * scale) as u8, - (self.dz.abs() * scale) as u8, - ]) - } else { - None - } - } - - /// Absolute value - pub fn abs(self) -> Self { - if self.v < 0.0 { - Grad { - v: -self.v, - dx: -self.dx, - dy: -self.dy, - dz: -self.dz, - } - } else { - self - } - } - - /// Square root - pub fn sqrt(self) -> Self { - let v = self.v.sqrt(); - Grad { - v, - dx: self.dx / (2.0 * v), - dy: self.dy / (2.0 * v), - dz: self.dz / (2.0 * v), - } - } - - /// Sine - pub fn sin(self) -> Self { - let c = self.v.cos(); - Grad { - v: self.v.sin(), - dx: self.dx * c, - dy: self.dy * c, - dz: self.dz * c, - } - } - /// Cosine - pub fn cos(self) -> Self { - let s = -self.v.sin(); - Grad { - v: self.v.cos(), - dx: self.dx * s, - dy: self.dy * s, - dz: self.dz * s, - } - } - /// Tangent - pub fn tan(self) -> Self { - let c = self.v.cos().powi(2); - Grad { - v: self.v.tan(), - dx: self.dx / c, - dy: self.dy / c, - dz: self.dz / c, - } - } - /// Arcsin - pub fn asin(self) -> Self { - let r = (1.0 - self.v.powi(2)).sqrt(); - Grad { - v: self.v.asin(), - dx: self.dx / r, - dy: self.dy / r, - dz: self.dz / r, - } - } - /// Arccos - pub fn acos(self) -> Self { - let r = (1.0 - self.v.powi(2)).sqrt(); - Grad { - v: self.v.acos(), - dx: -self.dx / r, - dy: -self.dy / r, - dz: -self.dz / r, - } - } - /// Arctangent - pub fn atan(self) -> Self { - let r = self.v.powi(2) + 1.0; - Grad { - v: self.v.atan(), - dx: self.dx / r, - dy: self.dy / r, - dz: self.dz / r, - } - } - /// Exponential function - pub fn exp(self) -> Self { - let v = self.v.exp(); - Grad { - v, - dx: v * self.dx, - dy: v * self.dy, - dz: v * self.dz, - } - } - /// Natural log - pub fn ln(self) -> Self { - Grad { - v: self.v.ln(), - dx: self.dx / self.v, - dy: self.dy / self.v, - dz: self.dz / self.v, - } - } - - /// Reciprocal - pub fn recip(self) -> Self { - let v2 = -self.v.powi(2); - Grad { - v: 1.0 / self.v, - dx: self.dx / v2, - dy: self.dy / v2, - dz: self.dz / v2, - } - } - - /// Minimum of two values - pub fn min(self, rhs: Self) -> Self { - if self.v < rhs.v { - self - } else { - rhs - } - } - - /// Maximum of two values - pub fn max(self, rhs: Self) -> Self { - if self.v > rhs.v { - self - } else { - rhs - } - } - - /// Checks that the two values are roughly equal, panicking otherwise - #[cfg(test)] - pub(crate) fn compare_eq(&self, other: Self) { - let d = (self.v - other.v) - .abs() - .max((self.dx - other.dx).abs()) - .max((self.dy - other.dy).abs()) - .max((self.dz - other.dz).abs()); - if d >= 1e-6 { - panic!("lhs != rhs ({self:?} != {other:?})"); - } - } -} - -impl From for Grad { - fn from(v: f32) -> Self { - Grad { - v, - dx: 0.0, - dy: 0.0, - dz: 0.0, - } - } -} - -impl From for nalgebra::Vector4 { - fn from(g: Grad) -> Self { - nalgebra::Vector4::new(g.dx, g.dy, g.dz, g.v) - } -} - -impl std::ops::Add for Grad { - type Output = Self; - fn add(self, rhs: Self) -> Self { - Grad { - v: self.v + rhs.v, - dx: self.dx + rhs.dx, - dy: self.dy + rhs.dy, - dz: self.dz + rhs.dz, - } - } -} - -impl std::ops::Mul for Grad { - type Output = Self; - fn mul(self, rhs: Self) -> Self { - Self { - v: self.v * rhs.v, - dx: self.v * rhs.dx + rhs.v * self.dx, - dy: self.v * rhs.dy + rhs.v * self.dy, - dz: self.v * rhs.dz + rhs.v * self.dz, - } - } -} - -impl std::ops::Div for Grad { - type Output = Self; - fn div(self, rhs: Self) -> Self { - let d = rhs.v.powi(2); - Self { - v: self.v / rhs.v, - dx: (rhs.v * self.dx - self.v * rhs.dx) / d, - dy: (rhs.v * self.dy - self.v * rhs.dy) / d, - dz: (rhs.v * self.dz - self.v * rhs.dz) / d, - } - } -} - -impl std::ops::Sub for Grad { - type Output = Self; - fn sub(self, rhs: Self) -> Self { - Self { - v: self.v - rhs.v, - dx: self.dx - rhs.dx, - dy: self.dy - rhs.dy, - dz: self.dz - rhs.dz, - } - } -} - -impl std::ops::Neg for Grad { - type Output = Self; - fn neg(self) -> Self { - Self { - v: -self.v, - dx: -self.dx, - dy: -self.dy, - dz: -self.dz, - } - } -} - -//////////////////////////////////////////////////////////////////////////////// - /// Stores a range, with conservative calculations to guarantee that it always /// contains the actual value. /// @@ -520,7 +237,7 @@ impl Interval { /// Splits the interval at the midpoint /// /// ``` - /// # use fidget::eval::types::Interval; + /// # use fidget::types::Interval; /// let a = Interval::new(0.0, 1.0); /// let (lo, hi) = a.split(); /// assert_eq!(lo, Interval::new(0.0, 0.5)); @@ -537,7 +254,7 @@ impl Interval { /// Linear interpolation from `lower` to `upper` /// /// ``` - /// # use fidget::eval::types::Interval; + /// # use fidget::types::Interval; /// let a = Interval::new(0.0, 2.0); /// assert_eq!(a.lerp(0.5), 1.0); /// assert_eq!(a.lerp(0.75), 1.5); @@ -550,7 +267,7 @@ impl Interval { /// Calculates the width of the interval /// /// ``` - /// # use fidget::eval::types::Interval; + /// # use fidget::types::Interval; /// let a = Interval::new(2.0, 3.0); /// assert_eq!(a.width(), 1.0); /// let b = Interval::new(2.0, 5.0); diff --git a/fidget/src/core/types/mod.rs b/fidget/src/core/types/mod.rs new file mode 100644 index 00000000..8e1a028a --- /dev/null +++ b/fidget/src/core/types/mod.rs @@ -0,0 +1,6 @@ +//! Custom types used during evaluation + +mod grad; +mod interval; +pub use grad::Grad; +pub use interval::Interval; diff --git a/fidget/src/core/vm/mod.rs b/fidget/src/core/vm/mod.rs index ad0e8d60..0e7e056f 100644 --- a/fidget/src/core/vm/mod.rs +++ b/fidget/src/core/vm/mod.rs @@ -3,10 +3,10 @@ use crate::{ compiler::RegOp, context::Node, eval::{ - types::{Grad, Interval}, BulkEvaluator, MathShape, Shape, ShapeVars, Tape, Trace, TracingEvaluator, TransformedShape, }, + types::{Grad, Interval}, Context, Error, }; use nalgebra::Matrix4; diff --git a/fidget/src/jit/aarch64/grad_slice.rs b/fidget/src/jit/aarch64/grad_slice.rs index ce43ee36..c3d6dc10 100644 --- a/fidget/src/jit/aarch64/grad_slice.rs +++ b/fidget/src/jit/aarch64/grad_slice.rs @@ -1,9 +1,9 @@ use crate::{ - eval::types::Grad, jit::{ grad_slice::GradSliceAssembler, mmap::Mmap, reg, Assembler, AssemblerData, IMM_REG, OFFSET, REGISTER_LIMIT, }, + types::Grad, Error, }; use dynasmrt::{dynasm, DynasmApi, DynasmLabelApi}; diff --git a/fidget/src/jit/aarch64/interval.rs b/fidget/src/jit/aarch64/interval.rs index 9b14f7f3..14f3c91f 100644 --- a/fidget/src/jit/aarch64/interval.rs +++ b/fidget/src/jit/aarch64/interval.rs @@ -1,10 +1,10 @@ use crate::{ - eval::types::Interval, jit::{ interval::IntervalAssembler, mmap::Mmap, reg, Assembler, AssemblerData, CHOICE_BOTH, CHOICE_LEFT, CHOICE_RIGHT, IMM_REG, OFFSET, REGISTER_LIMIT, }, + types::Interval, Error, }; use dynasmrt::{dynasm, DynasmApi}; diff --git a/fidget/src/jit/grad_slice.rs b/fidget/src/jit/grad_slice.rs index 58a3060d..c166c4ab 100644 --- a/fidget/src/jit/grad_slice.rs +++ b/fidget/src/jit/grad_slice.rs @@ -1,6 +1,6 @@ use crate::{ - eval::types::Grad, jit::{AssemblerData, SimdSize}, + types::Grad, }; /// Assembler for automatic differentiation / gradient evaluation diff --git a/fidget/src/jit/mod.rs b/fidget/src/jit/mod.rs index e3addff4..2753050e 100644 --- a/fidget/src/jit/mod.rs +++ b/fidget/src/jit/mod.rs @@ -26,11 +26,11 @@ use crate::{ compiler::RegOp, context::{Context, Node}, eval::{ - types::{Grad, Interval}, BulkEvaluator, MathShape, Shape, ShapeVars, Tape, TracingEvaluator, TransformedShape, }, jit::mmap::Mmap, + types::{Grad, Interval}, vm::{Choice, GenericVmShape, VmData, VmTrace, VmWorkspace}, Error, }; diff --git a/fidget/src/jit/x86_64/grad_slice.rs b/fidget/src/jit/x86_64/grad_slice.rs index b25bfbae..edb2d414 100644 --- a/fidget/src/jit/x86_64/grad_slice.rs +++ b/fidget/src/jit/x86_64/grad_slice.rs @@ -1,9 +1,9 @@ use crate::{ - eval::types::Grad, jit::{ grad_slice::GradSliceAssembler, mmap::Mmap, reg, Assembler, AssemblerData, IMM_REG, OFFSET, REGISTER_LIMIT, }, + types::Grad, Error, }; use dynasmrt::{dynasm, DynasmApi, DynasmLabelApi}; diff --git a/fidget/src/jit/x86_64/interval.rs b/fidget/src/jit/x86_64/interval.rs index 47c84f40..22000c1d 100644 --- a/fidget/src/jit/x86_64/interval.rs +++ b/fidget/src/jit/x86_64/interval.rs @@ -1,10 +1,10 @@ use crate::{ - eval::types::Interval, jit::{ interval::IntervalAssembler, mmap::Mmap, reg, Assembler, AssemblerData, CHOICE_BOTH, CHOICE_LEFT, CHOICE_RIGHT, IMM_REG, OFFSET, REGISTER_LIMIT, }, + types::Interval, Error, }; use dynasmrt::{dynasm, DynasmApi, DynasmLabelApi}; diff --git a/fidget/src/mesh/cell.rs b/fidget/src/mesh/cell.rs index a5a80df7..5bf71ec0 100644 --- a/fidget/src/mesh/cell.rs +++ b/fidget/src/mesh/cell.rs @@ -1,5 +1,5 @@ //! Data types used in the octree -use crate::eval::types::Interval; +use crate::types::Interval; use super::{ gen::CELL_TO_EDGE_TO_VERT, diff --git a/fidget/src/render/render2d.rs b/fidget/src/render/render2d.rs index 9a5575af..17c62f28 100644 --- a/fidget/src/render/render2d.rs +++ b/fidget/src/render/render2d.rs @@ -1,8 +1,9 @@ //! 2D bitmap rendering / rasterization use super::RenderHandle; use crate::{ - eval::{types::Interval, BulkEvaluator, Shape, TracingEvaluator}, + eval::{BulkEvaluator, Shape, TracingEvaluator}, render::config::{AlignedRenderConfig, Queue, RenderConfig, Tile}, + types::Interval, }; use nalgebra::Point2; use std::sync::Arc; diff --git a/fidget/src/render/render3d.rs b/fidget/src/render/render3d.rs index a0847e2a..3cd24f31 100644 --- a/fidget/src/render/render3d.rs +++ b/fidget/src/render/render3d.rs @@ -1,8 +1,9 @@ //! 3D bitmap rendering / rasterization use super::RenderHandle; use crate::{ - eval::{types::Interval, BulkEvaluator, Shape, TracingEvaluator}, + eval::{BulkEvaluator, Shape, TracingEvaluator}, render::config::{AlignedRenderConfig, Queue, RenderConfig, Tile}, + types::Interval, }; use nalgebra::Point3;