korge-samples icon indicating copy to clipboard operation
korge-samples copied to clipboard

KotlinNullPointerException during triangulation

Open RezMike opened this issue 5 years ago • 2 comments

I have this error when running triangulation sample:

kotlin.KotlinNullPointerException
	at com.soywiz.korma.triangle.internal.Sweep.finalizationPolygon(Poly2Tri.kt:215)
	at com.soywiz.korma.triangle.internal.Sweep.triangulate(Poly2Tri.kt:196)
	at com.soywiz.korma.triangle.triangulate.TriangulateKt.triangulate(Triangulate.kt:12)
	at MainKt$main$2$1$1.invoke(main.kt:45)
        ...

error

RezMike avatar Jun 21 '20 21:06 RezMike

That triangulation is invalid.

http://r3mi.github.io/poly2tri.js/ https://github.com/r3mi/poly2tri.js/

https://github.com/nerik/poly2trihx http://nerik.github.io/poly2trihx/

soywiz avatar Jun 24 '20 17:06 soywiz

The haxe version sample detects invalid polygons and doesn't allow you to add the lines + allows to add holes. If you want to port the sample to support that too, would be great

soywiz avatar Jun 24 '20 17:06 soywiz