From 7ce43f60e5744879b35a70c33a01774da49ec273 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 8 Jun 2024 20:11:15 +0700 Subject: [PATCH] Fix typos (#138) --- demos/README.md | 2 +- fidget/src/core/compiler/alloc.rs | 2 +- fidget/src/core/shape/mod.rs | 2 +- fidget/src/core/vm/mod.rs | 2 +- fidget/src/jit/mod.rs | 4 ++-- fidget/src/lib.rs | 2 +- fidget/src/mesh/qef.rs | 4 ++-- fidget/src/render/render2d.rs | 4 ++-- fidget/src/solver/mod.rs | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/demos/README.md b/demos/README.md index 4d9928b9..3a842cf7 100644 --- a/demos/README.md +++ b/demos/README.md @@ -29,7 +29,7 @@ and runs either on the desktop or as a web app. cargo run --release -pconstraints ``` -![screenshot of contraint editor](constraints/screenshot.png) +![screenshot of constraint editor](constraints/screenshot.png) See the [subfolder](constraints/) for details on bundling for the web. diff --git a/fidget/src/core/compiler/alloc.rs b/fidget/src/core/compiler/alloc.rs index d5eb418c..f2e45317 100644 --- a/fidget/src/core/compiler/alloc.rs +++ b/fidget/src/core/compiler/alloc.rs @@ -234,7 +234,7 @@ impl RegisterAllocator { fn release_mem(&mut self, mem: u32) { assert!(mem >= N as u32); self.spare_memory.push(mem); - // This leaves self.allocations[...] stil pointing to the memory slot, + // This leaves self.allocations[...] still pointing to the memory slot, // but that's okay, because it should never be used } diff --git a/fidget/src/core/shape/mod.rs b/fidget/src/core/shape/mod.rs index 56d84b9a..37a2338a 100644 --- a/fidget/src/core/shape/mod.rs +++ b/fidget/src/core/shape/mod.rs @@ -564,7 +564,7 @@ where } } -/// Trait for types that can be transformed by a 4x4 homogenous transform matrix +/// Trait for types that can be transformed by a 4x4 homogeneous transform matrix pub trait Transformable { /// Apply the given transform to an `(x, y, z)` position fn transform( diff --git a/fidget/src/core/vm/mod.rs b/fidget/src/core/vm/mod.rs index 18f6fe81..d756d1ab 100644 --- a/fidget/src/core/vm/mod.rs +++ b/fidget/src/core/vm/mod.rs @@ -29,7 +29,7 @@ pub use data::{VmData, VmWorkspace}; /// there's no separate planning required to generate a tape. pub type VmFunction = GenericVmFunction<{ u8::MAX as usize }>; -/// Shape that use a the [`VmFunction`] backend for evaluation +/// Shape that uses the [`VmFunction`] backend for evaluation pub type VmShape = Shape; /// Tape storage type which indicates that there's no actual backing storage diff --git a/fidget/src/jit/mod.rs b/fidget/src/jit/mod.rs index 6fe8daea..baca02f4 100644 --- a/fidget/src/jit/mod.rs +++ b/fidget/src/jit/mod.rs @@ -226,7 +226,7 @@ trait Assembler { /// Minimum of two values /// - /// In a tracing evaluator, this function muld also write to the `choices` + /// In a tracing evaluator, this function must also write to the `choices` /// array and may set `simplify` if one branch is always taken. fn build_min(&mut self, out_reg: u8, lhs_reg: u8, rhs_reg: u8); @@ -235,7 +235,7 @@ trait Assembler { // Special-case functions for immediates. In some cases, you can be more // efficient if you know that an argument is an immediate (for example, both - // values in the interval will be the same, and it wlll have no gradients). + // values in the interval will be the same, and it will have no gradients). /// Builds a addition (immediate + register) /// diff --git a/fidget/src/lib.rs b/fidget/src/lib.rs index e277a291..73b8e312 100644 --- a/fidget/src/lib.rs +++ b/fidget/src/lib.rs @@ -109,7 +109,7 @@ //! //! # Functions and shapes //! The [`Function`](crate::eval::Function) trait supports arbitrary numbers of -//! varibles; when using it for implicit surfaces, it's common to wrap it in a +//! variables; when using it for implicit surfaces, it's common to wrap it in a //! [`Shape`](crate::shape::Shape), which binds `(x, y, z)` axes to specific //! variables. //! diff --git a/fidget/src/mesh/qef.rs b/fidget/src/mesh/qef.rs index e2bd501c..9d43d91e 100644 --- a/fidget/src/mesh/qef.rs +++ b/fidget/src/mesh/qef.rs @@ -61,7 +61,7 @@ impl QuadraticErrorSolver { /// Solve the given QEF, minimizing towards the mass point /// /// Returns a vertex localized within the given cell, and adjusts the solver - /// to increase the likelyhood that the vertex is bounded in the cell. + /// to increase the likelihood that the vertex is bounded in the cell. /// /// Also returns the QEF error as the second item in the tuple pub fn solve(&self) -> (CellVertex, f32) { @@ -83,7 +83,7 @@ impl QuadraticErrorSolver { .last() .unwrap_or(0); - // "Dual Contouring: The Secret Sauce" recomments a threshold of 0.1 + // "Dual Contouring: The Secret Sauce" recommends a threshold of 0.1 // when using normalized gradients, but I've found that fails on // things like the cone model. Instead, we'll be a little more // clever: we'll pick the smallest epsilon that keeps the feature in diff --git a/fidget/src/render/render2d.rs b/fidget/src/render/render2d.rs index 1e1bdbf2..8cae25b5 100644 --- a/fidget/src/render/render2d.rs +++ b/fidget/src/render/render2d.rs @@ -123,7 +123,7 @@ impl RenderMode for BitRenderMode { } } -/// Pixel-perfect render mode which mimicks many SDF demos on ShaderToy +/// Pixel-perfect render mode which mimics many SDF demos on ShaderToy /// /// This mode recurses down to individual pixels, so it doesn't take advantage /// of skipping empty / full regions; use [`SdfRenderMode`] for a @@ -160,7 +160,7 @@ impl RenderMode for SdfPixelRenderMode { } } -/// Fast rendering mode which mimicks many SDF demos on ShaderToy +/// Fast rendering mode which mimics many SDF demos on ShaderToy /// /// Unlike [`SdfPixelRenderMode`], this mode uses linear interpolation when /// evaluating empty or full regions, which is significantly faster. diff --git a/fidget/src/solver/mod.rs b/fidget/src/solver/mod.rs index a4a4eb81..6c8860dd 100644 --- a/fidget/src/solver/mod.rs +++ b/fidget/src/solver/mod.rs @@ -259,7 +259,7 @@ pub fn solve( // Update our current position, checking whether it actually changed // (i.e. whether our steps are below the floating-point epsilon) // - // TODO: improve exit critera? + // TODO: improve exit criteria? let mut changed = false; for gi in 0..solver.grad_index.len() { let prev = cur[gi];