Skip navigation
Currently Being Moderated

Divide a line into equal sections

Aug 26, 2009 8:35 AM

I haven't been able to find anything on this. Please point me to a link if I missed it somewhere. How can I divide a line into equal segments in Illustrator? This is computer software, right? Shouldn't a computer be able to figure how to segment an arbitrary line? I tried turning the line into a sliced object and dividing that, but it didn't seem to work. Pathfinder only works on two or more objects. What have I missed? Am I just being really dense? (don't answer that)

 

Ideas?

 
Replies
  • Currently Being Moderated
    Aug 26, 2009 9:21 AM   in reply to noldo9

    noldo,

     

    Presuming you are talking about an arbitrary subdivision of a straight line, you may:

     

    1) Select the target line and set the Reference Point in the Transform palette to a suitable border and write down the X or Y value;

    2) Click the Rectangular Grid Tool, set the height/width to the same value as shown in the Transform palette, and set the  horizontal or vertical division to the number of subdivision minus one;

    3) Insert the X or Y value from 1);

    4) Ungroup the grid;

    5) With the Scissors Tool cut at the corners of the outer frame of the grid and delete the lines not crossing your target line;

    6) Select both target line and gridlines and Pathfinder>Trim and reset the stroke;

    7) Delete the cut parts of gridlines.

     

    That should give you an equal division of the target line into short lines. If you want it as one line with equidistant Anchor Points, you may DirectSelect the coinciding end points and Ctrl/Cmd+J to rejoin them.

     

    Not just a click with a tool.

     

    As I am sure you know, you may halve any path repeatedly with Object>Path>Add Anchor Points.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 9:45 AM   in reply to noldo9

    Are you talking about a standalone line segment? How do you want the divided segments arranged?

     

    If the answers are 'yes' and 'I don't care,' I would simply append '/n' (without the quotation marks) to the W or H field in the control or transform panel/palette, where n equals the number of segments into which you want the line divided. Hit Enter to apply the transformation. Then, simply copy and paste n-1 times.

     

    Make sure the constrain proportion link between the W and H fields is activated if the line segment is not perfectly vertical or horizontal.

     

    Oh... and make sure you've turned off 'Scale Strokes & Effects' if you want to maintain stroke weight.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 9:37 AM   in reply to Jacob Bugge

    It all depends on whether the path is straight or not and what you call "equal" sections. Equal along a vertical, horizontal or angled axis, or equal along the path.

    Object>Path>Add Anchor Points will only halve straight paths. If you're working with curves it will give you unequal results depending on the length of vector handles.

     

    If you want to divide a curve into equal sections it becomes a bit complicated. Dashed strokes with carefully adjusted increments might get you part of the way. But as soon as you expand a dashed stroke its thickness comes into play.

     

    Using Pathfinder on this kind of thing will certainly divide your path into horizontally equal sections, but the steeper the slope of the curve the longer the sections along the line. Please try to define your problem better.

    divisions.jpg

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 10:11 AM   in reply to steve fairbairn

    Oh, you guys and your thinking....

     

    I would just use the script here:  http://park12.wakwak.com/~shp/lc/et/en_aics_script.html#divide

     

    (lotsa good scripts there - none of them mine.)

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 11:13 AM   in reply to noldo9
    Have you tried any of those scripts with AICS4/Mac?

     

    I can't vouch for AI 14 (CS4), but I can tell you that this particular script works fine on AI 12 (CS2) Mac. This usually bodes well for CS4. Just to make sure, use the .jsx version, which Hiroyuki now includes in his downloadable. (Look for the 'jsx_lf.zip' file within the downloaded .zip file.)

     

    Note that his script creates evenly spaced anchor points along a line or curve segment. You will have to use the scissors tool to separate the segments, if that's what you want.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 11:30 AM   in reply to noldo9

    When discussing "technique" with Illustrator, there's at least 101 different ways to draw whatever. In this particular case, Harron's described method of dividing a straight line into equal segments is also my method of choice. The only thing I'd like to add is, that to retain the original position of the line, regardless if it's horizontal, vertical, or angulated, is the Reference Point that you select. Eddie

     

    Horizontal Line     Draw line. Notice that the Reference Point is at 9 o'clock position.

    Step 01.jpg

    Horizontal Line     With line selected, divide by number of segments that you want. In this case, seven.

    Step 02.jpg

    Horizontal Line     Click "Enter".

    Step 03.jpg

    Horizontal Line     Final result after stringing together multiples.

    Step 04.jpg

    Angled Line     Notice that the Reference Point is at 11 o'clock position.

    Angled Line 01.jpg

    Angled Line     Either the W or H may be divided, it does not make a difference.

    Angled Line 02.jpg

    Angled Line     Final result after stringing together multiples.

    Angled Final.jpg

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 12:00 PM   in reply to noldo9

    Those scripts are all working great for me on CS3 on 10.4, so I imagine they should work on CS4.  It's not going to start any fires or anything like that so it can't hurt to try. ;-)

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 5:33 PM   in reply to noldo9

    Noldo, you still haven't answered the questions of those who are trying to help you. Are you talking about a single straight segment (like a path drawn with the Line Tool) or not?

     

    If so, just invoke Filter>Distort>ZigZag. (I'm not using CS4. In that, it would be an Effect.)

     

    Size: 0

    Ridges Per Segment: as desired

    Points: Corner

     

    JET

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 7:23 PM   in reply to JETalmage

    As an addendum to James's post, because it is an effect in CS4, you'll have to expand appearance as a last step.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 26, 2009 8:55 PM   in reply to noldo9

    The zig-zag tool does not give you a zig-zag as long as you set the 'size' to zero (as James said)

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2009 6:29 AM   in reply to JETalmage

    James, thank you. I like your method better.

     

    Eddie

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2009 1:28 PM   in reply to JETalmage

    Very clever, James... as always.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2009 7:17 PM   in reply to Harron K. Appleman

    The same principle applies to curved paths, so long as you are talking about adding equidistant points per segment. The added points are equidistant (for practical purposes) along the segment, as you can verify by copying individual segments, pasting them, and then checking the length of each in the Document Info Palette.

     

     

    You can also verify it by applying the Filter to two ellipses that have the same major diameter but different minor diameters. Note that corresponding points do not align vertically between the two ellipses.

     

     

    This is useful in equidistant segmenting of segments (but not for equal divisions of whole paths with multiple and unequal segments).

     

    Add Points, on the other hand, does abide by the curvature. So, the corresponding points do align vertically. This is important for example, when you need to find radial angles of an ellipse as when you need an elliptical protractor to use in construction of an illustration. It's also useful for plotting positions for frame-by-frame "orbit" animations, because the orbiting object then "speeds up" as it approaches the minor diameter, and "slows down" as it approaches the major diameter, which is more convincing of a uniform orbital motion.

     

     

    Unfortunately, Illustrator's rather lame Add Anchor Points command doesn’t provide an option for how many points to add per segment. It only adds points to bisect segments. You have to apply it repeatedly. That rules out odd-numbers of new segments. (Another example of how an Illustrator feature falls far short of completion, compared to other programs.)

     

    So how do you, for example, find the 12 hour posiitions of a circle? You need 2 added points per original segment. Add Anchor Points can’t, but Zig-Zag Filter can. Note that the hour points of a circle, of course, demark each 15 degrees. Certainly a useful increment.

     

     

     

    But what about our elliptical protractor? Certainly, for example, an isometric protractor with tick marks every, say, 10 degrees would be a very useful thing. That would require 8 added points per segment. Add Anchor Points can’t do that. Zig-Zag Filter can, but the points would be equidistant--not suitable for use as an elliptical protractor. What to do?

     

    Use Zig-Zag Filter on a circle...

     

     

    ...then scale the circle vertically by 58% (sine of the isometric angle, 35’16”).

     

     

     

    Such machinations can be the keys to building isometric elliptical and spherical protractors (and dimetric and trimetric protractors, for that matter)--essential tools for correct construction of simple and compound rotations about the drawing axes.

     

     

    (Now try to tell me that the various features (and unintuitive workarounds) involved above couldn't and shouldn't be integrated into a single, more discoverable tool.)

     

    JET

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 17, 2012 10:47 AM   in reply to JETalmage

    JETaImage,

     

    I'm trying to use your ZigZag Size=0 method to equally subdivide a curved path in CS5.5, but the change to "Effects" vs "Filters" doesn't seem to actually add anchor points and subdivide the path.  Am I missing a step?

     

    Thanks,

     

        - Aron

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 17, 2012 1:14 PM   in reply to AronAnderson

    Us Object>Expand Appearance to convert to an object which can be manipulated directly.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points