Hi,
I'm having a trouble with the resulting polygon from Geometry.offset_polyline_2d not lining up with the line geometry passed to the function.
What I'm trying to achieve is creating a navigation polygon from a line that I've drawn in the editor.
This is my code:
extends Navigation2D
onready var RoadLine: Line2D = $RoadLine
onready var NavigationPoly: NavigationPolygonInstance = $NavigationPolygonInstance
#onready var DrawPolygon: Polygon2D = $Polygon2D
func _ready():
var buffered_line = Geometry.offset_polyline_2d(RoadLine.points, 10)
# DrawPolygon.polygon = buffered_line[0]
var polygon = NavigationPolygon.new()
polygon.add_outline(buffered_line[0])
polygon.make_polygons_from_outlines()
NavigationPoly.position = RoadLine.position
NavigationPoly.navpoly = polygon
print('ready')
Scene tree:

And this is the result, purple line is RoadLine
and the green polygon is NavigationPolygon
with debug option visible navigation turned on:

My expectation was the the polygon would nicely line up with the line, like running a buffer operation in a GIS program, example from PostGIS below:

Am I doing something wrong or is the function not behaving as it should? (I assume it's on my end).
Geometry.offset_polyline_2d documentation