- 
                Notifications
    You must be signed in to change notification settings 
- Fork 27
Description
I very much like what you are doing with BezierKit and would like to use it for a new project. I plan to draw graphs (boxes connected by lines). The path between boxes will be connected by polylines (converted to BezierKit Paths) and I want to add arrowheads where the path intersects with the box at either end. This seems like it ought to be easy:
- Create the polyline as a path going from the center of one box to the center of the next.
- Create paths for the boxes at the head and tail of the line.
- Subtract the paths of the boxes from the line, removing the part of the line where it intersects the boxes.
- Create paths for arrowheads at the ends of the line path, using the derivative of the path at its tail and head for angles for the arrowheads.
- Outline the path and the paths for the arrowheads
- Perform a union on the path and the arrowhead paths so they can be drawn or manipulated further as a single graphics entity.
Unfortunately, I run into problems at step 3, as the boolean operations only seem to work on closed paths, and the polyline is, in its simplest case a single straight line segment— it might be composed of many segments or other bezier curves, but it is not a closed path. If I first outline the path, the subtraction works as expected, but then I can't simply compute the locations of the path's ends and derivatives to know where to place the arrowheads. I can compute the intersections of the box paths with the line paths, but there doesn't appear to be any way to simply use the PathIntersection or IndexedPathLocation objects to split the path at the intersection points.
As I said, this seems like it ought to be easy. Am I missing something?