Inkscape.org
Beginners' Questions place multiple different shapes (from a group) around a circle (and angled correctly)
  1. #1
    persianninja persianninja @persianninja

    Hey all,

    1st post here. I had a question... I was trying to figure out how to get this pattern of different shaped objects to wrap around a circle (and angled correctly)...  I was messing with making a circle and then choose 'Pattern Along Path' effect to it, or messing with 'Generate from Path' but that didnt seem to work.

    I ended up doing it very manually... Forget exactly how I did this.. Maybe manually by putting a line in the middle of a circle and rotating it manually via Rotate tool and placing the object where the line is touching the circle... then rotating the individual object to match what the rotation should be at that point as well.

    or I used 'Create Tiles Clones' to make a bunch of lines at appropriate angles, and did same general step where i attached each indiv object in my group to each line with snap feature (then rotated it as well to match what it should be at that point.

    Either way, its manual work... is there a better way to do this?
    Check out my svg to see the pattern I have that I wanted to go around a circle (its about 88 objects so almost 4degrees per object).

    I have the manual 'final' image I'm trying to create also in the same file below it.

    Thanks all!,
    Ari

    PS this 1st answer in stackoverflow below was the best thing I could find on internet... but those 'Pattern Along Path'/'Generate from Path' tools didn't work for me (if it works for you, let me know how u did it :)... they also suggest snapping to a #-sided shape ... but that'll be again manual for 88 objects).
    The 2nd answer in stackoverflow seems too manual for 88 objects.

    https://graphicdesign.stackexchange.com/questions/103921/how-to-place-a-set-of-object-following-a-path-in-inkscape

    Example Ring
  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    Presuming all the different objects can be placed with their centers at even spacing along the circle, manually is not a heavy chore if the Transforms dialog is used.

    While the objects are placed at 0 degrees on the circle,  the rotation center of the objects can be placed at the circle's center and a rotation transform can be applied to an object at 4.0909  degrees. Repeat 2x for the next, 3x for the next, etc.

     

  3. #3
    persianninja persianninja @persianninja

    I thought it would be fun to try to create an Inkscape extension that does this... 
    I got a UI box up that collects args and now seeing if I can do some simple code to move my selected object...


    Below seems to be depreciated code:

            selectedObject = self.svg.selected[self.options.ids[0]]        
            x = selectedObject.attrib["x"] 
            #^^^ errors here, assume Inkscape 1.0 code would look different?
            newX = float(x) + self.options.myXarg
            selectedObject.attrib["x"] = str(newX)

    Any resources on how to do this? I was checking a few plugins and didnt see how to do this.

    Thanks!,
    Ari

  4. #4
    Tyler Durden Tyler Durden @TylerDurden
    👍

    I'm not a coder, but I'd look at existing extensions like Generate from path>Scatter (which duplicates objects along a path) and Arrange>Restack (which alters z-order of selected objects), to see the code.

    For more knowledgeable insights, I'd post a new topic on the specific issue of creating the extension here:https://inkscape.org/forums/extensions/

  5. #5
    earthling75 earthling75 @earthling75

    I've got a similar problem. I'm trying to wrap some equations that have been rendered from LaTeX using Tex Text Extension around a circle and another curve that runs through the center like a yin-yang. The online resources all suggest to use path effects, Pattern Along Path, but that doesn't do anything at all. Text, Put on Path doesn't work either. Is there some kind of conflict between Tex Text and the other extensions or am I doing something fundamentally wrong?

    unfinished design

    Sample trying to recreate

     

    Capture Crop
    Tattoo 800X800
  6. #6
    Tyler Durden Tyler Durden @TylerDurden

    Each portion (upper, lower, center) must be a single path (I'd use combine).  Any vinculum that is a single open stroke, must be made into a closed path and combined into the path as well.

    800X800 Td
  7. #7
    inklinea inklinea @inklinea⛰️
    *

    The easiest way I have found to do this in Inkscape is by using clones / rotate by angle step.

    1. Make a circle with the diameter that you want, and convert to path.

    2. Turn on all snapping

    3. Snap - 'Bounding box midpoint' to 'Bounding box side midpoint' of the circle.

    4. Snap the 'Object rotation centre' to the 'Object midpoint' of the circle.

    5. Rapidly alternate between 'Alt+d' then ']' until the circle is filled.

    Only takes a minute to do and has the added benefit that the original shape can be edited and all the clones on the ring will change too :)

    The default angle step for the ] key is set with Preferences>Steps>Rotation snaps every (dropdown box) degrees

    Ringclones
  8. #8
    persianninja persianninja @persianninja

    Hey @inklinea For me, that won't work I think since I have a preset pattern of different objects.

    I am making a plugin to do what I want for now (well its a good python learning experience). I'll prob put an other post in the Extensions/Plugins section soon.

  9. #9
    inklinea inklinea @inklinea⛰️
    *

    Sorry didn't read the original post properly.

    You could write a new extension, but what is the problem with pattern along path, with a bit of spacing adjustment ? 

    I've put it on a randomly sized bigger circle. 

    [edit ]

    Ahh, are you using extensions>Generate from Path>Pattern along along path --- instead of Path>Path Effects>Pattern along path ? 

    Example Ring2
  10. #10
    persianninja persianninja @persianninja
    *

    Hey @inklinea I tried both and none worked for me.

    Can you give the exact instructions on how to use the tool?

    1. I created a circle and selected it
    2. Then made the circle into a path with Path->Object to Path.
    3. Then I selected and copied my 'grouped' object (which has the 88 oval+circle objects next to each other)
    4. Then I selected the circle path, I went into the Path Effects dialog and choose the 'Pattern Along Path' effect.
    5. Then I chose the 'Paste Path' option in the Pattern Source area so the group of mult objects can be fed as the source to repeat along the path

    but then it just looks like this attached file...
    I must be doing something wrong.
     

    2021 01 02 02 12 03  Example Ring.Svg   Inkscape
  11. #11
    inklinea inklinea @inklinea⛰️
    👍

    I don't think this tools works with groups. Your shapes in the pattern are simple - so I used Path>Combine on all of the objects.

    This of course will not let you use objects with different strokes or fills :(

    Then make the circle and converted to path, then added the pattern to path  path effect.

    I clicked the combined path and Ctrl+C to put it in the clipboard, then clicked the circle and chose the far right icon - link to path in clipboard and repeated from the drop down.

  12. #12
    persianninja persianninja @persianninja
    *

    Great, I was able to replicate what you made. Kinda cool to know how to use this tool.

    I prob will still make a plugin to try this for fun and preserve the strokes/fills if they are different ...
    I think my basic code looks pretty good so far... its just X and Y coordinate's don't seem accurate and not sure why so kinda stopped until I figure that out.

            for elem_list_item in elem_list:            
                #inkex.utils.debug(i)
                bbox = elem_list_item.bounding_box() # money maker
                x, y = bbox.center # grab center   


    My document's units are def in pixels (I changed it from the default mm), but the x,y coordinates returned by python seem off.
    i'll prob put another post in the Plugins area to ask a few things about python like above.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions place multiple different shapes (from a group) around a circle (and angled correctly)