Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Incorrect vertex projection for perpendicular edges #4

Open
grimsa opened this issue Jan 6, 2016 · 1 comment
Open

Incorrect vertex projection for perpendicular edges #4

grimsa opened this issue Jan 6, 2016 · 1 comment

Comments

@grimsa
Copy link
Owner

grimsa commented Jan 6, 2016

As perpendicular edges (e.g. AB and CD, where A(0;0), B(0;20), C(5;10) and D(15;10)) have two equally viable angle-bisectors, some vertexes are projected along one, and some - along another bisector, leading to incorrectly determined projection points.

See failing test case:
de.incentergy.geometry.utils.GeometryUtilsTest.GetProjectedPointTest#projectionForPerpendicularIntersectingEdges()

@grimsa
Copy link
Owner Author

grimsa commented Jan 10, 2016

Potential solution documented here: http://www.khetarpal.org/polygon-splitting/#comment-2449214878

For that we have to consider the orientation of both edges. For example, if we are traversing along the ring of the polygon, the bounded are will always lie on the left of each edge (or right, depending on direction of traversal). Let's say we are traversing in the direction of ABCDEF..., then polygon's area is on the left of each edge.
Now if we have a pair of perpendicular edges, we can take the direction of both of them (left+left) and that will give us a quadrant. E.g. for AB and FG it would be the AFG one, for AB and DE it would be BED. Then the angle bisector we are interested in will be in that quadrant. And the rest is easy then.
1b

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant