From d227066fe78fa4a44b2a11d75f1eadfe7c60a7ff Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 18 Jul 2024 21:01:07 +0700 Subject: [PATCH] Reduce typo count. (#225) This changes one publicly visible field member as detailed in the `CHANGELOG.md`. --- CHANGELOG.md | 5 +++-- crates/parry2d/tests/geometry/ray_cast.rs | 2 +- .../tests/geometry/trimesh_intersection.rs | 8 ++++---- src/bounding_volume/aabb.rs | 9 +++++---- src/partitioning/qbvh/build.rs | 4 ++-- src/partitioning/qbvh/traversal.rs | 6 +++--- src/query/epa/epa3.rs | 2 +- src/query/gjk/gjk.rs | 6 +++--- src/query/gjk/voronoi_simplex2.rs | 8 ++++---- src/query/gjk/voronoi_simplex3.rs | 8 ++++---- ...nlinear_shape_cast_support_map_support_map.rs | 2 +- src/query/shape_cast/shape_cast.rs | 2 +- .../aabb_sets_interferences_collector.rs | 8 ++++---- src/shape/convex_polygon.rs | 4 ++-- src/shape/convex_polyhedron.rs | 16 ++++++++-------- src/shape/cylinder.rs | 2 +- src/shape/heightfield2.rs | 4 ++-- src/shape/heightfield3.rs | 2 +- src/shape/shape.rs | 2 +- src/shape/triangle.rs | 6 +++--- src/shape/trimesh.rs | 2 +- src/transformation/convex_hull3/validation.rs | 10 +++++----- .../mesh_intersection/mesh_intersection.rs | 8 ++++---- src/transformation/utils.rs | 2 +- src/transformation/vhacd/vhacd.rs | 2 +- src/utils/interval.rs | 4 ++-- src/utils/segments_intersection.rs | 2 +- src/utils/z_order.rs | 2 +- 28 files changed, 70 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87629de..d7797473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Modified - `TypedShape::Custom(u32)` is now `TypedShape::Custom(&dyn Shape)`. +- `AabbSetsInterferencesCollector::tolerence` is now spelled correctly as `tolerance`. - `Real` is now exposed through a `use` statement, so that an indirection is removed in documentation: previous occurrences of `Real` now show `f32` or `f64`. @@ -176,7 +177,7 @@ This version was yanked. See the release notes for 0.13.3 instead. ### Modified - About `rkyv` support: most POD structs (`Aabb`, `Ball`, `Cuboid`, etc.) are now archived as themselves instead of - being archived as different types (for example `Aabb` is archived as `Aabb` itself istead of `ArchivedAabb`). + being archived as different types (for example `Aabb` is archived as `Aabb` itself instead of `ArchivedAabb`). ### Added @@ -456,4 +457,4 @@ This version was yanked. See the release notes for 0.13.3 instead. ### Fixed - Fix a bug causing making some ball/convex shape contact manifold computation - fail when they are penetrating deeply. \ No newline at end of file + fail when they are penetrating deeply. diff --git a/crates/parry2d/tests/geometry/ray_cast.rs b/crates/parry2d/tests/geometry/ray_cast.rs index 1856b478..de37fd60 100644 --- a/crates/parry2d/tests/geometry/ray_cast.rs +++ b/crates/parry2d/tests/geometry/ray_cast.rs @@ -54,7 +54,7 @@ fn collinear_raycast_starting_above_segment() { } #[test] -fn perpendicular_raycast_starting_behind_sement() { +fn perpendicular_raycast_starting_behind_segment() { let segment = Segment::new(Point2::new(0.0f32, -10.0), Point2::new(0.0, 10.0)); let ray = Ray::new(Point2::new(-1.0, 0.0), Vector2::new(1.0, 0.0)); assert!(segment.intersects_local_ray(&ray, std::f32::MAX)); diff --git a/crates/parry3d/tests/geometry/trimesh_intersection.rs b/crates/parry3d/tests/geometry/trimesh_intersection.rs index ce8997ab..78cf096a 100644 --- a/crates/parry3d/tests/geometry/trimesh_intersection.rs +++ b/crates/parry3d/tests/geometry/trimesh_intersection.rs @@ -34,7 +34,7 @@ fn trimesh_plane_edge_intersection() { assert!(matches!(result, IntersectResult::Intersect(_))); if let IntersectResult::Intersect(line) = result { - // Need to check points individually since order is not garunteed + // Need to check points individually since order is not guaranteed let vertices = line.vertices(); assert_eq!(vertices.len(), 3); assert!(vertices.contains(&Point3::new(-1.5, -0.75, 0.5))); @@ -52,7 +52,7 @@ fn trimesh_plane_vertex_intersection() { assert!(matches!(result, IntersectResult::Intersect(_))); if let IntersectResult::Intersect(line) = result { - // Need to check points individually since order is not garunteed + // Need to check points individually since order is not guaranteed let vertices = line.vertices(); assert_eq!(vertices.len(), 3); assert!(vertices.contains(&Point3::new(-2.0, -1.0, 0.0))); @@ -70,7 +70,7 @@ fn trimesh_plane_mixed_intersection() { assert!(matches!(result, IntersectResult::Intersect(_))); if let IntersectResult::Intersect(line) = result { - // Need to check points individually since order is not garunteed + // Need to check points individually since order is not guaranteed let vertices = line.vertices(); assert_eq!(vertices.len(), 4); assert!(vertices.contains(&Point3::new(0.0, 2.0, 0.0))); @@ -90,7 +90,7 @@ fn trimesh_plane_multi_intersection() { assert!(matches!(result, IntersectResult::Intersect(_))); if let IntersectResult::Intersect(line) = result { - // Need to check points individually since order is not garunteed + // Need to check points individually since order is not guaranteed let vertices = line.vertices(); assert_eq!(vertices.len(), 6); diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 68c82d76..dfdfd4ec 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -256,11 +256,12 @@ impl Aabb { /// new smaller Aabbs. /// /// # Return - /// This returns a pair where the first item are the new Aabbs and the the second item is - /// the sequance of cuts applied to `self` to obtain the new Aabbs. Each cut is performed + /// This returns a pair where the first item are the new Aabbs and the second item is + /// the sequence of cuts applied to `self` to obtain the new Aabbs. Each cut is performed /// along one axis identified by `-1, -2, -3` for `-X, -Y, -Z` and `1, 2, 3` for `+X, +Y, +Z`, and /// the plane’s bias. - /// The cuts are applied sequancially. For example, if `result.1[0]` contains `1`, then it means + /// + /// The cuts are applied sequentially. For example, if `result.1[0]` contains `1`, then it means /// that `result.0[0]` is equal to the piece of `self` lying in the negative half-space delimited /// by the plane with outward normal `+X`. Then, the other piece of `self` generated by this cut /// (i.e. the piece of `self` lying in the positive half-space delimited by the plane with outward @@ -438,7 +439,7 @@ impl Aabb { // NOTE: we construct the rotation matrix explicitly here instead // of using `Rotation2::new()` because we will use similar - // formulaes on the interval methods. + // formulas on the interval methods. let (sin, cos) = angle.sin_cos(); let rotmat = na::Matrix2::new(cos, -sin, sin, cos); diff --git a/src/partitioning/qbvh/build.rs b/src/partitioning/qbvh/build.rs index 58c98783..07204302 100644 --- a/src/partitioning/qbvh/build.rs +++ b/src/partitioning/qbvh/build.rs @@ -45,7 +45,7 @@ pub trait QbvhDataSplitter { /// along the split axis. pub struct CenterDataSplitter { /// If all the Aabb centers have the same coordinate values along the splitting axis - /// setting this to `true` will allow the spliter to split the Aabb set into two + /// setting this to `true` will allow the splitter to split the Aabb set into two /// subsets arbitrarily. pub enable_fallback_split: bool, } @@ -135,7 +135,7 @@ where indices_workspace: &'idx mut Vec, mut proxies: BuilderProxies, ) -> [&'idx mut [usize]; 4] { - // 1. Snap the spliting point to one fo the Aabb min/max, + // 1. Snap the splitting point to one of the Aabb min/max, // such that at least one Aabb isn’t split along each dimension. let mut split_pt = Point::from(Vector::repeat(-Real::MAX)); let mut split_pt_right = Point::from(Vector::repeat(Real::MAX)); diff --git a/src/partitioning/qbvh/traversal.rs b/src/partitioning/qbvh/traversal.rs index c64f0554..3ae08297 100644 --- a/src/partitioning/qbvh/traversal.rs +++ b/src/partitioning/qbvh/traversal.rs @@ -27,7 +27,7 @@ impl Qbvh { /// /// # Return /// - /// Returns `false` if the traversal exitted early, and `true` otherwise. + /// Returns `false` if the traversal exited early, and `true` otherwise. pub fn traverse_depth_first(&self, visitor: &mut impl SimdVisitor) -> bool { self.traverse_depth_first_node(visitor, 0) } @@ -36,7 +36,7 @@ impl Qbvh { /// /// # Return /// - /// Returns `false` if the traversal exitted early, and `true` otherwise. + /// Returns `false` if the traversal exited early, and `true` otherwise. pub fn traverse_depth_first_node( &self, visitor: &mut impl SimdVisitor, @@ -113,7 +113,7 @@ impl Qbvh { /// /// # Return /// - /// Returns `false` if the traversal exitted early, and `true` otherwise. + /// Returns `false` if the traversal exited early, and `true` otherwise. pub fn traverse_depth_first_with_context( &self, visitor: &mut impl SimdVisitorWithContext, diff --git a/src/query/epa/epa3.rs b/src/query/epa/epa3.rs index 46c661b6..7c42ffb6 100644 --- a/src/query/epa/epa3.rs +++ b/src/query/epa/epa3.rs @@ -205,7 +205,7 @@ impl EPA { .map(|(p, _, _)| p) } - /// Projects the origin on a shape unsing the EPA algorithm. + /// Projects the origin on a shape using the EPA algorithm. /// /// The origin is assumed to be located inside of the shape. /// Returns `None` if the EPA fails to converge or if `g1` and `g2` are not penetrating. diff --git a/src/query/gjk/gjk.rs b/src/query/gjk/gjk.rs index b3acf209..4b8da246 100644 --- a/src/query/gjk/gjk.rs +++ b/src/query/gjk/gjk.rs @@ -27,12 +27,12 @@ pub enum GJKResult { Proximity(Unit>), /// Result of the GJK algorithm when the origin is too far away from the polytope. /// - /// The returned vector is expressed in the local-space of the first geomety involved in the + /// The returned vector is expressed in the local-space of the first geometry involved in the /// GJK execution. NoIntersection(Unit>), } -/// The absolute tolerence used by the GJK algorithm. +/// The absolute tolerance used by the GJK algorithm. pub fn eps_tol() -> Real { let _eps = crate::math::DEFAULT_EPSILON; _eps * 10.0 @@ -342,7 +342,7 @@ where // some castes. // TODO: I feel like we should always return `Some` in // this case, even with floating-point numbers. Though it - // has not been sufficinetly tested with floats yet to be sure. + // has not been sufficiently tested with floats yet to be sure. if cfg!(feature = "improved_fixed_point_support") { return Some((ltoi / ray_length, ldir)); } else { diff --git a/src/query/gjk/voronoi_simplex2.rs b/src/query/gjk/voronoi_simplex2.rs index 7853d4f7..451eef92 100644 --- a/src/query/gjk/voronoi_simplex2.rs +++ b/src/query/gjk/voronoi_simplex2.rs @@ -82,16 +82,16 @@ impl VoronoiSimplex { self.prev_proj[i] } - /// The i-th point of the simplex before the last call to `projet_origin_and_reduce`. + /// The i-th point of the simplex before the last call to `project_origin_and_reduce`. pub fn prev_point(&self, i: usize) -> &CSOPoint { assert!(i <= self.prev_dim, "Index out of bounds."); &self.vertices[self.prev_vertices[i]] } - /// Projets the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin. + /// Projects the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin. /// - /// Retruns the result of the projection or Point::origin() if the origin lies inside of the simplex. - /// The state of the samplex before projection is saved, and can be retrieved using the methods prefixed + /// Returns the result of the projection or Point::origin() if the origin lies inside of the simplex. + /// The state of the simplex before projection is saved, and can be retrieved using the methods prefixed /// by `prev_`. pub fn project_origin_and_reduce(&mut self) -> Point { if self.dim == 0 { diff --git a/src/query/gjk/voronoi_simplex3.rs b/src/query/gjk/voronoi_simplex3.rs index 4ee02329..72c141b7 100644 --- a/src/query/gjk/voronoi_simplex3.rs +++ b/src/query/gjk/voronoi_simplex3.rs @@ -109,16 +109,16 @@ impl VoronoiSimplex { self.prev_proj[i] } - /// The i-th point of the simplex before the last call to `projet_origin_and_reduce`. + /// The i-th point of the simplex before the last call to `project_origin_and_reduce`. pub fn prev_point(&self, i: usize) -> &CSOPoint { assert!(i <= self.prev_dim, "Index out of bounds."); &self.vertices[self.prev_vertices[i]] } - /// Projets the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin. + /// Projects the origin on the boundary of this simplex and reduces `self` the smallest subsimplex containing the origin. /// - /// Retruns the result of the projection or Point::origin() if the origin lies inside of the simplex. - /// The state of the samplex before projection is saved, and can be retrieved using the methods prefixed + /// Returns the result of the projection or `Point::origin()` if the origin lies inside of the simplex. + /// The state of the simplex before projection is saved, and can be retrieved using the methods prefixed /// by `prev_`. pub fn project_origin_and_reduce(&mut self) -> Point { if self.dim == 0 { diff --git a/src/query/nonlinear_shape_cast/nonlinear_shape_cast_support_map_support_map.rs b/src/query/nonlinear_shape_cast/nonlinear_shape_cast_support_map_support_map.rs index 3b4870a9..a19a2a20 100644 --- a/src/query/nonlinear_shape_cast/nonlinear_shape_cast_support_map_support_map.rs +++ b/src/query/nonlinear_shape_cast/nonlinear_shape_cast_support_map_support_map.rs @@ -264,7 +264,7 @@ where SM1: ?Sized + SupportMap, SM2: ?Sized + SupportMap, { - // Because we are doing non-linear CCD, we need an iterative methode here. + // Because we are doing non-linear CCD, we need an iterative method here. // First we need to check if the `time_of_impact = start_time` is legitimate, i.e., // if tunnelling will happen if we don't clamp the motion. // diff --git a/src/query/shape_cast/shape_cast.rs b/src/query/shape_cast/shape_cast.rs index 023832fe..eb9eaaf9 100644 --- a/src/query/shape_cast/shape_cast.rs +++ b/src/query/shape_cast/shape_cast.rs @@ -94,7 +94,7 @@ impl ShapeCastHit { pub struct ShapeCastOptions { /// The maximum time-of-impacts that can be computed. /// - /// Any impact ocurring after this time will be ignored. + /// Any impact occurring after this time will be ignored. pub max_time_of_impact: Real, /// The shapes will be considered as impacting as soon as their distance is smaller or /// equal to this target distance. Must be positive or zero. diff --git a/src/query/visitors/aabb_sets_interferences_collector.rs b/src/query/visitors/aabb_sets_interferences_collector.rs index d2bc030a..e87bb484 100644 --- a/src/query/visitors/aabb_sets_interferences_collector.rs +++ b/src/query/visitors/aabb_sets_interferences_collector.rs @@ -11,7 +11,7 @@ pub struct AabbSetsInterferencesCollector<'a, T: 'a> { /// A tolerance applied to the interference tests. /// /// Aabb pairs closer than `tolerance` will be reported as intersecting. - pub tolerence: Real, + pub tolerance: Real, /// The data contained by the nodes with bounding volumes intersecting `self.bv`. pub collector: &'a mut Vec<(T, T)>, } @@ -20,13 +20,13 @@ impl<'a, T> AabbSetsInterferencesCollector<'a, T> { /// Creates a new `AabbSetsInterferencesCollector`. #[inline] pub fn new( - tolerence: Real, + tolerance: Real, ls_m2: &'a Isometry, ls_m2_abs_rot: &'a Matrix, collector: &'a mut Vec<(T, T)>, ) -> AabbSetsInterferencesCollector<'a, T> { AabbSetsInterferencesCollector { - tolerence, + tolerance, ls_m2, ls_m2_abs_rot, collector, @@ -45,7 +45,7 @@ impl<'a, T> AabbSetsInterferencesCollector<'a, T> { // ) -> VisitStatus { // let ls_right_bv = Aabb::from_half_extents( // self.ls_m2 * right_bv.center(), -// self.ls_m2_abs_rot * right_bv.half_extents() + Vector::repeat(self.tolerence), +// self.ls_m2_abs_rot * right_bv.half_extents() + Vector::repeat(self.tolerance), // ); // // if left_bv.intersects(&ls_right_bv) { diff --git a/src/shape/convex_polygon.rs b/src/shape/convex_polygon.rs index 09114fdd..8a5825ac 100644 --- a/src/shape/convex_polygon.rs +++ b/src/shape/convex_polygon.rs @@ -50,7 +50,7 @@ impl ConvexPolygon { } // Second, find vertices that can be removed because - // of collinearity of adjascent faces. + // of collinearity of adjacent faces. for i2 in 1..points.len() { let i1 = i2 - 1; if normals[i1].dot(&*normals[i2]) > 1.0 - eps { @@ -260,7 +260,7 @@ impl ConvexPolyhedron for ConvexPolygon { out: &mut ConvexPolygonalFeature, ) { out.clear(); - // TODO: actualy find the support feature. + // TODO: actually find the support feature. self.support_face_toward(transform, dir, out) } diff --git a/src/shape/convex_polyhedron.rs b/src/shape/convex_polyhedron.rs index fc4fec90..da03d7ec 100644 --- a/src/shape/convex_polyhedron.rs +++ b/src/shape/convex_polyhedron.rs @@ -101,13 +101,13 @@ pub struct ConvexPolyhedron { vertices: Vec, faces: Vec, edges: Vec, - // Faces adjascent to a vertex. + // Faces adjacent to a vertex. faces_adj_to_vertex: Vec, - // Edges adjascent to a vertex. + // Edges adjacent to a vertex. edges_adj_to_vertex: Vec, - // Edges adjascent to a face. + // Edges adjacent to a face. edges_adj_to_face: Vec, - // Vertices adjascent to a face. + // Vertices adjacent to a face. vertices_adj_to_face: Vec, } @@ -128,7 +128,7 @@ impl ConvexPolyhedron { /// /// # Return /// - /// Retruns `None` if he given solid is not manifold (contains t-junctions, not closed, etc.) + /// Returns `None` if the given solid is not manifold (contains t-junctions, not closed, etc.) pub fn from_convex_mesh( points: Vec>, indices: &[[u32; DIM]], @@ -337,9 +337,9 @@ impl ConvexPolyhedron { faces_adj_to_vertex.resize(total_num_adj_faces as usize, 0); edges_adj_to_vertex.resize(total_num_adj_faces as usize, 0); - // Reset the number of adjascent faces. - // It will be set againt to the right value as - // the adjascent face list is filled. + // Reset the number of adjacent faces. + // It will be set again to the right value as + // the adjacent face list is filled. for v in &mut vertices { v.num_adj_faces_or_edge = 0; } diff --git a/src/shape/cylinder.rs b/src/shape/cylinder.rs index 2c1e514e..fb4c5444 100644 --- a/src/shape/cylinder.rs +++ b/src/shape/cylinder.rs @@ -27,7 +27,7 @@ use rkyv::{bytecheck, CheckBytes}; pub struct Cylinder { /// The half-height of the cylinder. pub half_height: Real, - /// The radius fo the cylinder. + /// The radius of the cylinder. pub radius: Real, } diff --git a/src/shape/heightfield2.rs b/src/shape/heightfield2.rs index 0d1352e9..245cc4cc 100644 --- a/src/shape/heightfield2.rs +++ b/src/shape/heightfield2.rs @@ -147,7 +147,7 @@ impl HeightField { } } - /// Height of the heightfield a the given point after vertical projection on the heightfield surface. + /// Height of the heightfield at the given point after vertical projection on the heightfield surface. pub fn height_at_point(&self, pt: &Point2) -> Option { let cell = self.cell_at_point(pt)?; let seg = self.segment_at(cell)?; @@ -162,7 +162,7 @@ impl HeightField { /// Iterator through all the segments of this heightfield. pub fn segments(&self) -> impl Iterator + '_ { - // TODO: this is not very efficient since this wil + // TODO: this is not very efficient since this will // recompute shared points twice. (0..self.num_cells()).filter_map(move |i| self.segment_at(i)) } diff --git a/src/shape/heightfield3.rs b/src/shape/heightfield3.rs index 06b81278..bef1cb91 100644 --- a/src/shape/heightfield3.rs +++ b/src/shape/heightfield3.rs @@ -824,7 +824,7 @@ impl<'a> HeightFieldRadialTriangles<'a> { /// /// Returns `None` no triangle closest than `max_dist` remain /// to be yielded. The `max_dist` can be modified at each iteration - /// as long as the the new value is smaller or equal to the previous value. + /// as long as the new value is smaller or equal to the previous value. pub fn next(&mut self, max_dist: Real) -> Option { let max_rad = if max_dist == Real::MAX { usize::MAX diff --git a/src/shape/shape.rs b/src/shape/shape.rs index fe713438..d88d0471 100644 --- a/src/shape/shape.rs +++ b/src/shape/shape.rs @@ -206,7 +206,7 @@ impl Debug for TypedShape<'_> { #[cfg(feature = "serde-serialize")] #[derive(Deserialize)] -// NOTE: tha this enum MUST match the `TypedShape` enum. +// NOTE: This enum MUST match the `TypedShape` enum. /// Enum representing the shape with its actual type pub(crate) enum DeserializableTypedShape { /// A ball shape. diff --git a/src/shape/triangle.rs b/src/shape/triangle.rs index af16b55e..34d4d8f9 100644 --- a/src/shape/triangle.rs +++ b/src/shape/triangle.rs @@ -47,7 +47,7 @@ pub enum TrianglePointLocation { /// The 1-st edge is the segment BC. /// The 2-nd edge is the segment AC. // XXX: it appears the conversion of edge indexing here does not match the - // convension of edge indexing for the `fn edge` method (from the ConvexPolyhedron impl). + // convention of edge indexing for the `fn edge` method (from the ConvexPolyhedron impl). OnEdge(u32, [Real; 2]), /// The point lies on the triangle interior. /// @@ -101,9 +101,9 @@ impl TrianglePointLocation { /// Orientation of a triangle. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum TriangleOrientation { - /// Orientation with a clockwise orientaiton, i.e., with a positive signed area. + /// Orientation with a clockwise orientation, i.e., with a positive signed area. Clockwise, - /// Orientation with a clockwise orientaiton, i.e., with a negative signed area. + /// Orientation with a clockwise orientation, i.e., with a negative signed area. CounterClockwise, /// Degenerate triangle. Degenerate, diff --git a/src/shape/trimesh.rs b/src/shape/trimesh.rs index 270ffb53..f263f9fc 100644 --- a/src/shape/trimesh.rs +++ b/src/shape/trimesh.rs @@ -577,7 +577,7 @@ impl TriMesh { /// - Be manifold (closed, no t-junctions, etc.) /// - Be oriented with outward normals. /// - /// If the the trimesh is correctly oriented, but is manifold everywhere except at its boundaries, + /// If the trimesh is correctly oriented, but is manifold everywhere except at its boundaries, /// then the computed pseudo-normals will provide correct point-containment test results except /// for points closest to the boundary of the mesh. /// diff --git a/src/transformation/convex_hull3/validation.rs b/src/transformation/convex_hull3/validation.rs index a4c62352..5b9fb5cd 100644 --- a/src/transformation/convex_hull3/validation.rs +++ b/src/transformation/convex_hull3/validation.rs @@ -32,7 +32,7 @@ pub fn check_convex_hull(points: &[Point3], triangles: &[[u32; 3]]) { let mut edges = HashMap::default(); struct EdgeData { - adjascent_triangles: [usize; 2], + adjacent_triangles: [usize; 2], } // println!( @@ -65,11 +65,11 @@ pub fn check_convex_hull(points: &[Point3], triangles: &[[u32; 3]]) { match edges.entry(edge_key) { Entry::Vacant(e) => { let _ = e.insert(EdgeData { - adjascent_triangles: [itri, usize::MAX], + adjacent_triangles: [itri, usize::MAX], }); } Entry::Occupied(mut e) => { - if e.get().adjascent_triangles[1] != usize::MAX { + if e.get().adjacent_triangles[1] != usize::MAX { panic!( "Detected t-junction for triangle {}, edge: {:?}.", itri, @@ -77,14 +77,14 @@ pub fn check_convex_hull(points: &[Point3], triangles: &[[u32; 3]]) { ); } - e.get_mut().adjascent_triangles[1] = itri; + e.get_mut().adjacent_triangles[1] = itri; } } } } for edge in &edges { - if edge.1.adjascent_triangles[1] == usize::MAX { + if edge.1.adjacent_triangles[1] == usize::MAX { panic!("Detected unfinished triangle."); } } diff --git a/src/transformation/mesh_intersection/mesh_intersection.rs b/src/transformation/mesh_intersection/mesh_intersection.rs index fdc84685..bb181c44 100644 --- a/src/transformation/mesh_intersection/mesh_intersection.rs +++ b/src/transformation/mesh_intersection/mesh_intersection.rs @@ -174,7 +174,7 @@ pub fn intersect_meshes_with_tolerances( } } - // 5: Associate constraint edges generated by a tringle-triangle intersection + // 5: Associate constraint edges generated by a triangle-triangle intersection // to each intersecting triangle where they occur. let mut constraints1 = BTreeMap::<_, Vec<_>>::new(); let mut constraints2 = BTreeMap::<_, Vec<_>>::new(); @@ -236,7 +236,7 @@ pub fn intersect_meshes_with_tolerances( &mut topology_indices, )?; - // 7: Sort the ouput points by insertion order. + // 7: Sort the output points by insertion order. let mut vertices: Vec<_> = point_set.iter().copied().collect(); vertices.sort_by(|a, b| a.id.cmp(&b.id)); let vertices: Vec<_> = vertices.iter().map(|p| Point3::from(p.point)).collect(); @@ -322,7 +322,7 @@ fn extract_connected_components( if !visited_conn_comp[i] { // This connected component doesn’t intersect the second mesh. // Classify one of its face (the "representative face", can be any - // face of the connected copmonent) to determine + // face of the connected component) to determine // if the whole thing is inside or outside. let repr_face = cc.grouped_faces[range[0]]; let repr_pt = mesh1.triangle(repr_face).center(); @@ -546,7 +546,7 @@ fn project_point_to_segment(point: &Point3, segment: &[Point3; 2]) - } /// No matter how smart we are about computing intersections. It is always possible -/// to create ultra thin triangles when a point lies on an edge of a tirangle. These +/// to create ultra thin triangles when a point lies on an edge of a triangle. These /// are degenerate and need to be removed. fn is_triangle_degenerate( triangle: &[Point3; 3], diff --git a/src/transformation/utils.rs b/src/transformation/utils.rs index 33928001..210f8da1 100644 --- a/src/transformation/utils.rs +++ b/src/transformation/utils.rs @@ -179,7 +179,7 @@ pub fn push_open_circle_outline_indices(indices: &mut Vec<[u32; 2]>, range: std: /// revolution center at `center`. The curve is approximated by pushing `nsubdivs` points. /// The `start` and `end` point are not pushed to `out_vtx`. /// -/// ALso pushes to `out_idx` the appropriate index buffer to form the arc (including attaches to +/// Also pushes to `out_idx` the appropriate index buffer to form the arc (including attaches to /// the `start` and `end` points). #[cfg(feature = "dim3")] pub fn push_arc_and_idx( diff --git a/src/transformation/vhacd/vhacd.rs b/src/transformation/vhacd/vhacd.rs index f7fd489b..c7885d3e 100644 --- a/src/transformation/vhacd/vhacd.rs +++ b/src/transformation/vhacd/vhacd.rs @@ -452,7 +452,7 @@ impl VHACD { } } - // Returns a vector such that `result[i]` gives the index of the the voxelized convex part that + // Returns a vector such that `result[i]` gives the index of the voxelized convex part that // intersects it. // // If multiple convex parts intersect the same primitive, then `result[i]` is set to `u32::MAX`. diff --git a/src/utils/interval.rs b/src/utils/interval.rs index a6add575..9b8d9818 100644 --- a/src/utils/interval.rs +++ b/src/utils/interval.rs @@ -149,7 +149,7 @@ impl Interval { self.0 <= t && self.1 >= t } - /// The width of this inverval. + /// The width of this interval. #[must_use] pub fn width(self) -> T::Output where @@ -168,7 +168,7 @@ impl Interval { (self.0 + self.1) / two } - /// Splits this interval at its mitpoint. + /// Splits this interval at its midpoint. #[must_use] pub fn split(self) -> [Self; 2] where diff --git a/src/utils/segments_intersection.rs b/src/utils/segments_intersection.rs index 700f7fc5..d29fb6d6 100644 --- a/src/utils/segments_intersection.rs +++ b/src/utils/segments_intersection.rs @@ -148,7 +148,7 @@ fn parallel_intersection( // Assumes the three points are collinear. fn between(a: &Point2, b: &Point2, c: &Point2) -> Option { // If ab not vertical, check betweenness on x; else on y. - // TODO: handle cases wher we actually are on a vertex (to return OnEdge instead of OnVertex)? + // TODO: handle cases where we actually are on a vertex (to return OnEdge instead of OnVertex)? if a.x != b.x { if a.x <= c.x && c.x <= b.x { let bcoord = (c.x - a.x) / (b.x - a.x); diff --git a/src/utils/z_order.rs b/src/utils/z_order.rs index b970bea2..dc7a7d77 100644 --- a/src/utils/z_order.rs +++ b/src/utils/z_order.rs @@ -1,7 +1,7 @@ use num_traits::float::FloatCore; use std::cmp::Ordering; -#[allow(dead_code)] // We don't use this currently, but migth in the future. +#[allow(dead_code)] // We don't use this currently, but might in the future. pub fn z_cmp_ints(lhs: &[usize], rhs: &[usize]) -> Ordering { assert_eq!( lhs.len(),