{
type: 'path',
d: 'M20,20h50v20A2,2,0,0,1,80,35L90,30H50V50a5,5,45,1,0-5-10l-5-10Z'
}
import { toPoints } from 'svg-points';
const data = {
type: 'path',
d: 'M20,20h50v20A2,2,0,0,1,80,35L90,30H50V50a5,5,45,1,0-5-10l-5-10Z'
}
const points = toPoints(data)
console.log(points)
[
{ x: 20, y: 20, moveTo: true },
{ x: 70, y: 20 },
{ x: 70, y: 40 },
{ curve: { type: 'arc', rx: 2, ry: 2, sweepFlag: 1 }, x: 80, y: 35 },
{ x: 90, y: 30 },
{ x: 50, y: 30 },
{ x: 50, y: 50 },
{
curve: { type: 'arc', rx: 5, ry: 5, xAxisRotation: 45, largeArcFlag: 1 },
x: 45,
y: 40
},
{ x: 40, y: 30 },
{ x: 20, y: 20 }
]