{"version":"1.0","type":"rich","title":"Convert a SVG path to a Polygon by sampling the path, but also including all control points in the result. See http://phrogz.net/SVG/convert_path_to_polygon.xhtml","description":"This example converts an SVG path into a polygon by sampling points along the path’s total length using `getTotalLength()` and `getPointAtLength()`, while also including every original control point from the path’s `pathSegList`. The code iterates through path segments, adding both sampled points and segment endpoints to a polygon element. It relies on native SVG DOM APIs, such as `SVGPathSeg` and `createElementNS`, to build the resulting polygon’s `points` attribute. The approach ensures the polygon preserves the path’s shape and all its defining vertices.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-b1de8274a558cd6f28ee1755839a0bdf?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}