sprotty icon indicating copy to clipboard operation
sprotty copied to clipboard

Line jump calculation does not work correctly for bezier edges

Open tortmayr opened this issue 3 years ago • 3 comments

When playing around with the class diagram example I noticed that the line jumping calculation for bezier edges doesn't seem to work as expected: weird-routing

I guess we should try to fix this and in the meantime disable line jumping for bezier edges. IMO it's better do don't have any line jumps instead of wrongly computed ones.

@planger As the original contributor of the line jumping feature,do yo maybe have any additional insights on what could cause this problem and how to fix it?

tortmayr avatar Apr 16 '22 08:04 tortmayr

Yes, this is because the IntersectionFinder obtains the routing points of an edge to get its segments. With a sweepline algorithm it then finds the intersections among the segments. However, this algorithm assumes that the segments are straight lines.

I'm afraid, it'll be quite some work to compute the intersections among or with bezier edges, as it would potentially require a different algorithm that takes the curves into account.

Imho we should document in the typedoc that this doesn't work for bezier edges.

planger avatar Apr 16 '22 12:04 planger

Right, this was already noted in https://github.com/eclipse/sprotty/pull/245#pullrequestreview-775887389 but we forgot to create a separate issue for it.

spoenemann avatar Apr 27 '22 14:04 spoenemann

The intersection finder ignores bezier edges with 9241c35. Should we consider this task closed, or do we want to keep it open, in case someone would like to work on supporting line gaps and jumps for bezier lines?

planger avatar May 13 '22 07:05 planger