How to get the points from Geometry?

Hi, I want to get the points from a GeometryString.
say, i have a geometry string like : F M1 0 L338 0 L338 168 L132 168 L132 126 L0 126z.
I want to get the points e.g. (1,0) (338,0) (338,168) (132,168) (132,126) (0,126).

I tried like

var x =  geometry.figures.first().segments.elt(0); for first point.

But not getting the points.
So is there any way to get the points?

For “Path” Geometrys you need to iterate over its Geometry.figures to look at eachPathFigure. Get its PathFigure.startX and PathFigure.startY values and then iterate over its PathFigure.segments to lookat each PathSegment. Depending on the type of PathSegment, get the point(s) from its properties.