Divide a path into an odd number of equally sized paths

Post questions on how to use or achieve an effect in Inkscape.
Ailurus
Posts: 115
Joined: Fri Oct 22, 2010 9:53 am
Location: The Netherlands
Contact:

Divide a path into an odd number of equally sized paths

Postby Ailurus » Thu May 10, 2012 1:11 am

Is it possible to divide a path into an odd number of equally sized paths? Say, you just added a straight line (using the Bézier tool). And then you would like to divide it into 3 or 5 equal parts. What ways are there to accomplish this?

Dividing a path into an even number of paths is simple, just select all the nodes and choose "Insert New Nodes".

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

Re: Divide a path into an odd number of equally sized paths

Postby Uktrunie » Thu May 10, 2012 11:56 am

This is the easier way I can think of. It's not very efficient and I think there should be some other way that I don't know about. But...

1) Draw a, say, vertical line with the :tool_pen:. Tall enough to "cut" your path with it (hold Ctrl to keep it straight).
2) Go to the Align and distribute dialog and select "align right edges of objects to the left edge of the anchor". The idea is that your cutting line will be "glued" to your path from the left (or right).
2) Draw another line and do the same, choosing to align to the right edge this time.
3) Now you have two lines on both sides of the shape you want to "slice". Create some more lines and place them between the first two.
4) Select all the lines and go to the Align and Distribute dialog and select "distribute centers equidistantly horizontally" (or vertically depending on your drawing).

Image

5) Now you have a bunch of lines all evenly spaced on top of your shape. And now the part that's not so efficient.
6) Select the second right-most line and your shape and do a Path > Cut Path. You end up with the shape sliced in two, but it is an open path. And that's the problem, you'll have to go and edit both parts with :tool_node: and close it by selecting both nodes on the open end and do a "Join selected end nodes with a new segment". Remember, you have to do this for both your left part and your right part, otherwise when you do a Path > Cut with the next line, it's not going to work.

Image

That's the "simplest" approach I came with... yes. :cry:

Hope it helps.

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: Divide a path into an odd number of equally sized paths

Postby chriswww » Thu May 10, 2012 1:20 pm

not sure i understand fully...but would it work to go the other way, as in create tiled clones to build up a "broken line" of desired number of segments, instead of trying to cut up a long line into segments?

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Divide a path into an odd number of equally sized paths

Postby Xav » Thu May 10, 2012 8:53 pm

How about dividing into an even number that is one greater than the number of odd segments you need, then deleting the last (or first) node. Finally use the transform handles to scale the whole path to the length that you wanted. This approach should work for the case of dividing a straight line, but probably won't be much use if your requirement is for a more general solution for complex paths.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Divide a path into an odd number of equally sized paths

Postby druban » Thu May 10, 2012 10:46 pm

This solution might well be too much work, and also perhaps not what the original poster wanted to accomplish anyway!


bitmap.png
bitmap.png (235.19 KiB) Viewed 5641 times
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Divide a path into an odd number of equally sized paths

Postby ~suv » Fri May 11, 2012 12:14 am

Ailurus wrote:Is it possible to divide a path into an odd number of equally sized paths? Say, you just added a straight line (using the Bézier tool). And then you would like to divide it into 3 or 5 equal parts. What ways are there to accomplish this?

Dividing a path into an even number of paths is simple, just select all the nodes and choose "Insert New Nodes".

For straight lines (one straight segment, only two nodes), you could use this extension:
  • Extensions > Modify Path > Add Nodes … > Division method: [x] By number of segments
and then select all nodes in the node tool, break the path at selected nodes, and finally break the path apart (Path > Break Apart)?

Ailurus
Posts: 115
Joined: Fri Oct 22, 2010 9:53 am
Location: The Netherlands
Contact:

Re: Divide a path into an odd number of equally sized paths

Postby Ailurus » Fri May 11, 2012 2:10 am

Wow, thanks for the nice solutions everyone. Much appreciated :)


Return to “Help with using Inkscape”