sorting lines into polygons

hey,

i have a list of lines each of which have a to and from 2d point.

The list is just a soup of lines and arent in any particular order.

Also some lines in the polygon may be clockwise and some may be anti-clockwise.

When put together they form one large polygon which encompasses several other smaller polygons.

I need a way to seperate these lines into polygons that consisting of a list of points.

Any help would be apreciated

[474 byte] By [daniel.comerforda] at [2007-11-26 14:19:42]
# 1
Your question is way too vague. Try posting some more specific information, like some code.
CaptainMorgan08a at 2007-7-8 2:10:47 > top of Java-index,Other Topics,Java Game Development...
# 2

I have a function.

private Point[][] CreatePolygons(Point[] formPoints, Point[] toPoints)

{

.........

}

And i need this function to take those point arrays(which have equal length, representing an array of lines) and organise them into several seperate polygons(also a Point array).

The lines passed to the function will form one large polygon ecompassing several smaller polygons. The polygons may be concave. The lines may be clockwise and anticlockwise, such that two fromPoints may line up.

Message was edited by:

daniel.comerford

daniel.comerforda at 2007-7-8 2:10:47 > top of Java-index,Other Topics,Java Game Development...
# 3

> ...

>

> And i need this function to take those point

> arrays(which have equal length, representing an array

> of lines) and organise them into several seperate

> polygons(also a Point array).

Define several seperate polygons.

Could you give a concrete example for input and (desired) output?

prometheuzza at 2007-7-8 2:10:47 > top of Java-index,Other Topics,Java Game Development...
# 4
...I'm still confused. How is it supposed to tell which line is part of one polygon and which line is part of another?
CaptainMorgan08a at 2007-7-8 2:10:47 > top of Java-index,Other Topics,Java Game Development...
# 5
thankyou for the interest,i managed to solve the problem
daniel.comerforda at 2007-7-8 2:10:47 > top of Java-index,Other Topics,Java Game Development...