You are not logged in.
Pages: 1
Thanks for your replies and your site.
Imagine if you will a piece of lumber, a 2x4, laying horizontally on your desk in front of you. It is 3 1/2 inches thick when lying on its edge. The ends of the 2x4 can be angled at any degree. There can also be a vertical segment before the angle begins as well.
So, in essence I am looking at this for example, a piece that always is horizontal on top and bottom with different end cuts:
(The dots are just placeholders to help represent the general shape I am trying to describe.)
... _________
.. /..................\
../....................|
.|.....................|
.____________
This is my starting polygon. At exactly the midpoint, 1.75 inches for a 2x4 on edge, I want to intersect this polygon with a line at y = 1.75 inches, giving me 2 new distinct polygons which share the intersection line.
I don't share an interest for the area. I just need the coordinates of the new polygons so I can graphically represent them.
I think your ideas above will help me develop a routine to give me what I need.
Thanks for the help!
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!
Pages: 1