path-rite

reroundPathWithArcs

Round corners with true SVG arc commands instead of bezier approximations.

reroundPathWithArcs(svgPath: string, radius: number, inset: boolean): string

svgPath — SVG path d-attribute string.

radius — Corner radius in SVG units.

inset — When true, creates inward rounded corners (like CSS border-radius). When false, creates beveled corners.

Returns — A new SVG path string using arc (A) commands for exact circular corners.

// Round corners with true arcs, inset style
const rounded = pathRite.reroundPathWithArcs(
  "M 0 0 L 100 0 L 100 100 L 0 100 Z", 10, true
);