Good evening everyone, I’m trying to use the offset_polygon
method on this polygon, but the result keeps returning as an array with [(0, 0)]. I saw someone mention in a similar issue:
“You are hitting the same ‘issue’ listed here: Geometry2D.clip_polygons() / Geometry2D.merge_polygons() returns [(0,0)] · Issue #87153 · godotengine/godot · GitHub, where casting an Array[PackedVector2Array] to a PackedVector2Array will make it [(0, 0)]”
But I couldn’t figure out how to apply that solution — or maybe it’s not actually the problem?
var _uniao = Polygon2D.new()
_uniao.name = “Uniao”
_uniao.polygon = resultado_union[0]
print(_uniao.polygon)
_uniao.polygon = Geometry2D.offset_polygon(_uniao.polygon, 20.0, 1)
_uniao.color = Color.AQUAMARINE
print(_uniao.polygon)
add_child(_uniao)
#prints [(395.1057, 269.0983), (358.7785, 380.9017), (141.2215, 380.9017), (104.8943, 269.0983), (200.0, 200.0), (250.0, 236.3271), (204.8943, 269.0983), (300.0, 200.0)]
#prints [(0.0, 0.0)]