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

distance between 2 polygon? #18

Open
xor256 opened this issue Mar 14, 2018 · 10 comments
Open

distance between 2 polygon? #18

xor256 opened this issue Mar 14, 2018 · 10 comments

Comments

@xor256
Copy link

xor256 commented Mar 14, 2018

I search function to count distance 2 polygons.
Simple outline as distance
bitmap

@DanielVartanov
Copy link
Owner

There is a function Polygon#bounding_box which is the most helpful to implement a function of such distance. Please let me know if it helps.

@xor256
Copy link
Author

xor256 commented Mar 15, 2018

I thing about offset outside polygon. Minimal distance between alle edges to all edges other polygon. (i change image for clarify). offset is not this same shape.

How I can count distance between 2 edges?

@DanielVartanov
Copy link
Owner

You don't need a distance between edges, only distance between vertices (bounding boxes' edges are always parallel to axes).

@letarg0
Copy link

letarg0 commented Mar 15, 2018

What add offset to Polygon_2 ? Any code with Kernel Point?

@DanielVartanov
Copy link
Owner

Sorry, I didn't get your question, could you please change its formulation somehow? Thanks in advance

@letarg0
Copy link

letarg0 commented Mar 17, 2018

@DanielVartanov Please look at image. I have B shape, How get shape around B shape. Bigest , lighter shapes.

@DanielVartanov
Copy link
Owner

@letarg0, well, just to re-iterate, Polygon#bounding_box seems to be a solution to your problem: since you apply this method to both polygons, you'll have just two rectangles each edge of which is parallel to one of axes, which makes the problem trivial since then

@mikolaj24
Copy link

this is not a rectangle

@DanielVartanov
Copy link
Owner

Again, let me repeat: when you apply a method of Polygon#bounding_box to a second polygon labeled 'B', you will have a rectangle. Please see how Polygon#bounding_box works.

@letarg0
Copy link

letarg0 commented Apr 7, 2018

canYou show me a code or draw a image?
I dont know what I canthing about Yours sugestions.

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

No branches or pull requests

4 participants