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

[feat]: Manhattan router should support ports inside the element's body. #2763

Open
alexandernst opened this issue Sep 25, 2024 · 4 comments

Comments

@alexandernst
Copy link
Contributor

alexandernst commented Sep 25, 2024

Current versus expected behaviour

Note

This is a follow up from #2738 (reply in thread)

Hi @kumilingus !

I've been playing around with the code you gave me in the manhattan-router discussion the other day and I saw something that I thought is worth mentioning. Certain situations lead to the manhattan router creating extra vertices:

image

I'm aware that this might be (¿?) caused by the step option and because of the way collisions are detected (¿?), which is fine, but if I set the step value to 1 (actually any value below 7), manhattan just stops avoiding any obstacles at all.

image

I tried debugging the code and re-reading all the docs, and I believe there is a correlation between step and gridSize, but setting the later to the same value doesn't fix the problem.

Why isn't manhattan avoiding obstacles when step < 7 ?

Steps to reproduce

  1. Go to https://codesandbox.io/p/sandbox/runtime-dream-8ffcy9
  2. Change step to any value below 7
  3. Move the cells and check if the link is avoiding the cells

Version

4.0.4

What browsers are you seeing the problem on?

Chrome, Safari

What operating system are you seeing the problem on?

Mac

@alexandernst alexandernst changed the title [Bug]: Manhattan router not avoiding obstacles correctly when step < 5 [Bug]: Manhattan router not avoiding obstacles correctly when step < 7 Sep 26, 2024
@alexandernst
Copy link
Contributor Author

@kumilingus ping 👀

@kumilingus
Copy link
Contributor

  • If the dummy vertex is not 30 pixels but only 20 pixels from the edge of the shape, the loop is gone (there is no need for it)
  • As I mentioned in the other ticket, the manhattan router does not work well with ports inside the element. If the step is to small to exit the shape (starting at the position of the port), then the fallback route is used.

@alexandernst
Copy link
Contributor Author

Ahh, I see. The step size is used to "jump" from the "real port" to the "fake port" (the pS and pT points in my code). If the step size doesn't cover the size of the "jump", it fallbacks. In my case, setting step to <7 will cause the fallback since the radius of the port itself is 5 and I have a margin of 2. That makes sense! It makes my brain hurt 🤔, but it makes sense.
Thank you!!

@kumilingus kumilingus changed the title [Bug]: Manhattan router not avoiding obstacles correctly when step < 7 [feat]: Manhattan router should support ports inside the element's body. Oct 17, 2024
@kumilingus
Copy link
Contributor

Let me reopen this issue with a goal of supporting it at some point.

@kumilingus kumilingus reopened this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants