Ignore unused points?
I'm getting this exception thrown from PlainShape.split(). Seems to happen when a polygon has two very nearby vertices.
throw SplitError.unusedPoint
Is it safe to ignore the unused point by replacing the throw with the following code?
i += 1
continue nextNode
Any advice much appreciated!
any exceptions are possible if you have a “bad” polygon (self intersection or hole intersection or some of the external point can be outside). Algorithm is only working with clean polygons. It’s your responsibility to prepere a good polygon, check self intersection and remove zero edges. For debug purpose you can try to check your polygon with PlainShape.validate from iGeometry. But keep in mind that this method is very slow and I do not recommend it for runtime. It’s not a trivial algorithm to clean polygon that why I still do not implement it.