diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d5bb715..bee2432 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -51,7 +51,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test - args: --features geometry-nalgebra --no-default-features --verbose + args: --features nalgebra --no-default-features --verbose - uses: actions-rs/cargo@v1 with: command: test diff --git a/Cargo.toml b/Cargo.toml index 9b6355c..3ef7aef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,17 +26,19 @@ rustdoc-args = [ ] [features] -default = ["geometry-nalgebra"] -geometry-cgmath = ["dep:cgmath"] -geometry-glam = ["dep:glam"] -geometry-mint = ["dep:mint"] -geometry-nalgebra = ["dep:nalgebra"] -geometry-ultraviolet = ["dep:ultraviolet"] +default = ["nalgebra"] lapack = [ "dep:ndarray", "dep:ndarray-linalg", ] +# Integrations. +cgmath = ["dep:cgmath"] +glam = ["dep:glam"] +mint = ["dep:mint"] +nalgebra = ["dep:nalgebra"] +ultraviolet = ["dep:ultraviolet"] + [dependencies] approx = "^0.5.0" decorum = "^0.4.0" diff --git a/README.md b/README.md index fe90401..817ccb4 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,19 @@ Theon provides reverse integrations with commonly used linear algebra crates in the Rust ecosystem, including [`glam`] and [`ultraviolet`]. These implementations can be enabled using Cargo features. -| Feature | Default | Crate | -|------------------------|---------|-----------------| -| `geometry-cgmath` | No | [`cgmath`] | -| `geometry-glam` | No | [`glam`] | -| `geometry-mint` | No | [`mint`] | -| `geometry-nalgebra` | Yes | [`nalgebra`] | -| `geometry-ultraviolet` | No | [`ultraviolet`] | +| Feature | Default | Crate | +|---------------|---------|-----------------| +| `cgmath` | No | [`cgmath`] | +| `glam` | No | [`glam`] | +| `mint` | No | [`mint`] | +| `nalgebra` | Yes | [`nalgebra`] | +| `ultraviolet` | No | [`ultraviolet`] | Because a given version of Theon implements traits for specific versions of -integrated crates, care must be taken to resolve to these supported versions. -Ideally, integrations would be implemented in these linear algebra crates, but -Theon is still under development and may not be ready for forward integration. +integrated crates, **care must be taken to resolve to these supported +versions**. Ideally, integrations would be implemented in these linear algebra +crates, but Theon is still under development and may not be ready for forward +integration. ## Spatial Queries diff --git a/src/adjunct.rs b/src/adjunct.rs index 3df309b..5853357 100644 --- a/src/adjunct.rs +++ b/src/adjunct.rs @@ -9,7 +9,7 @@ //! //! Implementations for adjunct traits are provided for integrated foreign types when enabling //! geometry features. For example, implementations of `Adjunct` and other traits are provided for -//! `nalgebra` types when the `geometry-nalgebra` feature is enabled. +//! `nalgebra` types when the `nalgebra` feature is enabled. use decorum::cmp::{self, EmptyOrd}; use num::traits::{Bounded, One, Zero}; diff --git a/src/integration/cgmath.rs b/src/integration/cgmath.rs index 89c1a74..c8f2133 100644 --- a/src/integration/cgmath.rs +++ b/src/integration/cgmath.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "geometry-cgmath")] +#![cfg(feature = "cgmath")] use approx::AbsDiffEq; use cgmath::{BaseFloat, BaseNum, Point2, Point3, Vector2, Vector3, Vector4}; diff --git a/src/integration/glam.rs b/src/integration/glam.rs index f863261..780a19c 100644 --- a/src/integration/glam.rs +++ b/src/integration/glam.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "geometry-glam")] +#![cfg(feature = "glam")] use decorum::R64; use glam::{Vec2, Vec3, Vec3A, Vec4}; diff --git a/src/integration/mint.rs b/src/integration/mint.rs index 8676353..23261d4 100644 --- a/src/integration/mint.rs +++ b/src/integration/mint.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "geometry-mint")] +#![cfg(feature = "mint")] // TODO: It is not possible to implement vector space traits for `mint` types, because they require // foreign traits on foreign types. diff --git a/src/integration/nalgebra.rs b/src/integration/nalgebra.rs index a47f4d9..9412f16 100644 --- a/src/integration/nalgebra.rs +++ b/src/integration/nalgebra.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "geometry-nalgebra")] +#![cfg(feature = "nalgebra")] use approx::AbsDiffEq; use decorum::R64; diff --git a/src/integration/ultraviolet.rs b/src/integration/ultraviolet.rs index 16fa3fe..cb35382 100644 --- a/src/integration/ultraviolet.rs +++ b/src/integration/ultraviolet.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "geometry-ultraviolet")] +#![cfg(feature = "ultraviolet")] use decorum::R64; use typenum::consts::{U2, U3, U4}; diff --git a/src/lapack.rs b/src/lapack.rs index d9e2d33..4203c70 100644 --- a/src/lapack.rs +++ b/src/lapack.rs @@ -96,7 +96,7 @@ where } } -#[cfg(all(test, feature = "geometry-nalgebra"))] +#[cfg(all(test, feature = "nalgebra"))] mod tests { use approx::assert_abs_diff_eq; use nalgebra::Point3; diff --git a/src/lib.rs b/src/lib.rs index 7f66ae3..3b3af0b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ //! **Theon** abstracts Euclidean spaces and geometric queries with support for popular linear //! algebra and spatial crates in the Rust ecosystem. -// TODO: Require the `geometry-nalgebra` feature for doc tests. +// TODO: Require the `nalgebra` feature for doc tests. // // See https://github.com/rust-lang/rust/issues/43781 diff --git a/src/query.rs b/src/query.rs index fa51c8b..8124b6d 100644 --- a/src/query.rs +++ b/src/query.rs @@ -941,7 +941,7 @@ where } impl_symmetrical_intersection!(Plane, Ray); -#[cfg(all(test, feature = "geometry-nalgebra"))] +#[cfg(all(test, feature = "nalgebra"))] mod tests { use decorum::real::UnaryRealFunction; use decorum::ExtendedReal;