Thank Howard very much for providing very detailed information. Because my English is not very good, I have read it for a long time.
I am considering how to combine the high level API design of 2D Boolean with some features of constrained Delaunay triangulation.
The following are some of my immature thoughts. If someone is familiar with this aspect, I hope they could provide more detailed suggestions.
I copied the code of gsoc2014 NURBS branch as follows:
/******************** Booleans ********************/
// High level
void bool_AND(int poly2); // gridmesh -> gridmesh (intersection) poly2
void bool_SUB(int poly2); // gridmesh -> gridmesh (intersection) ~poly2
// Low level boolean support algorithms
// Step 1: insert verts at intersections
void insert_vert_poly_gridmesh(int poly,
// Step 2: find mutual entry/exit points
void label_interior_AND(int poly2, bool invert_poly2=false, int *bb=NULL);
void label_interior_SUB(int poly2, int *bb=NULL);
void label_exterior_cells(int poly, bool interior_lbl, int* bb=NULL);
known_corner_t label_interior_cell(int cell, int poly2, bool bool_SUB, known_corner_t kin);
void label_interior_freepoly(int poly);
// Step 3: perform the actual trim
void trim_to_odd(int *bb=NULL);
void trim_to_odd(int poly); // Trim one grid poly, leaving behind parts w/odd winding# in .next_poly linked list
The simplest case may be like this. Input a domain surrounded by a quadrilateral and the lines of two trims. The final output may be in two cases.
The input trim line segment can be marked as interior and exterior, so we can get a variety of combinations.