rotate elliptical radial gradient preserving handle length?

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

rotate elliptical radial gradient preserving handle length?

Postby brynn » Fri Jul 30, 2010 6:46 am

Hi Friends,
I know there must be a way to do this, but I can't find it in manual. I have an elliptical radial gradient and I want to rotate it so that the length of the ellipse lies diagonally. So I want the length of the gradient handles to remain the same while I rotate it.

I thought of rotating the whole object, but it's a rectangle, so it won't work to rotate the whole thing. I've also tried the keyboard shortcuts that are used with node handles, as if the gradient handles behaved like node handles. But only the Ctrl has any effect. I will be able to use it to achieve a 45 degree angle, but I still can't find a way to keep the handle lengths static.

The only thing I can think of is to make the rectangle much bigger, then rotate it, and then clip with the original size and orientation of rectangle. Oh, or....fill an ellipse with a radial gradient, remove the stroke and rotate, then clip with rectangle. I guess there's not much difference.
Or IS there a way to rotate while preserving elliptical dimensions? Or does anyone know of a trick besides my clipping ideas?

Thanks for your help :D

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: rotate elliptical radial gradient preserving handle length?

Postby prkos » Fri Jul 30, 2010 9:21 am

Why won't it work if you rotate the rectangle? Just make sure the move gradients option is enabled on Selector toolbar. Or did I misinterpret? Maybe you first need to disable it, rotate the rectangle then enable it and rotate again.

You can see the available keyboard shortcuts when hovering over the gradient handles, but neither one keeps the handles the same length.
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: rotate elliptical radial gradient preserving handle length?

Postby brynn » Fri Jul 30, 2010 9:56 am

Why won't it work if you rotate the rectangle?

Because the rectangle is the base, background, and outline of the image. If I rotate it, then my image is a lopsided diamond!

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: rotate elliptical radial gradient preserving handle leng

Postby druban » Fri Jul 30, 2010 11:07 am

hi Brynn! I see your problem. here's a temporary solution. (A Better solution might be to alter the gradient definition in the xml.)

Step 1. Creating the rectangle with a rad grad.
Step 2. Pulling down a guide and snapping it to the center of the rectangle.
Step 3.UNCHECK the toolbar transform gradients with objects option. Rotate the rectangle and snap the corner to the guide.
Step 4. This is the result - gradient runs along diagonal now.
Step 5. CHECK the transform gradients option and rotate the rectangle back to where it was. Now your gradient is rotated! (A nice feature request might be - transform gradient handles with nodetool shortcuts).
P.S. Although the picture doesn't show it , if you want it to go back exactly to its original position you might want to create another vertical or horizontal guide snapped to the outside of the rectangle (anywhere) in step 2
Last edited by druban on Sun Jul 10, 2011 5:16 am, edited 1 time in total.
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: rotate elliptical radial gradient preserving handle length?

Postby ~suv » Fri Jul 30, 2010 1:05 pm

Did you try to rotate the gradient with shortcuts using the gradient tool? (untested because '[', ']' don't work with my keyboard layout):
  1. select rectangle
  2. g (switch to gradient tool),
  3. Ctrl-A (select all stops&handles),
  4. [ or ] (rotate by the angle step)

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: rotate elliptical radial gradient preserving handle length?

Postby druban » Fri Jul 30, 2010 8:52 pm

~suv wrote:Did you try to rotate the gradient with shortcuts using the gradient tool? (untested because '[', ']' don't work with my keyboard layout):
  1. select rectangle
  2. g (switch to gradient tool),
  3. Ctrl-A (select all stops&handles),
  4. [ or ] (rotate by the angle step)


hi ~suv. when I tried to do this neither node nor gradient tool allowed me to select more than one gradient node and the rotate shortcuts did not work on the gradient.
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: rotate elliptical radial gradient preserving handle length?

Postby ~suv » Sat Jul 31, 2010 1:53 am

druban wrote:neither node nor gradient tool allowed me to select more than one gradient node (…)
Not? In the gradient tool g I can select an arbitrary number of gradient stops and handles by either 'Shift-click'ing them or 'Shift-drag'ging a window selection and I can select all handles + stops with the keyboard shortcut 'CtrlA' .

In the node tool n this of course only works with 'Shift-click'ing individual gradent handles/stops as the other selection methods work on the selected path.
druban wrote:(…) the rotate shortcuts did not work on the gradient.
Ok, thanks for testing (I read about them working in the gradient tool, but apparently that comment in the bug tracker was incorrect).

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: rotate elliptical radial gradient preserving handle length?

Postby ~suv » Sat Jul 31, 2010 2:01 am

druban wrote:Step 3.UNCHECK the toolbar transform gradients with objects option. Rotate the rectangle and snap the corner to the guide.

Note that this (snap node to guide when rotating an object) only works in Inkscape 0.48+devel snapshot builds and will not be part of the feature set of Inkscape 0.48.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: rotate elliptical radial gradient preserving handle length?

Postby druban » Sat Jul 31, 2010 11:46 am

[quote="~suv"]Not? In the gradient tool g I can select an arbitrary number of gradient stops and handles by either 'Shift-click'ing them or 'Shift-drag'ging a window selection and I can select all handles + stops with the keyboard shortcut 'CtrlA' .

Indeed. I was incorrectly dragging with the gradient tool without shift with the wrong results...

Sorry to hear about the rotate snap. Seems that it would be just as easy to leave it in once it's working, but then they must have a greater plan...
Your mind is what you think it is.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: rotate elliptical radial gradient preserving handle length?

Postby brynn » Sun Aug 01, 2010 7:26 am

Wow, nice discussion while I was sweating away at the laundromat! (I hate laundry day :evil: )
Thanks druban and ~suv for your time and effort spent trying to solve this problem. Your comments were all very helpful, and lead me to solving the problem. Here's what I did:
-- Click 'Move gradient along with object' button (which I normally keep engaged all the time).
-- Rotate rectangle 45 degrees, using Transform dialog.
-- Unclick same button.
-- Rotate back (-45 degrees).
-- Done!

Since I normally keep that button engaged all the time, I forgot it was even there. But it's the perfect solution for this.
Thanks again :D

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: rotate elliptical radial gradient preserving handle length?

Postby druban » Sun Aug 01, 2010 6:53 pm

brynn wrote: -- Rotate rectangle 45 degrees, using Transform dialog.
-- Unclick same button.
-- Rotate back (-45 degrees).


:ugeek: Hmm. This rectangle sounds a lot like a square! :ugeek:

well i'm glad it worked out. :D
Your mind is what you think it is.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: rotate elliptical radial gradient preserving handle length?

Postby brynn » Mon Aug 02, 2010 7:33 am

Yes, it's close to being square. Why? It sounds like......oh.....you're thinking for a longer, narrower rectangle, 45 degrees would not be right....right? Yes, I see what I mean :lol: :lol: Well, the general technique I think is sound. It's just that the angle of rotation would be different, depending on the dimensions of the ellipse. And that makes this technique not conducive to a smooth workflow. While yours and ~suv's ideas using snapping, guides, etc., would be more efficient - if all the features were available in a stable release, and/or functioned as you/we thought.

When you first commented that a new feature request might be in order, I thought, well maybe. But now that we've put so many minds together, and still not come up with a smooth, accurate process, I'm thinking new features for rotating gradients could be a valuable addition. Should we continue a discussion about that here, or should I start a new topic in the Ideas forum?

Thanks again for all your help, I really appreciate it :D


Return to “Help with using Inkscape”