diff -r 745c73e0e644 -r 165e43c3ed59 rust/integral-geometry/src/lib.rs --- a/rust/integral-geometry/src/lib.rs Tue Nov 06 17:00:35 2018 +0100 +++ b/rust/integral-geometry/src/lib.rs Tue Nov 06 19:44:20 2018 +0300 @@ -98,9 +98,14 @@ } #[inline] - pub fn to_fppoint(&self) -> FPPoint { + pub fn to_fppoint(self) -> FPPoint { FPPoint::new(self.x.into(), self.y.into()) } + + #[inline] + pub fn from_fppoint(p: &FPPoint) -> Self { + Self::new(p.x().round(), p.y().round()) + } } #[derive(PartialEq, Eq, Clone, Copy, Debug)]