Inkscape Community

Skills, Challenges & Artwork => Tips and Tricks => Topic started by: ian on September 07, 2015, 04:30:22 AM

Title: Basic Stretch Tip
Post by: ian on September 07, 2015, 04:30:22 AM
A simple one this. But nevertheless interesting.

The interactive handles allow you to change the vertical height and horizontal width of an object.
However if you rotate the object through, say, 45 degrees, the handles stay vertical/horizontal. You can no longer change the object in the same dimension as before you rotated it.

The solution for parametric shapes, like ellipse and rectangle is to use the "Node editor" :node:. Pull the ellipse or rectangle handles. The objects are changed based on their original definition.

This does not work for free path objects. As there is no "original" direction. You have to rotate it so the stretch direction is the same as the vertical or horizontals handles before stretching it.

Maybe someone can suggest an easy way to stretch and object in a given direction.
Title: Re: Basic Stretch Tip
Post by: brynn on September 07, 2015, 08:46:24 AM
Ooh, look at that!  That is a good tip!  If anyone had asked, I would have said they'd have to Undo or rotate the object back, to change the size.

And welcome to Inkscape Community, btw :D

When you say, "...suggest an easy way to stretch and object in a given direction." I guess you mean a way to do the same thing, with path objects?

Here's a screenshot to show what I would do -- well, this is for a rectangle.  I would use a guide and rotate the guide, snapping it along on side of the rectangle.  Then selecting only those 2 nodes, it can be edited without Undo-ing or un-rotating, by keeping 1 node snapping to the guide.

 [ You are not allowed to view attachments ]

I'll have to ponder the case of an ellipse.....this should work for an ellipse, depending on exactly what you wanted to change/edit....except you would place the guide through the center of the ellipse.  But I'm not sure how to make the same change on one end of the ellipse, that you make to the other end.....

 [ You are not allowed to view attachments ]

I guess you could use a couple more guides, and some careful measurements.  Then you could snap the nodes on either end of the ellipse to the intersection of guides.

Maybe Lazur (or someone else) has a better idea?
Title: Re: Basic Stretch Tip
Post by: Lazur on September 08, 2015, 03:48:35 AM
Once there are two nodes defining an axis -snap a guide line to it as described above,
snap a horizontal guide line, and the rotational center of the object to one of those nodes, and rotate the object until it snaps with the other node on the horizontal guide line.
Then you can scale the width of the object's bounding box.

For reverting the rotation, rotate as previously and snap to the first guide line.



A less accurate solution would be double clicking the guide line over the axis, copying the rotation value,
and using the transformation panel (Shift+Ctrl+M) to rotate with pasted values in the right direction (3 digits limit).
Title: Re: Basic Stretch Tip
Post by: brynn on September 08, 2015, 10:59:58 AM
I don't quite follow, Lazur.  What does the horizontal guide snap to?
Title: Re: Basic Stretch Tip
Post by: Lazur on September 08, 2015, 11:50:51 AM
There are two nodes defining the axis.
Pull one guide line and snap it to one of them.
Hold Shift to rotate guide line until it snaps to the other node.

Move rotation center to guide line origin/"first" node,
snap a horizontal guide line to it as well.

Rotate object until the other node snaps to that second guide line.


Scale object horizontally WHILE HOLDING SHIFT,
then rotate it back to the original direction -until the right node snaps.

 [ You are not allowed to view attachments ]
Title: Re: Basic Stretch Tip
Post by: brynn on September 08, 2015, 01:38:00 PM
Oh, I understand now.   Thanks.
Title: Re: Basic Stretch Tip
Post by: ian on September 09, 2015, 06:12:00 AM
Thanks.
I've used the unrotate/re-rotate method before. I was hoping there was a simpler way. As I use that in CAD software.
Title: Re: Basic Stretch Tip
Post by: brynn on September 09, 2015, 07:22:33 AM
Aaah yes, a LOT of people wish for more CAD-like features for Inkscape.  I know  I've seen feature requests for it in the bug tracker, and lot of messages in various forums.  If you wanted to take the time for a thorough search at Launchpad  https://launchpad.net/inkscape, you could identify the reports/feature requests which seem to hold the most promise for you.  Then if you click "Does this affect you too" link, it adds "weight" to the request.

Theoretically, bugs or feature requests with a lot of support would attract the attention of developers who might want to do the programming.  However, in practice, it often comes down to whatever programmers find interesting.  Indeed, I recently was complaining about a new feature in 0.91 (and I'm by far not the only one complaining) and it turns out that feature was added on the request of 1 person.  Someone came along who wanted to try their hand at programming Inkscape, and that apparently was an easy thing to do, and he did it.  :@@:   :@@:  I hope it will be either reversed, or offered as an option, so people who don't like it don't have to use it.

Well, the system isn't perfect, but I do know CAD like features have been much requested.

Anyway, fwiw  :)
Title: Re: Basic Stretch Tip
Post by: Lazur on September 09, 2015, 03:40:02 PM
As always, there are some hacks.
By grouping objects, you can end up with a new object without transformation.

Likewise, group the object, scale it,
group it again, rotate it.
Theoretically this way you can enter the group and change the parametres for the scaling in the group inside -with the xml editor, Shift+Ctrl+X.
However it may not be the best idea to use preserved instead of optimized transformations if you work with strokes etc.
Also inkscape tends to use transformation matrix for all kind of transformations.

For another level of "hacking", if you can put # mark to the rotation in the codes of the file, making it a comment, you can disable it temporarily, then remove that character and it will apply.
Theoretically again, haven't tested. Guessing the xml editor won't let doing so itself, a text editor would be necessary.
Then it is more handy if you need to rotate only few times in a file, with a certain value.


But the bounding box size will always display the actual horizontal/vertical measures, meaning you can't effectively resize by typing in values to those boxes.
You can work with transparent rectangles as reference objects, maybe?

In my experience it's still faster to construct manually though.
Title: Re: Basic Stretch Tip
Post by: ian on September 11, 2015, 04:17:41 AM
Yes, I'll un-rotate it for now. I avoid the horrible XML editor. I'd really like a proper object manager.

a LOT of people wish for more CAD-like features for Inkscape.
I don't really need CAD features in Inkscape. Perhaps trimming and breaking curves would make it more productive. But this request, dynamic stretching in a chosen direction, is more appropriate to illustration programs like Inkscape.

My work, incidentally, is implementing dynamic Inkscape-like features in 3D CAD software. Allowing designers to stretch and bend their models as easy as a 2D system.
Title: Re: Basic Stretch Tip
Post by: brynn on September 11, 2015, 06:14:07 AM
It definitely would be a nice feature!

I think an object manager may not be too far away.  I can't remember what gives me that impression....just a small comment I saw somewhere, that someone might be working on it.  Or I might have seen it on the Roadmap (http://wiki.inkscape.org/wiki/index.php/Roadmap)?
Title: Re: Basic Stretch Tip
Post by: ian on September 11, 2015, 07:02:05 AM
Thanks. Object manager is way down the list.
I'd like to contribute to the programme but I think they only need programmers.
Title: Re: Basic Stretch Tip
Post by: brynn on September 11, 2015, 08:09:25 AM
  :fyi:  There are some ways to help without coding:

https://inkscape.org/en/contribute/

https://inkscape.org/en/contribute/to-do-list/
Title: Re: Basic Stretch Tip
Post by: brynn on September 14, 2015, 12:45:28 PM
Ah-HA!

I just noticed yet another new feature request for an object manager, in the bug tracker.  The reply indicates that there's a new object manager already in the current dev version  :hd:

https://bugs.launchpad.net/inkscape/+bug/1492606
Title: Re: Basic Stretch Tip
Post by: Espermachine on January 07, 2016, 08:04:51 AM
I used to work around this problem by cloning the original.
So i work with the clone to rotate, etc, and manipulate the original when i need to change height/width.

OP's tip of using the node tool is even better !