GetConvexHull() throw a exception

1
McGum
8/9/2011 10:58 AM

Hi,

I use Polygon2D.GetConvexHull()...sometimes a get e exception:
Object reference not set to an instance of an object.

example:
var poly = oldPoly.GetConvexHull();

oldPoly Data:
[0] {4495, 7012}
[1] {2696, 7012}
[2] {2695, 7012}
[3] {2500, 7012}
[4] {2500, 4000}
[5] {4300, 4000}
[6] {7236, 4001}
[7] {7231, 4007}
[8] {6369, 4954}
[9] {4496, 7012}

Thanks for your Support.

EDIT:

Possible, that I used the wrong Forum .. We use the cadlib :)

Wout
8/11/2011 3:50 PM

Hi,

The issue should be fixed now, I've updated the CadLib downloads. The problem was that our implementation didn't handle collinear points in the input polygon correctly.

Note that the input polygon is expected to be counter clockwise (correct in your example code).

Thanks for the report!

- Wout

1