Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies and switch from alga to simba #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ name = "implicit3d"
path = "src/lib.rs"

[dependencies]
nalgebra = "0.22"
alga = "0.9"
stl_io = "0.5"
bbox = "0.11"
num-traits = "0.2"
bbox = "0.11.2"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't just major+minor be fine?

Copy link
Author

@dflemstr dflemstr Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using the default conventions of the cargo-edit tool which was what I used to automate this change. I suppose it might help ensure that users of this crate get at least the version of a dependency that was used to run the test suite. Imagine if 0.5.2 is buggy, 0.5.3 is fine, and the tests of this crate were tested against 0.5.3. Setting the patch version ensures that users don't accidentally get the 0.5.2 version (ie. they get at least the version that this crate was tested against).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nalgebra = "0.27.1"
num-traits = "0.2.14"
simba = "0.5.1"
stl_io = "0.6.0"

[dev-dependencies]
bencher = "0.1"
approx = "0.3"
bencher = "0.1.5"
approx = "0.5.0"

[[bench]]
name = "objects"
Expand All @@ -33,3 +33,6 @@ harness = false
[badges]
travis-ci = { repository = "hmeyer/implicit3d", branch = "master" }
codecov = { repository = "hmeyer/implicit3d", branch = "master", service = "github" }

[patch.crates-io]
bbox = { git = "https://github.com/dflemstr/bbox.git" }
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub use bbox::BoundingBox;
use num_traits::Float;
use std::fmt::Debug;

/// A Combination of alga::general::RealField and na::RealField.
pub trait RealField: alga::general::RealField + na::RealField {}
/// A Combination of `simba::scalar::RealField` and `na::RealField`.
pub trait RealField: simba::scalar::RealField + na::RealField {}
impl RealField for f64 {}
impl RealField for f32 {}

Expand Down
2 changes: 1 addition & 1 deletion src/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<S: RealField + Float + From<f32>> AffineTransformer<S> {
Some(ref t_inv) => {
let bbox = o.bbox().transform(t_inv);
let transposed3x3 = t
.fixed_slice::<::na::core::dimension::U3, ::na::core::dimension::U3>(0, 0)
.fixed_slice::<3, 3>(0, 0)
.transpose();
AffineTransformer {
object: o,
Expand Down
2 changes: 1 addition & 1 deletion src/twister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<S: RealField + Float + ::num_traits::FloatConst + From<f32>> Twister<S> {
fn twist_point(&self, p: &na::Point3<S>) -> na::Point3<S> {
let p2 = ::na::Point2::new(p.x, p.y);
let angle = p.z * self.height_scaler;
type Rota<S> = ::na::Rotation<S, ::na::U2>;
type Rota<S> = ::na::Rotation<S, 2>;
let trans = Rota::new(angle);
let rp2 = trans.transform_point(&p2);
na::Point3::new(rp2.x, rp2.y, p.z)
Expand Down