EmbroidePy / pyembroidery

pyembroidery library for reading and writing a variety of embroidery formats.
MIT License
181 stars 33 forks source link

How can I get dimensions of the design? #122

Closed eduardobdamacena closed 1 year ago

eduardobdamacena commented 3 years ago

Someone can help me with a sample to get design dimensions (width and height)?

samsal commented 3 years ago
bounds = [float(e) / 10.0 for e in pattern.bounds()]  # convert to mm.
width = bounds[2] - bounds[0]
height = bounds[3] - bounds[1]

from: https://github.com/EmbroidePy/EmbroidePy/blob/a6614f90223ad351530c5a87525a573b237172bb/embroidepy/statisticsview.py#L47