Jump to content

 
Photo

How to get this effect in Illustrator?

- - - - -

  • Please log in to reply
13 replies to this topic

#1
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,805 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I'm trying to create a linestyle in Illustrator for roads under construction (and tunnels). I want to show this through a dashed line casing, like this:

Attached File  Screen_shot_2011_05_25_at_10.16.11.png   11.37KB   106 downloads

I'd like to use this on somewhat more complex line groupings (e.g. a new subdivision, rather than individual streets scattered across the map)

There is the Offset Path effect in the Appearance panel, but this is far from ideal:
- It will treat each path individually, making the crossroads look ugly. This can be circumvented by creating a compound path, but anything more complex than 2 straight lines at an almost right angle to eachother is prone to misinterpretation by Illustrator, yielding unusable results.
- The effect is called Offset Path, but really what it does is buffering the path, so the "ends" of the street get drawn in as well. That can be overcome by expanding the appearance and editing out the unwanted bits, but that's a lot of work given the number of new streets I need to add to my map.

Any suggestions are more than welcome.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#2
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 203 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

One thing you can try:

- draw the lines
- expand the strokes
- use the Pathfinder 'merge' tool to merge all the shapes
- set the fill to white
- set the stroke to dashed

This seems to give good results, even for complex linework.
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#3
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,805 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

One thing you can try:

- draw the lines
- expand the strokes
- use the Pathfinder 'merge' tool to merge all the shapes
- set the fill to white
- set the stroke to dashed

This seems to give good results, even for complex linework.


Thanks, this certainly does seem to work better than applying an effect to compound paths. The ends of the lines are still capped off though.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#4
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 203 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

The ends of the lines are still capped off though.


Yes, and at the moment I don't see an easy way around that.
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#5
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 203 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

Wait a moment...

Try this:

- draw your lines as dashed strokes, say width = 20, color = black
- copy
- paste in front
- set line width = 16
- set stroke color to white

There are faint lines remaining at the end. You could probably deal with them by lengthening the white paths a bit.
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#6
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,805 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Wait a moment...

Try this:

- draw your lines as dashed strokes, say width = 20, color = black
- copy
- paste in front
- set line width = 16
- set stroke color to white

There are faint lines remaining at the end. You could probably deal with them by lengthening the white paths a bit.


But then the white covers the stuff on the lower layers that I want to be visible :)
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#7
Matthew Hampton

Matthew Hampton

    Hall of Fame

  • Moderator
  • PipPipPipPipPipPipPip
  • 1,282 posts
  • Gender:Male
  • Location:Portland, Oregon
  • Interests:Playing in the mountains and rivers.
  • United States

How about you follow the steps Michael mentioned, but first make a copy of the linework (and make sure your working copy has a Butt Cap before outlining). For your last step, place your copy of the linework on top - set the stroke to white and give it a Projecting Cap. This removes the faint lines at the end - but after re-reading your last post I think you're still going to obscure elements below.

fyi - "butt cap" is the official term from Adobe - I didn't make it up. ;)

Oregon Metro - Portland, OR
www.oregonmetro.gov


#8
jamierob

jamierob

    Contributor

  • Validated Member
  • PipPip
  • 15 posts
  • Gender:Male
  • Location:Missoula, MT
  • United States

I saw an interesting technique on a recent 'Friday's with Mordy' episode concerning transparency in Illustrator. Might not be perfect, but seems to get pretty close.

-draw dashed strokes
-in the appearance panel add a stroke: thinner, white, not dashed, and set the opacity to 0.
- select all paths and make a compound path.
- with the compound path selected, open the transparency panel and set the "knockout group' option. You'll have to click it twice, once to null (or something) and then to 'on', with a check in the box.

This knocks out the white (transparent) stroke on top of the black dashed stroke and will allow you to move, modify the paths and the intersections will remain clean.

Hope that helps! I thought it was an interesting method.

Attached File  roads_knockout.jpg   78.96KB   50 downloads

#9
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 203 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

But then the white covers the stuff on the lower layers that I want to be visible :)


Ok... You can expand all the paths and use the Pathfinder 'minus front' tool to subtract the white paths from the black paths.
What remains is the dashed outline. (You may have to merge the paths or to convert to compound paths before applying the subtraction.)
Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#10
mlbostwick

mlbostwick

    Contributor

  • Validated Member
  • PipPip
  • 37 posts
  • Location:Sussex, New Brunswick
  • Canada

Is this what you are looking for?

I have the road on two layers.

Bottom layer: 100% Black, Overprint Stroke, 1.45pt width, dash pattern
Top layer: 1% Black, Overprint Stroke, 0.75pt width, no dash pattern

Both layers of roads use a Butt Cap and a Round Join

As you can see, any of the layers underneath show through.

Attached Files



#11
Fran├žois Goulet

Fran├žois Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 679 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

I may have missed it, but why not use a opacity mask? Use a very thick dashed black line symbol and use all the lines with butt cap and thinner stroke as a opacity mask but only on your dashed line layer.

I will not automatically give you a stroke at each intersection (like in your example), but at least it will let you see what's behind your lines.

Attached Files

  • Attached File  mask.jpg   328.33KB   43 downloads


#12
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,805 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Is this what you are looking for?


Looks like it, thanks. I've tried it on a smaller test map and it seems to work okay. I've always been weary of overprint, finding it cumbersome to set up.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#13
Pete

Pete

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 151 posts
  • Gender:Male
  • Location:Inverness
  • United Kingdom

One thing not covered so far is in your original example the coners are all covered by a part of the dash to you're never left with a white space over a corner or at a join.

If you make yourself a pattern brush in Illustrator you can specify that the corners (and endpoints if you like) are always stroked ... or stricken, striked, struck?

I had a quick stab at this with a 1cm x 1cm black square. I made a copy of the square 1 cm away from the original and used this to make the main stroked line. Drag the two shapes into the brush palette and, when prompted, elect to make a new pattern brush. Once the brush is established, select one of the squares, hold down Alt on the keyboard and drag it into the first space on the brush to nominated it as an outside corner, then do the same thing again but drag the square into the fourth space on the brush to make it an inside corner.

Attached File  manic_brush_scribble.gif   118.77KB   54 downloads

Once you've got you're dotted brush you can set about eliminating the centre part of it whichever way you prefer. The quickest way I know is to copy and paste infront like Arid Ocean explained but to group your strokes together and change the blending more to multiply - that way the white disappears and you can see what's underneath. The only trouble with that method is that if your base line is any other colour than black it won't work very well.

I must admit I've probably used nearly every method described above although I am very partial to opacity masks!

#14
Adam Wilbert

Adam Wilbert

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 271 posts
  • Gender:Male
  • Location:Bellingham, WA, USA
  • United States

I saw an interesting technique on a recent 'Friday's with Mordy' episode concerning transparency in Illustrator. Might not be perfect, but seems to get pretty close....



This technique also works well for single paths without even needing to group them. Since a line with a complex appearance (ie, multiple strokes on the same line) is really a "group" on it's own, you can apply "Knockout Group" at the path level without the need to actually put it into a group. But the tricky bit is when you have roads with different widths & colors that need to merge cleanly at an intersection. I'm still on the hunt for a easy way to do that.

With any of the techniques here that involve transparency, knockouts, or blend modes, keep in mind that this might trigger some level of raserization or transparency flattening depending on how you're printing / exporting your artwork. Just something to watch out for at final output.

Adam Wilbert
CartoGaia.com & AdamWilbert.com
Lynda.com author of "Up and Running with ArcGIS"





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->