From 2deb4fae2aade5b84a8d5d5cf6eb052de13631d7 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 21 Dec 2017 13:21:08 -0800 Subject: [PATCH] Use binary search to find line intersections to reduce floating point error. This is probably improvable, but let's do the safe thing for now. Closes #57. Closes #58. --- partitioner/src/partitioner.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/partitioner/src/partitioner.rs b/partitioner/src/partitioner.rs index 32eec49b..cda9b1a2 100644 --- a/partitioner/src/partitioner.rs +++ b/partitioner/src/partitioner.rs @@ -1010,8 +1010,7 @@ impl<'a> Partitioner<'a> { let (lower_line, _) = Line::new(lower_left_vertex_position, lower_right_endpoint_position).subdivide_at_x(max_x); - // Use `intersect_at_infinity()` to reduce floating point error. - upper_line.intersect_at_infinity(&lower_line) + upper_line.intersect(&lower_line) } (upper_control_point_vertex_index, u32::MAX) => {