Inkscape.org
Beginners' Questions Setting objects along a path
  1. #1
    Rob K Rob K @robadfc47e3bc80440e

    I am having trouble getting a shape to follow a path. I am trying to create a line array of speakers. I start with a trapezoid

    If I create a path and then do path effect - pattern along path, I can come close to what I desire. But notice how the individual shapes get skewed.

     

    Is it possible to take an array of shapes and have them follow path without changing the original shapes?

    I have tried interpolation and several other methods from various instructional tutorials I have found on the web, but no dice.

     

     

  2. #2
    Polygon Polygon @Polygon🌶

    The extension->Generate from Path->Scatter might be the better choice. Seems borked on macOS though can´t show it working.

  3. #3
    Hum Hum @Hum
    *

    Hi. As PixelPest shared, Scatter may he your best bet. It is not supposed to distort your original object, as Pattern Along Path may do. You will have to play with the spacing option. See screen captures and svg file helow.

    I am using Windows 10 and here, version 92.4. This should work with any Inkscape version, however.

    Kw Scatter Examples
    101
    102
    103
  4. #4
    Rob K Rob K @robadfc47e3bc80440e

    Using Windows 10

    Traceback (most recent call last):
      File "pathscatter.py", line 248, in <module>
        PathScatter().run()
      File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
        self.save_raw(self.effect())
      File "pathscatter.py", line 190, in effect
        mat[1][2] += self.options.noffset
    TypeError: 'tuple' object does not support item assignment

  5. #5
    Rob K Rob K @robadfc47e3bc80440e

    The above error can be traced to selecting the "pattern is vertical" option. Easy enough to fix - just rotate the original object.

    But now, when I go to "Apply" I get the following, so it appears to be borked on Windows too? This happens quite often with extensions on my machine to the point that I rarely, if ever use them.

     

  6. #6
    Polygon Polygon @Polygon🌶

    Welcome to my world.To support is partially a real challenge or even no longer possible. 🙄

  7. #7
    Rob K Rob K @robadfc47e3bc80440e

    PixelPest - not sure if this will help you, but it may apply

    From: https://www.youtube.com/watch?v=_UZTNMehg0Q

    Down below in the comments:

    Note to Mac users, if the link to path on clipboard does not work, go to Xquartz app, Preferences->Pasteboard Uncheck option: Update Pasteboard when CLIPBOARD CHANGES

  8. #8
    Polygon Polygon @Polygon🌶
    *

    OMG - this advice seems ancient. I´m not using XQuartz since ca 2014 (this native version compiled by ∼suv was so far the best Inkscape experience for me - unfortunately it´s no longer compatible with the M1 SOC Mac) . Thanks for the tip though.

    The clipboard issue don´t apply to the "scatter" extension afaik, because you need to select pattern+path at once while Pattern along path accept clipboard copies.

  9. #9
    Rob K Rob K @robadfc47e3bc80440e

    Yikes! So there are issues getting inkscape to run on M1?

    I have been digging pretty deep to find an answer :) Grasping at straws might be more appropriate!

    If I were trying to do this in another program, AI or ?, wondering if I might have better luck

  10. #10
    Polygon Polygon @Polygon🌶

    Well - Yes -  it starts - but I avoid the term "run". It´s so slow that it´s hard to be productive under these conditions.

    I guess the only alternative (costly) app might be AI which I can´t (and not willing to) check.

    As much as I like Nick´s tutorials this one about the chain is questionable because it seems he never checked out the real thing. ;-)

    I have pretty much all SVG editors for Mac at hand - but nothing beats Inkscape regarding range of functions.

  11. #11
    Hum Hum @Hum
    *

    Rob K, can you share here the svg file that you are using now with your original object and path within it?

  12. #12
    Rob K Rob K @robadfc47e3bc80440e
    *

    Sharing - but not sure (or can't seem to find) where the original "closest" example is. Worse yet, I can't seem to recreate.

    Currently, I have a fallback for the end product - BizCards.svg.

    I would like to recreate the curve very similar to https://gearsource.com/wp-content/uploads/2021/02/Electrovoice-X-Line-Advance.png

    My thwarted attempts are in 210520_WIP.svg

     

     

  13. #13
    Hum Hum @Hum
    *

    Rob, I did see not see any svg in your attachment, so I used the image you linked to.

    I attempted to use the  Scatter extension but it did not yield the results I desired. I reverted back to using Pattern Along Path. Please see the screen captures I share and the svg file. I truly hope this moves you towards your goal, or at the least, as a springboard for something better.

     

    Kw Process 001
    Idea Scatter
    Idea 1
    Idea 2
  14. #14
    Rob K Rob K @robadfc47e3bc80440e

    Not sure why my svg's are not uploading or displaying correctly. But I sure do appreciate your guidance. Thank you for your help

  15. #15
    Tyler Durden Tyler Durden @TylerDurden

    I was able to download the previously attached files without issue. 

  16. #16
    Hum Hum @Hum

    Glad to help. Maybe you can make a series of shapes like a 3d empty box based upon some idea I shared previously. Hang in there and have a great week and weekend.

  17. #17
    Rob K Rob K @robadfc47e3bc80440e
    *

    Another attempt at showcasing my attempts. It seems to be cropping the file  image to the width of the comment box

     

    **Update: FYI the attached files are getting cropped on PC but not on MAC. At least on my machines

  18. #18
    Hum Hum @Hum
    *

    Hi, Rob. I saw in your svg file that hoth the speaker object and the desired paths are groups ... even though each has a single object. Suggestion - ungroup both and then try Scatter

    Also, check the field titled Duplicate the pattern before deformation. You might need to increase your spacing as well. See the graphic.

    Try This
  19. #19
    Tyler Durden Tyler Durden @TylerDurden

    Maybe this...

  20. #20
    Aero Aero @Aero◻️

    AFAIK, scatter has been broken since Inkscape version 1.0. Still broken in 1.1rc1. I'm using Windows 10.

  21. #21
    Rob K Rob K @robadfc47e3bc80440e

    Ken - thanks for pointing that out, but I think that is a remnant of where I did the actual work and I grouped it to move those sections in an attempt to make the work more presentable. But I also tried grouped and ungrouped to see the effects of what the tool would do. I, for better or worse, have tried several combinations of settings that I didn't document.


    Following Tyler's suggestion, as soon as I checkoff  live preview,  I receive:

    Traceback (most recent call last):
      File "pathscatter.py", line 248, in <module>
        PathScatter().run()
      File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
        self.save_raw(self.effect())
      File "pathscatter.py", line 190, in effect
        mat[1][2] += self.options.noffset
    TypeError: 'tuple' object does not support item assignment

    So I wonder if this may be something with my OS (windows 10 pro), my inkscape version (1.0.2-2) or my python (v3.9.5) setup?

    Might just have to do this the old fashioned manual way :) Just wanted it to work because it is pretty cool. What would be even cooler is having the tool work as expected, but also be able to edit the path after running the extension so that I could change path as desired, post-scatter :)

    Thanks for all the suggestions everyone. Y'all have been great!

     

  22. #22
    Tyler Durden Tyler Durden @TylerDurden

    I'm running 0.92.5, so that explains why my version works.

    It seems to be fixed, but it  not released yet:  https://gitlab.com/inkscape/extensions/-/commit/9a6252c72eff328809c466523398805ded4df333 

  23. #23
    Hum Hum @Hum
    *

    For those who may care, in my last post, I used version 0.92.4. And aside from skipping the step of Reversing the object (or just redrawing it in a different orientation), version 0.92.4 seems to work well - using the Scatter extension. What may or may not happened after that version, I do not know.

    Does any one know if Scatter is "fixed" (working correctly) in the upcoming 1.1 version?

  24. #24
    Polygon Polygon @Polygon🌶

    After switching to an M1 Mac, as all my Intel Macs have died the heat death, I can no longer downgrade.

  25. #25
    Rob K Rob K @robadfc47e3bc80440e

    I tried the same things on my macbook pro running big sur 11.2.3, inkscape 1.0.2 and python 2.7.16. Same errors, same offsets - roughly the same everything

  26. #26
    Polygon Polygon @Polygon🌶

    You´ll need to go down to 0.92 I guess. I can dig a download to a native Mac version from 2015 which was a relieve. 

  27. #27
    kurtzilla kurtzilla @kurtzilla
    *

    Hey all - quick update.

    The issues I was having previously appear to be fixed in the latest inkscape version (v1.1).

    The only issue I have now is the orientation of my original shape needs to be flipped 180deg to get my desired result. Reversing the path does not seem to make a difference. However, this is a pretty minor issue for my use case and not hard at all to workaround.

    *** the images are in reverse order of the steps I took

    Array4
    Array3
    Array2
    Array1