Skip to content

Scale around center; knowing where to move; getting coordinates, bounding boxes of paths, extracting svg path element's d attribute #126

@qubodup

Description

@qubodup

Hi! I'm happy:
smile

But I want to be HaPpIeErRrR… With a bigger smile! (1.25x as big) kind of like this:
Inkscape screenshot

So I do this:

import svgutils.transform as sg

fig = sg.fromfile('smile.svg')
mouth = fig.find_id('path1069')
mouth.scale(1.25)
fig.save('smile-scale.svg')

But…
smile-scale

Now that I have your attention, I actually was able to get to a solution https://stackoverflow.com/questions/76889502/ but was wondering if I was missing options from svgutils that could have helped. In particular extracting the d attribute or calculating the bounding box of a path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions