Author Topic: Aligning objects to a path  (Read 3130 times)

April 27, 2017, 06:22:07 PM
Read 3130 times

Hygelac

  • Sr. Newbie

  • Offline
  • **

  • 2
Hi.

I've got a diagram containing some lines (mostly straight, but with a few curved lines here and there), with other objects dotted along the length of each line. Few of them are centred on the lines, and it looks quite messy. What I would like to do is to move each of the "other" objects slightly so that its centre is on top of the path of the nearest line (I could select the line and points if needed, though).

Is there a way to do this with Inkscape without moving each object manually? I've had a look around, but "align and distribute" (say) doesn't seem to have an option for this.

Thanks.

April 27, 2017, 07:57:50 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Could you give us a quick illustration?  I can't quite get a mental picture by your description.  There's probably a way to do it, but 'move object on top of path' could be a lot of different things.

It sounds a little bit like a flow chart, but I'm not sure....
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

April 28, 2017, 04:53:38 PM
Reply #2

Hygelac

  • Sr. Newbie

  • Offline
  • **

  • 2
Welcome to the forum!

Could you give us a quick illustration?  I can't quite get a mental picture by your description.  There's probably a way to do it, but 'move object on top of path' could be a lot of different things.

It sounds a little bit like a flow chart, but I'm not sure....
Thanks.

That depends on how you draw a flow chart, I suppose. I've attached an image of the sort of line I'm working with, though.
I can't actually see how the image appears on this forum, so I hope it comes out okay.

April 29, 2017, 04:37:47 AM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
If the line is perfectly horizontal or vertical, the Align and Distribute dialog can help.  You could make the "dots" lined up perfectly at some random place on the canvas.  But having them centered on the line would take an extra step.  For that, I would suggest Snapping  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Snapping.html  You will want to set it up so that you snap object centers (or rotation center, which is the same thing, for a circle) to paths.  Select all the "dots" at the same time and they will move at the same time.  So you just have to move them once.

But let me ask you this.  Will the "dots" be evenly spaced along the line?  It is possible to do that, but I'll hold off on explaining until I know for sure, because there may be more than one way to do it.

If the lines will be curved, A/D won't help.  Snapping would work, but you'd have to snap each object, one at a time.

Are all the "dots" or whatever kind of objects, are they all the same object?  If they're all the same object....or at least the same object for each line, you can do it by making the object into a Marker.  Object menu > Object to Marker.  Note that the object will disappear when you do this.  So if you want to keep a copy, be sure to duplicate it.

Markers can be automatically placed one on each node along the path.  So you would make sure you have nodes at the right places, and then go to Object menu > Fill and Stroke > Stroke Style tab and notice 3 little dropdown menus for beginning marker, ending marker, and everything in between markers.

Your custom marker will be the one at the top of the menu.  I don't know why they changed this, or exactly what they changed it to.....  They used to be given a random, 4-digit number, that you would see in the menu.  But now....I can't really figure out what it is, but whatever you see at the top, click that, to apply the markers.

This is one of the ways I mentioned, if you want the objects evenly spaced.  It's hard to make the nodes evenly spaced on a curved line, but there is a way.  It's really easy if the line is straight.

Hopefully some of that will help.  But if there are more parameters, let us know  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann