Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Polygon-Polygon containment predicate and tests #159

Merged
merged 2 commits into from
Sep 10, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use lines iterator
  • Loading branch information
urschrei committed Sep 10, 2017
commit cb0e192a4e56176513d86efa2d630c8b7f09bc58
4 changes: 1 addition & 3 deletions src/algorithm/contains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,7 @@ where
{
fn contains(&self, poly: &Polygon<T>) -> bool {
// decompose poly's exterior ring into Lines, and check each for containment
poly.exterior.0.windows(2).all(|line| {
self.contains(&Line::new(line[0], line[1]))
})
poly.exterior.lines().all(|line| self.contains(&line))
}
}

Expand Down