locationtech / jts

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

OffsetCurveBuilder or OffsetCurve how set direction #958

Closed CodeK1988 closed 1 year ago

CodeK1988 commented 1 year ago

i want left offset or right offset.with distance.

OffsetCurveBuilder ocb.getOffsetCurve(lineDrawable.getGeometry().getCoordinates(), 10000 / NEARNESS_FACTOR); 1000 work fine. ocb.getOffsetCurve(lineDrawable.getGeometry().getCoordinates(), -10000 / NEARNESS_FACTOR); -10000 not working. pls, thanks

dr-jts commented 1 year ago

Use OffsetCurve to compute offset curves. OffsetCurveBuilder is now intended to be only for internal use.

CodeK1988 commented 1 year ago

@dr-jts bro, OffsetCurve not support set direction? when i set distance value = -XXXX, i see the method inside used Math.abs, so how should i do? thanks!

dr-jts commented 1 year ago

OffsetCurve uses the sign of the offset distance to indicate whether the offset is constructed on the left or the right side of the input.

CodeK1988 commented 1 year ago

OffsetCurve getCurve distance positive value 100 working, value 3000 not working, you can try it

dr-jts commented 1 year ago

You'll have to provide input data and perhaps a code snippet that demonstrates this.