In a graphical user interface I'm dealing with graph-like structures. Nodes are represented either by circles or rectangles. The user should be able to draw connection lines (directed edges) between two nodes, with the possibility of defining a set of intermediate points this line should pass through.
It's no problem to create a piecewise C2-continuous Bézier curve that starts at the first node's center, goes though all intermediate points and ends at the second node's center.
Problem
But now (mainly for aesthetical reasons) I want the edges to start/end at the node boundaries instead of the center points. So how could I find suitable anchor points on the nodes' boundaries? One possibility would be to calculate the intersection points between my Bézier curve and the nodes border. But for the circle, this would result in a 6th order polynomial equation and trying to solve this numerically seems like overkill.
Possible solution
Another option I tried is to take the intersection between the node boundary and the line that goes through the two controll points of the first/last Bézier curve. While this seems like a good approximation if the intermediate points are further away from the nodes, it fails if they are close:
Gray: intermediate points, green/blue: controll points, red: approximated intersection point
Are there recommended ways to solve this problem? How do existing tools deal with this?