graphstream / gs-core

Graphstream core
http://graphstream-project.org/
Other
402 stars 109 forks source link

Intersection between square shaped nodes and edges #368

Open legolie opened 2 years ago

legolie commented 2 years ago

Hi everyone, nice job with this library!! However, I have a problem with the library

I want to write a program that counts the number of intersections between the nodes that are represented as a square with a specified size. The main Problem is that, the nodes will be visualized as squares but if the coordinates of these nodes are just points x,y and here is exactly my Problem, because I want to check the intersections with the edges with the x,y coordinates but I can not do this properly!
because in some cases the corner of the square or its edges intersect with the edges but the original point that represents the square or the node in graphstream does not, I tried all the possible solutions with collinear points , slopes and everything but nothing worked for me, the question is, is there anyway in Grpahstream so that I can find out the coordinates of the edges or the corners of the square so that I can check with the line segment equation if they intersect ?

I mean something like that as shown in the picture github graphstream

Best regards !