Change the SegmentShape2D of Area2D in runtime

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DavidPeterWorks

Dear Colleagues,

I want to change the length of SegmentShape2D shape in Godot 3.1.
What is the best practice to change the properties of a shapes in runtime?

It does not work:

var area2d = find_node(d)
var segment_shape2d  = area2d.shape_owner_get_shape(0,0)
segment_shape2d.a = Vector2(0, newValue1)
segment_shape2d.b = Vector2(0, newValue2)

Thank you,
David