summaryrefslogtreecommitdiff
path: root/embroider_simulate.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-01-04 21:05:53 -0500
committerLex Neva <github.com@lexneva.name>2018-01-04 21:05:53 -0500
commit7190d98dd4268147207cdc828eff910abdcb125d (patch)
treedc0db0f3c45385e22ca31ff79213aacca9d61b54 /embroider_simulate.py
parentd4c84a0fdb02b2deb8ec49cedfed4a641ae19eb4 (diff)
parse and use viewBox attribute
The viewBox effectively adds global scaling and translation to all shapes in the SVG. Borrowing from inkscape-silhouette, we construct a transform from the viewBox and apply it to all objects. When adding the stitch plan into the SVG, we need to compensate for this implied transformation, which we do by adding its inverse as a transform on the stitch plan polylines. All of this allows us to do away with the nonstandard 10 pixels per mm that was previously hardcoded into inkstitch. Old designs can add a viewBox to switch from 10 pixels per mm to the standard 96 ppi that Inkscape uses.
Diffstat (limited to 'embroider_simulate.py')
0 files changed, 0 insertions, 0 deletions