Thanks Sebastien for the quick reply.
Yes, I want to do a 2D polyline to make the task easier for the users, but the objects are in 3D, so I tried to place the polyline in a plane. I tried to get the polyline widget states by using:
const widget = vtk.Widgets.Widgets3D.vtkPolyLineWidget.newInstance();
.....
widget.getWidgetState();
And the only close variable I found there is
widget.getWidgetState().getBounds();
Do I miss something? How should I get all points’ positions? Thanks in advance!