From: Krzysztof K. <twe...@gm...> - 2012-09-05 01:02:36
|
2012/9/5 mathog <ma...@ca...>: > On 02-Sep-2012 15:03, Krzysztof Kosiński wrote: > >>> 2. generate a third PathVector "pathC" = INTERSECTION(pathA,pathB). >>> Just like the Intersection option on the Paths menu. >> >> This cannot be done with 2Geom, because the boolean operations code >> does not work correctly. You need to use the old livarot library, >> which is undocumented and frankly nobody understands it. Your best >> bet >> is copying what the Spray tool does: create an SP object containing >> an >> ellipse and a second SP object (SPPath) containing your path, then >> intersecting them using the relevant function from sp-livarot.h. >> > > splivarot.h functions all (or almost all) have > > SPDesktop *desktop > > as a parameter. That suggests that they only operate directly on the > drawing surface. > This is of course just a guess, based on the parameter name. However, > the Spray tool you refer to is interactive, > and it produces copies of objects on the drawing surface, and that is > consistent with that guess. > > Unfortunately that is not what I need to do. The shape intersections > are to go to a file and must > never be seen on the desktop. > > Can livarot be used that way? Not without modifications. The relevant function is in splivarot.cpp, lines 115-602. You can try to take everything after the input validation bits (they end around line 239) and turn that into a new function that will take pathvectors, then call this new function from the original. Regards, Krzysztof |