1

I'm looking a way or tool to divide a spline or path in equal parts, or, what is the same, equidistant points (anchors).

This is a very common question, but i haven't found an answer. Also, is pretty simple to do by a script, but there's none. Is possible that i haven't searched well, but i'll be glad if someone knows the solution to this.

Autocad has a command (DIVIDE) to do what i ask:

http://goo.gl/swh2uj

http://goo.gl/ymfUK3

Thanks!

3
  • Hi and wellcome to GD.SE
    – joojaa
    Feb 9, 2015 at 7:45
  • 1
    If you really have performance problems with existing techniques you should describe what you have tried so we dont waste answering with things you already know.
    – joojaa
    Feb 9, 2015 at 17:33
  • "Also, is pretty simple to do by a script, but there's none."...hmm...do you mean it is pretty simple to "run" a script if there was one? or it is pretty simple to write a script to divide the segments? Feb 16, 2015 at 22:37

3 Answers 3

4

Hiroyuki Sato has a script called divide that does just this. It works on one segment. In fact its quite hard to do this over many segments without having extra points (the requirement of x segments and original shape is are often mutually exclusive).

You can also do this manually (this would work even over multi segment curves):

  1. first read the length of the path form document info palette (see here). *
  2. then draw a straight line that's this length divided by the number of spans you need. (alt click when using line tool) *
  3. Copy n times the spans after each other (move one with copy and hit ctrl + d)
  4. make an art bursh out of the segments
  5. apply to curve and expand

Alternatively you can do this with curve dashing.

multi line curve split 3 ways

Image 1: A multi point curve split 3 ways by equal length manually using described method.

* you can also do this without measuring by using the stretch to length option but its not always as accurate.

Addendum

Mr Sato has some other script that do the same thing on his guithub page. The break dashes script can easily be modified to do this.

5
  • I know this two options, but: 1. Hiroyuki's script doesn't split the full length (start-end points), it divides each segment (anchor-anchor) in X parts. 2. The segmented brush is a recursive technique, but is not a fast and practical way to do it several times. Anyway, thanks for your quick answer. Feb 9, 2015 at 17:11
  • @alejorojas2k then script the technique I described (i just tested it and did 200 paths to 2 to 12 segments, in just under a second how fast do you need). Beggars can not be choosers. In any case those are the real options.
    – joojaa
    Feb 9, 2015 at 17:18
  • I appreciate your concern in solve this, but none of both is a solution to my need. I know well Sato's scripts. I you have 3 or more points spline, the script just add new ones between every segment. On the other hand, the brush technique just "paint" the curve in equal parts, but if you expand it, you'll get an anchor mess instead the X equidistant points. Feb 10, 2015 at 18:15
  • @alejorojas2k You can not get x equidistant points otherwise it ceases to be the same curve. You can however progressively split the curve. But this is not easy to script efficiently because illustrator scripting layer has no facility to address the underlying curve. So you need to do like Sato and implement the underlying bezier calc yourself. This is slow. Its faster in illustrator API but plugins are MUCH harder to deploy. Anyway it takes about 6 hours too fix the dashes script for your purpose. You really need to fix your question, it is wasting time on this until you do. Target is unknown
    – joojaa
    Feb 10, 2015 at 18:28
  • Fantastic! I really thank you!!! Anna
    – user162400
    Apr 8, 2021 at 15:51
0

Also see the Object > Path > Add Anchor Points command.

1
  • This does not create eqidistant points in all cases. But also it wont work with even number of points
    – joojaa
    Apr 8, 2022 at 22:24
-3

To divide any path to any equal segments:

1- draw a short vertical line

2- with that vertical line create a pattern brush

3- select a copy of the path u want to divide

4- apply the pattern brush u created

5- open that pattern brush option

6- make sure preview is ticked, and stretch to fit is ticked

7- in the spacing option keep increasing the space

until the line have divided the path into the number of segment desired.

8- done!

1
  • Totally misses the point of the question
    – xenoid
    Sep 13, 2017 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.