Inkscape Community

Skills, Challenges & Artwork => Tips and Tricks => Topic started by: brynn on December 28, 2015, 07:13:09 PM

Title: move objects radially
Post by: brynn on December 28, 2015, 07:13:09 PM
Hi Friends,
I was a bit stymied with this problem, when I first decided to post here, and ask for ideas how to accomplish it.  Now I think I have a couple of thoughts.  But it still is an interesting problem, and maybe you all can share how you would do it.  I'm sure others could benefit as well  :)

So you can see, hopefully, that the outer rays of this star are separate from the inner center.  It's because the inner part of the star will be under something like a wagon wheel, and the outer rays will appear to go through the spokes of the wheel, so they will look like they are on top of the outer circle of the wheel.

 [ You are not allowed to view attachments ]

If it was the other way around (inner part on top, outer part goes under), I could hide the broken ends under the outer circle of the wheel.  But in this case, I'll need to overlap the outer pieces slightly, to obscure that pesky anti-aliasing gap.  So I need to move those 6 objects radially inward, by the same distance.  Very small distance....and probably no one would ever notice if I just "eyeballed it".

But what if it was something like the example below, where those blue circles need to be moved inward (or outward), along the rays of the star, by an equal amount?

 [ You are not allowed to view attachments ]

If it were nodes that need to be moved radially, of course I'd use the transform handles option.  But I can't think of a way to move whole objects like this.

What I'll probably do, is draw a circle centered at the center of the star, and I'll snap the ray pieces to where the circle intersects the guides (which aren't showing in the screenshots, but which lie a long the rays of the star).

Does anyone know if there's a way to move these objects inward, at the same time, similar to if we used the transform handles and moved the nodes?  I don't think there is, but maybe my brain's lapsed.... 

Seems like it would be a nice feature....  Because think about this.  Let's say you have a circle of....well anything.  A circle of circles or a circle of triangles, like below, and you want to enlarge the circle without changing the size of the little circles or the little triangles.

 [ You are not allowed to view attachments ]

If you made the circle of circles with tiled clones, then you just change the center of rotation, and make another array.  But what if that's not how you made it?  Or what if it's not a circle, but an ellipse?  What if it's a rectangle?  I don't know, it just seems like it would be nice to be able to do this.  I wonder if LPE could do that?

Thanks for comments  :)
Title: Re: move objects radially
Post by: brynn on December 28, 2015, 07:35:27 PM
Hhmm....  Maybe if I scale the rays slightly larger....then I could drag nodes with transform handles....  Not very precise....but worth a try.
Title: Re: move objects radially
Post by: Lazur on December 29, 2015, 03:56:42 AM
If the bounding box of the repeating parts to be repositioned has it centre exactly at the right position -centre of the star- then a possible workaround is by using the transformation panel.

Like select them all, scale down them 80% in both direction with the "apply to each objects separately" untoggled, then scale them back 125% with that box toggled in.
Not an exact solution, you can only use it to move by % a value and not by a certain distance.
If you don't use a specific percentage you may end up with a bit altered sized circles (the difference is probably not visible though).

And most importantly, it all needs the bounding box of all circles selected to have a right centre.
What if the star has 7 spoke?
You would need a spacer object involved too, and probably need to find where is the centre of the star.
Title: Re: move objects radially
Post by: brynn on December 29, 2015, 05:27:02 AM
Hhmm....  Yes, the bounding box center is the same as the star center.  But either I didn't do it right, or it doesn't quite work.

If I use 150% instead of 125, it's pretty close.  But then it looks like the center of the bounding box of the 6 pieces isn't precisely the same as the star.

I'll try snapping the bounding box rotation center to the star center of object, and not the star rotation center.....
Title: Re: move objects radially
Post by: Lazur on December 29, 2015, 05:33:15 AM
It works here without adjusting bounding box (rotation) centers.
Title: Re: move objects radially
Post by: brynn on December 29, 2015, 05:53:50 AM
Oh....I think I either misunderstood, or I did it wrong.  Because it makes the rays too long.  It makes them the right width, and the right proportion of green part and gold part.  But it makes them stretch to the center of the star -- and I need them just a few pixels moved.

Works better with circles though.  Still scales the circles, but also moves them!
Title: Re: move objects radially
Post by: Lazur on December 29, 2015, 07:44:17 PM
Just realized from a comment of Moini that there is a new polar coordinate tab in the arrange panel, that could solve this problem with whatever parameters.

(Note to self I really should check the new features.)
Title: Re: move objects radially
Post by: brynn on December 31, 2015, 02:30:48 PM
Thanks for the info, Lazur!

Unfortunately, there is no info on the Arrange dialog in the manual.  When I played with the options in Arrange dialog, here's what happens.  Starting with the 6 circles here

 [ You are not allowed to view attachments ]

I end up with this

 [ You are not allowed to view attachments ]

And just for anyone else who happens to be following this -- it doesn't work to select a circular path.  It only works with a Circle shape.

At this point, I'm guessing I need to rotate the circle by....it's probably going to be either 30° or 60°.

Will update soon  :)
Title: Re: move objects radially
Post by: brynn on December 31, 2015, 02:33:55 PM
Oh yes, that worked!   

 [ You are not allowed to view attachments ]

To be honest, I think it would be easier to have a live sort of movement like this (whether it's called radial or polar, I'm not sure what's exactly correct).  But this is certainly better than nothing!    :D
Title: Re: move objects radially
Post by: brynn on January 02, 2016, 04:55:44 PM
Well it works with circles, but for any other object, it doesn't work.  For some reason, it rotates the objects.

See this "before".  I just want to move those 6....I have no idea what to call them.  But I want to move them so that the 2 points of each one are touching the circle....or at least so the points point to the circle (or even the center of the circle), even if they don't touch.

 [ You are not allowed to view attachments ]

But this is the result of using the Arrange dialog with Polar Coordinates tab.  It moves them in the right direction, but it rotates them.  There's a checkbox for rotate, but it's not checked.  If I check it, they get rotated even more.

 [ You are not allowed to view attachments ]

Does anyone have any idea what's wrong?  Likely I just don't understand this feature....although at the moment, seems like a bug.
Title: Re: move objects radially
Post by: Lazur on January 03, 2016, 07:12:05 AM
It does seem to work here with random shapes with the rotation untoggled. Any chance you are working with groups/multiple transformations?


(If you use clones you wouldn't need the arrange at all? For such hexagonal images, this (https://openclipart.org/detail/206156/snowflake-generator) may work?)


Edit: maybe this (http://www.inkscapeforum.com/viewtopic.php?f=5&t=20804#p77701) is related too.
Title: Re: move objects radially
Post by: brynn on January 03, 2016, 06:30:09 PM
No, it won't work with groups.  Or, well it does, but it treats the group like a single object and arranges just the 1 object.

I'm not sure what you mean by "multiple transformations".....although there's that long-standing bug (which someone is working on, btw....might already be fixed in dev version).  (I can't find that bug, which probably means it's been fixed -- YAY!!)   Anyway, let me check if I was working on layer 1 or other.  And I'll test in a new layer, to avoid that bug.

Right, it can be done with radially tiled clones (I think I already mentioned that).
Title: Re: move objects radially
Post by: brynn on January 03, 2016, 06:40:38 PM
Hhmm, no that was not happening on layer 1.  I guess I'll report this on the mailing list.

Edit
Found the bug through my email notifications:  https://bugs.launchpad.net/inkscape/+bug/299362  Parts of it have been fixed and commited, and 1 issue still in progress.
Title: Re: move objects radially
Post by: Lazur on January 03, 2016, 10:35:10 PM
Multiple transformations as in like a group of a shape on layer 1 and then the page resized to an object on layer 2.
Then to render the rectangle-object there could be three transformation matrixes to be processed.

Possible reason why "they get rotated even more".
I guess if you start it over you would get the predictable results.


Edit: made a banal example that reproduces related problems.
Title: Re: move objects radially
Post by: Espermachine on January 06, 2016, 07:25:38 AM
Why no use tiled clones for the effect ?
If you have 'Move according to transform' ticked in the Preferences - Clones, it will exactly do what OP wants.

But i agree, a new feature for that transform would be nice. I know i needed it a few times in the past.
Title: Re: move objects radially
Post by: brynn on January 07, 2016, 02:22:17 AM
Yes, I know it can be done with tiled clones.  The reason I didn't use it is because those 6 shapes are the result of several path operations on objects created with the Star/Polygon tool.  They were "born" already in a circle.  So I did not place them in/on a circle.

For an update on Arrange feature -- it really is not the right tool for this.  It can be done, but it's quite complicated.  Thanks to Xav on the Inkscape User mailing list for the solution.  But I won't go into it here, because it just really isn't the right tool for this.

I'm pondering making a feature request for moving objects in a radial direction.  I mentioned about such a feature in the thread in the mailing list, but no one responded to the comments (which I made at least twice) which makes me wonder if such a tool or feature would be very hard to create.  But maybe some time in the future I'll have enough "nerve" to make an official request.  (I've got enough requests already reported.... :-$)
Title: Re: move objects radially
Post by: styxlawyer on January 07, 2016, 02:38:02 AM
Well it works with circles, but for any other object, it doesn't work.  For some reason, it rotates the objects.
.
.

I suspect it's not working for circles either. You wouldn't be able to tell if it's rotating them.
Title: Re: move objects radially
Post by: brynn on January 07, 2016, 05:18:08 AM
Yeah, that's why it seemed to be working for circles, because I didn't realize they were being rotated   :uhoh:
Title: Re: move objects radially
Post by: Espermachine on January 07, 2016, 07:58:12 AM
I'm pondering making a feature request for moving objects in a radial direction.
Please do !