Jump to content
  • Advertisement
Sign in to follow this  
yapposai

determine if 2 randomly rotated polylines are the same

This topic is 4024 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a polyline composed of line segments which I have to search for a match against a DB of polylines. The catch is the all the polylines may be rotated arbitrarily. so I can't simply compare point by point. Does anybody have ideas on how to solve this? I'm searching for "rotation invariant searching" but it seems to complicated for what I am trying to do. I'm hoping somebody has a simpler solution.

Share this post


Link to post
Share on other sites
Advertisement
If I understand what you're doing right, I'd have all the polylines in your list rotated so that one arbitrary end of the polyline is oriented vertically or horizontally.

Then you line up your polyline to check the same way (an arbitrary end rotated to be vertical or horizontal (whichever suits you best). Then you can check pointwise. If there isn't a match, use the other end of your polyline to line up, and try again.

Hope I explained that well. The idea is just to orient some part of your lines so that they're all similar. This way you're eliminating the arbitrary rotations segments can have from the searching criteria.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!