graphicsgeometry2dbeziercsg

Bezier clipping


I'm trying to find/make an algorithm to compute the intersection (a new filled object) of two arbitrary filled 2D objects. The objects are defined using either lines or cubic beziers and may have holes or self-intersect. I'm aware of several existing algorithms doing the same with polygons, listed here. However, I'd like to support beziers without subdividing them into polygons, and the output should have roughly the same control points as the input in areas where there are no intersections.

This is for an interactive program to do some CSG but the clipping doesn't need to be real-time. I've searched for a while but haven't found good starting points.


Solution

  • I found the following publication to be the best of information regarding Bezier Clipping:

    T. W. Sederberg, BYU, Computer Aided Geometric Design Course Notes

    Chapter 7 that talks about Curve Intersection is available online. It outlines 4 different approaches to find intersections and describes Bezier Clipping in detail:

    https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=1000&context=facpub