Skip to main content

Crate geometry_adapt_nalgebra

Crate geometry_adapt_nalgebra 

Source
Expand description

Adapt nalgebra points and vectors to the geometry-trait concept surface.

Mirrors the role of the Boost BOOST_GEOMETRY_REGISTER_* macros in boost/geometry/geometries/adapted/ — those specialise the C++ traits::{tag, dimension, coordinate_type, coordinate_system, access} metafunctions for a foreign storage layout. Rust has no specialisation and the orphan rule forbids implementing a foreign trait (geometry_trait::Point) for a foreign type (nalgebra::Point2 et al.), so — as with geometry_adapt::Adapt — each foreign value is wrapped in a local #[repr(transparent)] newtype and the geometry concepts hang off the wrapper.

Two domain nouns are adapted:

Every wrapper pins Cs = Cartesian. nalgebra points and vectors are read-write, so each also implements geometry_trait::PointMut.

Structs§

NaPoint2
Shape-only adapter for nalgebra::Point2<T>.
NaPoint3
Shape-only adapter for nalgebra::Point3<T>.
NaVector2
Shape-only adapter for nalgebra::Vector2<T>.
NaVector3
Shape-only adapter for nalgebra::Vector3<T>.