toJTSPolygon

fun Path2d.toJTSPolygon(): Polygon

Convert a FooCAD Path2d into a jts Polygon. If the Path2d is not closed, then use Path2d.toJTSLineString instead.

See toPath2d for the reverse operation.