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 distance to polygon function #1559

Merged
merged 1 commit into from May 10, 2017

Conversation

anne-glerum
Copy link
Contributor

Not sure if it needed a test, but out of curiosity I made one of this type.

Copy link
Contributor

@bangerth bangerth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! A test is of course also always welcome!

Does the function require the polygon to be convex? If so, please add that to the documentation as well.

@@ -141,6 +141,15 @@ namespace aspect
const dealii::Point<2> &point);

/**
* Given a 2d point and a list of points which form a polygon, compute the smallest
* distance of the point to the polygon.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add how the sign is defined, namely positive if the point is inside, and negative if outside?

Fix bug

Add acknowledgements

Add test

Improve comment
@anne-glerum
Copy link
Contributor Author

anne-glerum commented May 10, 2017

Great, I've updated the comments and the test is already included.

@bangerth
Copy link
Contributor

/run-tests

Yes, I saw the test. I just wanted to express my appreciation for you adding it right from the start :-)

OK to merge once the tester is happy.

@gassmoeller gassmoeller merged commit 9cc93f6 into geodynamics:master May 10, 2017
@anne-glerum anne-glerum deleted the distance_to_polygon branch May 10, 2017 19:01
@anne-glerum anne-glerum restored the distance_to_polygon branch May 10, 2017 19:01
@anne-glerum anne-glerum deleted the distance_to_polygon branch May 10, 2017 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants