[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

More on gpc replacement



Hi,

I have been looking at the problem and basically to do a union, diff, 
intersect or xor, of typical closed polygons, one needs to be able to 
determine which line segments of the polygons in question actually 
intersect, (coo0rdinates where they intesect) and to determine if a 
specific point is inside or outside each of the polygons.

To prove this to yourself, draw two complex polygons that partially 
overlap and try to find the intersection.  You will soon see the need to 
determine intersecting line segments, and to determine if a point (vertex) 
is on or in a particular polygon.

Nicely all of these fundamental base routines are part of  
GLU/libnurbs/nurbtess/polyDBG.cc which comes with the GLU source code as 
part of XFree86.

Also nicely in this code is a routne to determine if a polygon is 
self-intersecting and if so there are routines to convert a 
self-intersection polygon into non-self-intersecting pieces.

I still haven't checked out the academic articles, so there might not be 
enough here to do it, but we should be able to create our own UNION, 
DIFFERENCE, INTERSECTION, and XOR routines that simply call on the code in 
libGLU.so to do the basics.

So if we don't have polygons with holes in them (keyhole), we should be 
good to go after some more work.

I will still look at the academic articles but perhaps someone else could 
look at the OOo code that uses libgpc and the code in libGLU and see if 
they agree with my assessment  (don't forget you will have to draw two 
funny shaped polygons that overlap partially to understand why those basic 
routines are important).

Given their presence in libGLU.so perhaps there is other code in XFree86 
that already does what we want (the Xserver code already handles region 
growing and clipping for rectangles but we seem to want polygons and not 
just rectangles.

Comments, Ideas and  welcome.

Kevin

 


-- 
To UNSUBSCRIBE, email to debian-openoffice-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: