spakin / SimpInkScr

Simple Inkscape Scripting
https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting
GNU General Public License v3.0
320 stars 31 forks source link

Question: Is there a way to scale selection in only one axis? #56

Closed Nickiel12 closed 1 year ago

Nickiel12 commented 1 year ago

I have a project where I am trying to convert 2d art, into something that can be applied to a 3d shape. What I am trying to do, is take a measurement of, say a box, and say that "when looking at it from straight on, and the box tilted, there is a viewable 5 inches on this side, but it is a 7 inch side." and make the artwork account for that extra length.

But what I am looking for, is there a function that I can take a selection, then distort it? Basically I want to take a square of the original artwork (say, 3x2) and scale it out in only 1 direction (to 3x6).

I want to be able to cut this in vinyl repeatably, which is why I can't use a projector and paint.

spakin commented 1 year ago

The scale method (see https://github.com/spakin/SimpInkScr/wiki/Modifying-existing-objects) accepts a tuple for its first argument, which lets you scale an object non-uniformly:

for obj in selected_shapes():
    obj.scale((1, 3), 'c', True)

Does that answer your question?

Nickiel12 commented 1 year ago

It does! Thank you!