Polygon Division



Excuse me if this is not the best place to post this question.

My issue is this. I'm developing a C++ Engineering application in which I need a function that takes a simple polygon (a piece of cut wood) consisting of 4 to 6 bounding points and is split perfectly down the middle (horizontally) to create 2 new polygons. I need to graphically represent the bottom half differently than the top half, so I need both polygons.

Points of Polygon could be (0,0), (0,25), (100,100), (400,100), (500, 25), (500, 0).

I want a method that would split this right in half at the y=50 line, and give me 2 new polygons in return.

The polygon will always have top and bottom parallel lines which can be used to determine the intersection line...aka a horizontal piece of 2x4 wood.

Any help would be appreciated.

Thanks!
.



Relevant Pages

  • booleans
    ... i've been trying to implement boolean operators (like intersection, ... subtraction) for 3D polygonal objects ... since certain polygons collide with more polygons ... ...
    (comp.graphics.algorithms)
  • Re: Crossing between PATCH and plane
    ... I have the following problem...I have a 3D object, defined by a patch structure, and I want to obtain the intersection between these object and a planar surface. ... The actual problem is a patch describing a ship hull. ... the shape of the hull, there could be more than 1 closed polygons, due ...
    (comp.soft-sys.matlab)
  • Re: Extracting polygons from a given set of lines
    ... all polygons from a given set of lines? ... load the PQ with the LOWER endpoint of each line segment. ... CLOSE the polygon below the intersection ...
    (comp.graphics.algorithms)
  • Re: Intersecting Polygons
    ... don't use polygons much so I can't help you out there. ... I should have asked about the intersection of 2 POLYGONS, ... >> places the coordinates of the intersection rectangle into the destination ... >> Doug. ...
    (microsoft.public.vb.general.discussion)
  • Re: PS3 development: Repost from ugvh
    ... >> use the excuse of more polygons to make things more photorealistic as ... >> an excuse to drive the art direction. ... > polygons on screen is actually limited by the screen resolution, ... > Maybe that will be a good time, because photorealism will have been 'done' ...
    (uk.games.video.misc)