# HG changeset patch # User alfadur # Date 1541510623 -10800 # Node ID 477faa7b8a48165ee9a3d23d839696025ecd3aa8 # Parent 3078123e84ea866b1920f8d7e2a79107739aebbb fix ray construction diff -r 3078123e84ea -r 477faa7b8a48 rust/integral-geometry/src/lib.rs --- a/rust/integral-geometry/src/lib.rs Tue Nov 06 00:02:23 2018 +0100 +++ b/rust/integral-geometry/src/lib.rs Tue Nov 06 16:23:43 2018 +0300 @@ -83,8 +83,8 @@ } #[inline] - pub fn ray_to(self, end: Point) -> Ray { - self.line_to(end).to_ray() + pub fn ray_with_dir(self, direction: Point) -> Ray { + Ray::new(self, direction) } #[inline] diff -r 3078123e84ea -r 477faa7b8a48 rust/landgen/src/outline.rs --- a/rust/landgen/src/outline.rs Tue Nov 06 00:02:23 2018 +0100 +++ b/rust/landgen/src/outline.rs Tue Nov 06 16:23:43 2018 +0300 @@ -200,7 +200,7 @@ // go through all points, including fill points for pi in self.iter().cloned() { if pi != segment.start && pi != segment.end { - if intersects(&pi.ray_to(normal), &segment) { + if intersects(&pi.ray_with_dir(normal), &segment) { // ray from segment.start if let Some((t, d)) = solve_intersection( &self.intersections_box, &normal_ray, &segment.start.line_to(pi),