From: mathog <ma...@ca...> - 2012-09-04 17:30:19
|
On 04-Sep-2012 10:04, Krzysztof Kosiński wrote: > 2012/9/4 mathog <ma...@ca...>: >> Thanks for the reply. The option of having to use livarot, which >> "nobody >> understands" is not >> terribly appealing, and 2geom has its own issues, notably a broken >> boolean >> shape method. Is >> there some reason the inkscape project is creating 2geom instead of >> using >> CGAL? CGAL seems to do >> the same things and is in a more advanced state of development. For >> instance, here is the documentation >> for boolean operations: >> >> >> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Boolean_set_operations_2/Chapter_main.html > > CGAL does not contain boolean operations on paths, only on linear > polygons and polygons with circular segments. It sure looks like it does what you say it doesn't. See the "g"/"m" example about 3/4 of the way down the link above. As near as I can tell the CGAL use of "general polygon" allows "traits" to be associated with each face, so that these may be just a line, or something more complex, like a Bezier curve. http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Arrangement_on_surface_2/Chapter_main.html#Subsection_32.6.7 So that it can do boolean operations on Bezier bounded shapes (general polygons in their parlance). Quote from the first link, near the g/m intersection picture: Instantiating the arrangement-traits Arr_traits_2 above with the traits class that handle Bézier curves Arr_bezier_traits_2, results with the definition of a general-polygon set type that can be used to perform Boolean set-operations on point sets bounded by Bézier curves. The next example computes the intersection of two general polygons bounded by Bézier curves read from two input files respectively. The default input files our example uses (char_g.dat and char_m.dat) define two general polygons shaped in the form of the characters g and m in the Times New Roman font respectively. Their intersection comprises nine simple polygons, as depicted to the right. Granted CGAL is pretty darn complex. Also the documentation is in a technical jargon that I am not at all familiar with, and where I constantly have the feeling that I am missing the point. For instance, they emphasize that the Bezier control points are rational numbers, but since floats are represented in the computer by a fixed number of bits, these values could hardly be anything else. (Well, excluding infinity and NAN.) Regards, David Mathog ma...@ca... Manager, Sequence Analysis Facility, Biology Division, Caltech |