locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.94k stars 441 forks source link

Polygon Offset Example #879

Closed nsiatras closed 2 years ago

nsiatras commented 2 years ago

Hello,

I am wondering if there is any example on how to perform polygon offsetting.

I have a double[][] array with the polygon vertices points in clockwise order and I want to inflate it by 2mm. Is there any example code on how to perform the offseting ?

Thank you in advance

nsiatras commented 2 years ago

I found it

CodeK1988 commented 2 years ago

So how?and thank you

CodeK1988 commented 2 years ago

@nsiatras @dr-jts

michaelkirk commented 2 years ago

Probably you want to use the buffer functionality: http://www.tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#buffer%28double%29