Skip to content

Commit

Permalink
Update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Logicalshift committed Feb 7, 2022
1 parent 88a69cb commit ec1d782
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bezier/path/arithmetic/ray_cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<Point: Coordinate+Coordinate2D> GraphPath<Point, PathLabel> {
let ray_direction = ray.1 - ray.0;
let collisions = self.ordered_ray_collisions(&ray);

// Work out which edges are interior or exterior
// Work out which edges are interior or exterior for every edge the ray has crossed
for (collision, curve_t, _line_t, _pos) in collisions {
let is_intersection = collision.is_intersection();
let edge = collision.edge();
Expand All @@ -123,7 +123,7 @@ impl<Point: Coordinate+Coordinate2D> GraphPath<Point, PathLabel> {
PathDirection::Anticlockwise => { -side }
};

// Extend the path_crossings vector
// Extend the path_crossings vector to accomodate all of the paths included by this ray
while path_crossings.len() <= path_number as usize { path_crossings.push(0); }

let was_inside = is_inside(&path_crossings);
Expand All @@ -134,6 +134,9 @@ impl<Point: Coordinate+Coordinate2D> GraphPath<Point, PathLabel> {
}
let is_inside = is_inside(&path_crossings);

// At an intersection, we'll hit both edges but we haven't got enough information to see whether or not they're moving into or
// out of the shape, so we can't set their kind here as we may encounter them in any order

// If this isn't an intersection, set whether or not the edge is exterior
let edge_kind = self.edge_kind(edge);
if !is_intersection && (edge_kind == GraphPathEdgeKind::Uncategorised || edge_kind == GraphPathEdgeKind::Visited) {
Expand Down

0 comments on commit ec1d782

Please sign in to comment.