From c48dc55b43491001d30e418665f8eabdf6f376d5 Mon Sep 17 00:00:00 2001 From: Jovansonlee Cesar Date: Sun, 23 Jul 2023 15:06:33 +0800 Subject: chore: update nalgebra 0.30 -> 0.32, parry2d 0.8 -> 0.13 --- Cargo.lock | 136 +++++++++------------ Cargo.toml | 5 - packages/svgbob/Cargo.toml | 4 +- packages/svgbob/src/buffer/cell_buffer/cell.rs | 8 +- .../svgbob/src/buffer/fragment_buffer/fragment.rs | 10 +- .../src/buffer/fragment_buffer/fragment/line.rs | 2 +- packages/svgbob/src/util.rs | 10 +- 7 files changed, 73 insertions(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d95a776..9df4421 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -169,12 +169,6 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -268,17 +262,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - [[package]] name = "gimli" version = "0.27.3" @@ -411,12 +394,11 @@ checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] name = "jss" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd94ba3232855c000f6c926a428b1b59a7943f4007709b4f5b59c94cbcae914" +checksum = "44cc6d2f1f21837c922409774201f420bf3d009705b85dfca3c6e1c5b93a5519" dependencies = [ "json", - "log", "once_cell", "phf", ] @@ -511,19 +493,18 @@ dependencies = [ [[package]] name = "mt-dom" -version = "0.55.1" +version = "0.55.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde5725a6fd1746632992112e73c6d36c831b6ee352702e4769091f661ea7768" +checksum = "b9f171d731d6f989f693effd37dcc2159767ea210a623e6ae384be609daee6e4" dependencies = [ - "log", "longest-increasing-subsequence", ] [[package]] name = "nalgebra" -version = "0.30.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb2d0de08694bed883320212c18ee3008576bfe8c306f4c3c4a58b4876998be" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" dependencies = [ "approx", "matrixmultiply", @@ -537,9 +518,9 @@ dependencies = [ [[package]] name = "nalgebra-macros" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" dependencies = [ "proc-macro2", "quote", @@ -622,6 +603,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "optional" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978aa494585d3ca4ad74929863093e87cac9790d81fe7aba2b3dc2890643a0fc" + [[package]] name = "parking_lot" version = "0.12.1" @@ -638,7 +625,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -647,9 +634,9 @@ dependencies = [ [[package]] name = "parry2d" -version = "0.8.0" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65289d4e196cfaca6643766c0d7288997f3b4cee99eba4cdcc28c1dcb8bf2450" +checksum = "104ae65232e20477a98f9f1e75ca9850eae24a2ea846a2b1a0af03ad752136ce" dependencies = [ "approx", "arrayvec", @@ -663,6 +650,7 @@ dependencies = [ "simba", "slab", "smallvec", + "spade", ] [[package]] @@ -679,20 +667,19 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "phf" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", "phf_shared", - "proc-macro-hack", ] [[package]] name = "phf_generator" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", "rand", @@ -700,23 +687,22 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", "phf_shared", - "proc-macro-hack", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] name = "phf_shared" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] @@ -762,18 +748,6 @@ dependencies = [ "bstr", ] -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.66" @@ -798,18 +772,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", "rand_core", ] @@ -818,9 +780,6 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] [[package]] name = "rawpointer" @@ -843,6 +802,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +[[package]] +name = "robust" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5864e7ef1a6b7bcf1d6ca3f655e65e724ed3b52546a0d0a663c991522f552ea" + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -872,21 +837,20 @@ dependencies = [ [[package]] name = "sauron" -version = "0.57.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47dcc1944b8586038e70960fa9b6cf4f8abcddc735987ed3f2d49c78921c7400" +checksum = "310f088de5fc8c6c8154f621809ce19e96147fde5b23083414ef2b603ae3c6a3" dependencies = [ - "cfg-if 0.1.10", "sauron-core", ] [[package]] name = "sauron-core" -version = "0.57.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79899cf9dd3521c1104d3d9157bb191951b9363a6512245263d4074c08122887" +checksum = "4e3b862be1ea59993de5ce930a70defc19aca8f6f65f32d2e43da13ffeeee47c" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "doc-comment", "js-sys", "jss", @@ -957,9 +921,9 @@ dependencies = [ [[package]] name = "simba" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3fd720c48c53cace224ae62bef1bbff363a70c68c4802a78b5cc6159618176" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" dependencies = [ "approx", "num-complex", @@ -999,6 +963,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "spade" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88e65803986868d2372c582007c39ba89936a36ea5f236bf7a7728dc258f04f9" +dependencies = [ + "num-traits", + "optional", + "robust", + "smallvec", +] + [[package]] name = "strsim" version = "0.8.0" @@ -1192,7 +1168,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite", "tracing-core", @@ -1258,7 +1234,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "serde", "serde_json", "wasm-bindgen-macro", @@ -1285,7 +1261,7 @@ version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", diff --git a/Cargo.toml b/Cargo.toml index 87525f2..45679c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,11 +5,6 @@ members = [ "packages/svgbob_server", ] -[patch.crates-io] -#mt-dom = { git = "https://github.com/ivanceras/mt-dom.git", branch = "master" } -#sauron = { git = "https://github.com/ivanceras/sauron.git", branch = "develop" } -#jss = { path = "../jss" } - [profile.release] opt-level = 3 lto = true diff --git a/packages/svgbob/Cargo.toml b/packages/svgbob/Cargo.toml index 42be7fd..3f82922 100644 --- a/packages/svgbob/Cargo.toml +++ b/packages/svgbob/Cargo.toml @@ -10,8 +10,8 @@ license = "Apache-2.0" edition = "2021" [dependencies] -nalgebra = "0.30.1" -parry2d = "0.8.0" +nalgebra = "0.32.1" +parry2d = "0.13.5" lazy_static = "1.3.0" sauron = { version = "0.57.0", default-features = false} #sauron = { path = "../../../sauron", default-features = false} diff --git a/packages/svgbob/src/buffer/cell_buffer/cell.rs b/packages/svgbob/src/buffer/cell_buffer/cell.rs index faf07b9..237edf8 100644 --- a/packages/svgbob/src/buffer/cell_buffer/cell.rs +++ b/packages/svgbob/src/buffer/cell_buffer/cell.rs @@ -1,6 +1,6 @@ use crate::{util, Point}; use parry2d::{ - bounding_volume::AABB, + bounding_volume::Aabb, math::Isometry, query::{intersection_test, PointQuery}, shape::{Polyline, Segment}, @@ -129,7 +129,7 @@ impl Cell { /// the bounding box of this cell #[inline] - fn bounding_box(&self) -> AABB { + fn bounding_box(&self) -> Aabb { let start = Point::new( self.x as f32 * Self::width(), self.y as f32 * Self::height(), @@ -138,7 +138,7 @@ impl Cell { (self.x + 1) as f32 * Self::width(), (self.y + 1) as f32 * Self::height(), ); - AABB::new(*start, *end) + Aabb::new(*start, *end) } /// Convert the bounding box aabb to polyline segment @@ -433,7 +433,7 @@ mod tests { #[test] fn test_aabb() { assert_eq!( - AABB::new(*Point::new(0.0, 0.0), *Point::new(1.0, 2.0)), + Aabb::new(*Point::new(0.0, 0.0), *Point::new(1.0, 2.0)), Cell::new(0, 0).bounding_box() ); } diff --git a/packages/svgbob/src/buffer/fragment_buffer/fragment.rs b/packages/svgbob/src/buffer/fragment_buffer/fragment.rs index aa041ab..1cef8f1 100644 --- a/packages/svgbob/src/buffer/fragment_buffer/fragment.rs +++ b/packages/svgbob/src/buffer/fragment_buffer/fragment.rs @@ -5,7 +5,7 @@ pub use circle::Circle; pub use line::Line; pub use marker_line::{Marker, MarkerLine}; use parry2d::{ - bounding_volume::{BoundingVolume, AABB}, + bounding_volume::{Aabb, BoundingVolume}, math::Isometry, query::{intersection_test, PointQuery}, shape::{ConvexPolygon, Polyline, Segment, Shape}, @@ -167,13 +167,13 @@ impl Fragment { } pub fn hit(&self, start: Point, end: Point) -> bool { - self.is_intersecting(&AABB::new(*start, *end)) + self.is_intersecting(&Aabb::new(*start, *end)) } /// check if this fragment is intersecting with this bounding box /// Note: if intersection logic requires testing the solid shape inside the polygon /// use the ConvexPolygon of each shape instead of Polyline - pub fn is_intersecting(&self, bbox: &AABB) -> bool { + pub fn is_intersecting(&self, bbox: &Aabb) -> bool { let points = vec![ *Point::new(bbox.mins.x, bbox.mins.y), *Point::new(bbox.maxs.x, bbox.mins.y), @@ -206,9 +206,9 @@ impl Fragment { } /// check if this fragment can be contain in the specified bounding box `bbox` - pub fn is_inside(&self, bbox: &AABB) -> bool { + pub fn is_inside(&self, bbox: &Aabb) -> bool { let (start, end) = self.bounds(); - let frag_bound = AABB::new(*start, *end); + let frag_bound = Aabb::new(*start, *end); bbox.contains(&frag_bound) } diff --git a/packages/svgbob/src/buffer/fragment_buffer/fragment/line.rs b/packages/svgbob/src/buffer/fragment_buffer/fragment/line.rs index 48e6fc2..aa1aa87 100644 --- a/packages/svgbob/src/buffer/fragment_buffer/fragment/line.rs +++ b/packages/svgbob/src/buffer/fragment_buffer/fragment/line.rs @@ -4,7 +4,7 @@ use crate::{ util, Direction, Point, }; use parry2d::{ - bounding_volume::AABB, + bounding_volume::Aabb, math::Isometry, query::PointQuery, shape::{Polyline, Segment, Shape}, diff --git a/packages/svgbob/src/util.rs b/packages/svgbob/src/util.rs index 21aa7f7..d6e97d5 100644 --- a/packages/svgbob/src/util.rs +++ b/packages/svgbob/src/util.rs @@ -1,6 +1,6 @@ use crate::Point; use parry2d::{ - bounding_volume::AABB, math::Isometry, query::PointQuery, shape::Triangle, + bounding_volume::Aabb, math::Isometry, query::PointQuery, shape::Triangle, }; use std::cmp::Ordering; @@ -31,7 +31,7 @@ pub fn ord(f1: f32, f2: f32) -> Ordering { /// clips a line to the bounding box of this whole grid /// and approximate each point to the closes intersection fn clip_line_internal( - aabb: &AABB, + aabb: &Aabb, start: Point, end: Point, ) -> Option<(Point, Point)> { @@ -49,7 +49,7 @@ fn clip_line_internal( /// clip a line but do not extend the points pub fn clip_line( - aabb: &AABB, + aabb: &Aabb, start: Point, end: Point, ) -> Option<(Point, Point)> { @@ -476,7 +476,7 @@ mod tests { fn test_clip_line() { let a = CellGrid::a(); let b = CellGrid::b(); - let bounds = AABB::new(*a, *b); + let bounds = Aabb::new(*a, *b); let clip = clip_line(&bounds, a, b); println!("clip: {:#?}", clip); assert_eq!(clip, Some((a, b))); @@ -487,7 +487,7 @@ mod tests { let c = CellGrid::c(); let m = CellGrid::m(); let w = CellGrid::w(); - let bounds = AABB::new(*m, *w); + let bounds = Aabb::new(*m, *w); let clip = clip_line(&bounds, c, w); println!("clip: {:#?}", clip); assert_eq!(clip, Some((m, w))); -- cgit v1.2.3