Inkscape.org
Beyond the Basics Placing interpolated objects on a path
  1. #1
    K K @fugueink

    I am using Inkscape for Mac 1.3 (0e150ed, 2023-07-21) on a MacBook Pro from 2013 running macOS 10.15.7 (Catalina).

     

    I am trying to place a series of interpolated circles along a path.

     

     

     

    I want the pink circles along the curve, evenly spaced as shown in the sketch underneath the drawing.

     

    I have tried doing a circular distribution with the curve as an arc. I have tried distributing them along a path with the Distribute along Path extension. I can't figure how to do it with the LPE.

     

    Any suggestions?

     

    Thank you!

  2. #2
    David248 David248 @David248
    *

    Maybe you can use  this topic and this related topic.

     

  3. #3
    K K @fugueink
    *

    Looks very promising, but I am having a few problems . . .

     

    How on earth do I do bezier curves with a trackpad? What I generally do is create a bunch of straight line segments and then go back and curve them, but I'd like to get that nice perfect Spiro curve and I cannot seem to do that.

     

    Also, how do I get them spaced correctly? What I am getting is this:

     

     

    Even assuming I get the path to curve, that doesn't look like the correct spacing to me. . . .

     

    Thanks!

     

    ON EDIT:  Well, I now have a Spiro curve. I am not sure how I achieved it. I am not sure which of the modifier keys I tried gave me the result. (My apologies. My brain is not what it once was.)

     

    But I am still having the spacing problem. Whether "Equidistant spacing" is checked or unchecked, I get the same result (which is the same as the above picture).

     

    I tried editing on canvas, but that doesn't allow for repositioning the interpolated circles.

     

    I hope someone has some suggestions. . . .

     

    Thank you!

  4. #4
    K K @fugueink

    Okay, I've kept working. . . .

     

    I created blue circles over the interpolated ones—each circle being a separate path—and then Distributed them with Even horizontal spaces. Then I combined them into one path.

     

     

     

     

    Probably not the most elegant solution, but I've now got my set of circles.

     

    I'm having a hard time getting them along my Spiro path (green arc). Theoretically, it seems that should be the easy part, since the arc and the horizontal line are exactly the same length. But I am having a difficult time getting it to remotely work. Things keep disappearing.

     

    I'll keep at it, but if anyone has any enlightenment to share, I would be most grateful!

     

    Thank you!

  5. #5
    Polygon Polygon @Polygon🌶

    I'd try a curvy Bézier Path instead or convert the Spiro with Path->Object to Path before applying another Path effect.

  6. #6
    K K @fugueink
    *

    @Polygon Thanks! At least I am able to get the pattern along the path now!

     

    It also occurred to me that the endpoints of the horizontal line segment should be at the left edge of the largest circle and the right edge of the smallest (without changing the length of the line). I re-Distributed them with Even spaces after that and once again Combined them.

     

    But I cannot seem to get the right effect. If I say Single, it's actually shorter than my curve, despite the horizontal line being the same length as my curve (I did use Measure Segments to measure it):

     

    And if I use Single, Stretched, it of course deforms my circles:

     

     

    I've tried various tweaks of the Pattern Along Path LPE, but it doesn't seem to give what I'm looking for.

     

    What completely obvious thing am I missing?

     

    Thank you!

     

    YET ANOTHER EDIT:  I have also tried the Distribute along Path extension, because it is supposed to be Pattern along Path without distorting things, but I am having no luck with that either.

  7. #7
    K K @fugueink
    *

    Just for completeness, here's what I get when I use Distribute along Path:

     

    I've tried adding the circles as a group rather than a single object, but I cannot find how to get Distribute along Path to take a group. It just wants to use the first circle along the curve.

  8. #8
    K K @fugueink
    *

    Still working on this obsession . . .

     

    I found a tutorial on how to do this in Illustrator: Object > Blend > Replace Spine.

     

    Anyone know how I can do that in Inkscape?

     

    Thanks!

  9. #9
    David248 David248 @David248
    *

    Note that with illustrator, the problems might remain the same : all examples use objects with roughly the same size. Your problem is that you want the same space between your circles and not the same space between center of circles. I don't think there is such option.

    A workaround is to select green stroked path with deformed circles, boil the effect (object to path), then break apart to get 10 deformed green circles.

    Do the same with blue filled path : break it apart. Then enable snapping to objects rotation centers (untick everything else), and place each nice blue circle on the green deformed one.

     

    Screen Shot 2023 09 04 At 9.20.40 Am
  10. #10
    K K @fugueink

    I guess I'll try the second. I wish there was an easier option.

     

    And I thought this would be the easy part of my project!

     

    Thank you very much, @David248 and @Polygon!

  11. #11
    K K @fugueink
    *

    Um, that's not working, either.

     

    Even with all snapping but rotation centers off, the edges of the individual blue circles are snapping to the edges of the deformed green circles, which don't seem to have rotation centers.

     

    Sigh. . . .

  12. #12
    David248 David248 @David248

    So, the process would be, for 10 circles :

    • draw with bezier tool the spine of the leaf. Run extension > visualize path > measure path,  Measurement type : "lenght", click live preview, note the lenght.

    • draw a straight horizontal line with bezier tool with the same lenght (width doesn't matter).

    • Draw the two end circles : select both and align them on horizontal axis. Use horizontal line to align left edge of big circle to the left edge of horizontal line, repeat for right edge with the small circle. You then have the two circles with the desired space.

    • Select both (the six of the bounding box equals the lenght measured in first step). Run extension Generate from path > Interpolate between paths. Tick duplicate endpaths and set steps to 8. This generates a group with 10 circles. You can delete the two end circles drawn before. Duplicate the group for further use.

    • Select all ten circles in this group, with align and distribute panel, click on distribute with even horizontal gaps, then do path > combine : you now have one path with visually ten circles evenly spaced.

    • Add a bend effect to this path, on path effects panel, click on Edit-on-canvas icon and use nodes and handles to set the correct aspect.

    • If circles look deformed, boil the effect (object to path), break apart and enable snapping to only centers of rotation and then place the circles of the spared group upon the deformed ones.

     

  13. #13
    David248 David248 @David248
    *

     

    fugueink

    Um, that's not working, either.

     

    Even with all snapping but rotation centers off, the edges of the individual blue circles are snapping to the edges of the deformed green circles, which don't seem to have rotation centers.

     

    Sigh. . . .

    ??? All objects have rotation centers. I've just done the process, it works for me...

    Capture D'Écran 2023 09 05 153818
    Capture D'Écran 2023 09 05 153859
  14. #14
    K K @fugueink

    No, the line of green bubbles. Each bubble does not have a rotation center for me to click the rotation center of the undeformed circle to.

     

    I'm sure the whole object has a rotation center, but that doesn't help, and I can't be sure of clicking the undeformed circles to the spine. Eyeballing (and boiling) is what I am trying to avoid.

     

    Looks like this just plain isn't doable with certainty in Inkscape.

     

    Thanks anyway.

  15. #15
    David248 David248 @David248
    fugueink

    No, the line of green bubbles. Each bubble does not have a rotation center for me to click the rotation center of the undeformed circle to.

    I'm sure the whole object has a rotation center, but that doesn't help, and I can't be sure of clicking the undeformed circles to the spine. Eyeballing (and boiling) is what I am trying to avoid.

     

    You first need to break apart (select the line of green bubbles, do path > break apart) the line of green bubbles to get individual paths : each one for each bubble. Only then each bubble will have a rotation center.

    You are nearly there !

  16. #16
    K K @fugueink
    *

    !!!

     

    It didn't work at first, but of course it needs to be Flattened for it to work.

     

     

     

     

    HUZZAH!!!

     

    Thank you so much, @David248!

     

    Now to master the finer points of the Bezier Tool, and I'll have everything I need. . . .

  17. #17
    Paddy_CAD Paddy_CAD @Paddy_CAD

    I contributed nothing here, but I feel compelled to award a gold star to David248.

  18. #18
    K K @fugueink

    It's not working again.

     

    I've done it over several times, and every time, the spaces get smaller as the circles get smaller rather than being even.

    I thought it might be that I forgot to take off the stroke around the fill before I interpolated and distributed it, but I tried that and it didn't help (in fact, that attempt is the one pictured in this post).

     

    Can anyone recognize what I did wrong? I did (unless my mind is entirely gone, which is possible) evenly space them when I distributed them.

     

    Thank you!

  19. #19
    K K @fugueink

    I completely removed my copy of Inkscape and re-installed it, and that seemed to fix the problem.

     

    Oddly, though, although all my circles in the original group—including the interpolated ones—are clean, four-node circles, the interpolated ones in this group have nodes at eight different spots, some of them duplicates. I can't figure how that happened, but it is the least of my worries!

  20. #20
    K K @fugueink

    A note to anyone trying to do this themselves:

     

    The interpolated circles, once they are evenly spaced, cannot be touching at all. I can only suppose it messes up the math. Anyway, be careful about that.

  21. #21
    K K @fugueink

    At the risk of boring everyone to tears by continuing this topic. . . .

     

    I have discovered that if the curve is very round, this method doesn't seem to work.

     

    I did it three times with one such curve, and got this:

     

     

     

    It's visually apparent that the space between the smallest two circles (the last two, in case that interests anyone) is much smaller than the two largest.


    So unless anyone has another suggestion, I'm just eyeballing these extreme cases.

     

    Just in case this information is useful to anyone!

  22. #22
    K K @fugueink

    Okay, I tried to write this up as a nice tutorial, but I cannot figure out how to place the images correctly in Libre Office, and one program to learn is more than enough right now.

     

    Follow David248's process until you have a set of circles evenly distributed along your horizontal line:

     

    • Combine the circles into one path (Path > Combine).

    • Make a duplicate of the spine curve from the very first step. Leave it on top of the first one.

    • Copy the path of evenly placed circles as a pattern along the path of the lower spine in the stack, with a Width of 1.000, check "Width in units of length," and set it to "Single" (NOT "Single, Stretched"!). You'll get something like this:

    • Go to the unaltered spine curive that is on top of the one with the pattern and put a node at the end of the pattern on the bottom one. Use snapping to make sure it's in the exact same place as the end of the pattern beneath it.

    • Use the LPE "Measure Segments" to find out how long that tail is.
    • Add that length to your horizontal line and re-distribute the circles evenly along it.

     


    • Combine the circles and paste this new pattern along either of your spines (without any other LPEs!). Don't forget to use a Width of 1.000, check "Width in units of length," and set it to "Single" (NOT "Single, Stretched").

    Go back to David248's instructions about Breaking Apart and so on.

     

    The additional length gives you a much more even result.

     

     

    I still don't think it's perfect. But it's now a little closer to it.

     

    If anyone knows how to insert images into Libre Office without mangling your text, let me know and I will write it up as a pretty tutorial!

  23. #23
    K K @fugueink
    *

    Okay, having used this method with much success (although I've switched to using "Measure Path" under Visualize Path in the Extensions menu), I have hit a wall.

     

    For reasons I do not understand, the Pattern Along Path is freaking out.

     

     

     

    The blue circles are the pattern, the green curve is a copy of orange path that has the pattern along it.

     

    I just cannot figure out why it isn't working. I've tried it Single and Single, Stretched. Yes, I need to flip the pattern horizontally, but I tried that after taking the screen capture, and it did not change things appreciably.

     

    Can anyone identify what obvious thing I am forgetting?

     

    Thank you!

  24. #24
    K K @fugueink

    It's bizarre. I deleted all of that item (spine, circles, etc.) and started over. It worked this time.

     

    It's still odd. I do wonder what was going on.

     

    Thank you!

  25. #25
    Paddy_CAD Paddy_CAD @Paddy_CAD
    *

    Stretching your shape with the select tool applies transforms resulting in unwanted pattern distortions. Use the Node tool instead to edit your shape and recalculate your pattern along the modified path.

  26. #26
    K K @fugueink

    Well . . . if I did that, it was accidental and I didn't even notice. As far as I know, I was editing the dimensions in the . . . sorry, I don't remember what you call it. The bar across the top of the window, that shows the X and Y coordinates and the width and the height. I used that to resize the circles, as I have all along; I've made more than a dozen of these series of circles now.

     

    It's entirely possible that I did it accidentally (I am having the worst trouble with 1.3's interface in combination with my antiquated MacBook), but I would've thought to cause that kind of trouble in the end, it would have been obvious sooner that I had done so. Something stretched a great deal or at an odd angle.

     

    Good thing to know, in any case, however. I may easily run up against it in the future!

     

    Thank you!

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Placing interpolated objects on a path