Every plugin I’ve written has a story, or more specifically, experiences in using Adobe Illustrator when I’ve thought “Gee, if one could only…” and so in 1993 I wrote Concatenate to address a frequent dilemma.
If you’ve ever imported CAD files or GIS data for maps, chances are your first reaction was something like “wow, there’s a lot of detail here, it’ll save me a ton of time!” But once you started working with it you probably had some reservations, thinking “Oh no, this must be made up of a gazillion tiny pieces!”
That’s what I thought when I started working on maps like this one of the Twin Cities for an article by Steve Glischinski in the December 2003 issue of Trains magazine. The image on the left shows USGS (US Geological Survey) data imported into Adobe Illustrator via Avenza’s MAPublisher plugin. Here I had imported data for streets and highways, railroads, and inland waterbodies. It looked much more like a map once I simplified and colored it with the help of my Concatenate plugin.
As this image of small-town streets and highways here shows, GIS data is similar to imported CAD data in that it’s made up of many short paths laid end-to-end. Generally, the paths end at every point where they meet or cross another path.
By selecting one or more paths, I used Concatenate’s Assimilate function to join the paths whose endpoints were within 0.25 points apart and within 10° of tangent. By adjusting this setting, I could control which paths were concatenated, restricting it to those that formed a fairly straight line. A second pass concatenated the other side of the divided highway. Now this main road can be given a prominent style and the secondary roads made lighter and/or thinner.
As you can see in the top right image, the inland lakes were stroked and filled with blue. Most of them are already joined as closed paths with occasional cleanup, but the rivers had to be concatenated into longer paths which I then applied Illustrator’s Object > Path > Simplify function on (usually set to curved lines between 97-100% accuracy). Hiding other layers helped eliminate visual clutter as well as restricting selections to the paths I needed to work on. The many streets made the city railroad map use more memory and storage than was really needed, so I used the Concatenate plugin on that, also, again starting by concatenating lines within a few degrees of tangent, then selecting and concatenating again with slightly larger values. Finally, I simplified the paths to remove excess points so that the street grids became what they appeared to be, longer streets that simply crossed each other. This becomes especially important when creating art for digital media, since low-power phones and tablets have to draw every line if the art is left in vector format.
So, where is Concatenate for CS6 and CC now?
Concatenate is currently in beta testing and coming along nicely. I use it myself regularly at my day job, and today worked on refining the Assimilate function. It’s available to testers now and should be released soon.
In its public debut, the plugin will likely be missing the ability to record it as an Action, but I felt users who rely on it would prefer earlier access and a few free updates as I restore original features and add some new ones, as well.
You can expect versions for CS6, CC, CC 2014, CC 2015, CC 2015.3, and CC 2017, in addition to Mac OS X and Windows 32- and 64-bit versions. I’d like to thank our friends at Hot Door for providing the tools that made these newer versions possible.
All the best,
All of the main plugins are now in testing after having been completely rewritten for CS6 and CC. Some of the details are missing, but in many ways they’re already improved over the previous versions. I’d really hoped to have them finished by now, but if you don’t want to wait and are willing to report bugs and overlook some rough spots until the polish is completed, you can start using them now by becoming a beta tester.
Just send me a message that you’d like to test them, state your OS and AI version and a bit about your background with Adobe Illustrator, and I’ll get back to you. There’s still room for a few more pioneering souls in this group!
Finding duplicate paths is really fairly simple
Someday there’ll be a plugin to find and remove duplicate/redundant paths (perhaps I’ll write it, or perhaps there already is but I just don’t know about it). The most important decision in doing that, as I see it, is deciding which path is the primary one and which paths or segments are superfluous. The best way I found to identify and weed them out is to set all suspect paths’ opacity to about 40% to make overlapping paths pretty obvious. Be careful not to set the layer’s opacity instead, as that would cause all paths to become equally translucent, defeating the purpose of this exercise. In this screen capture of an imported GIS file of railroads near Trenton, New Jersey, the pale green lines farther north are single lines that show their increased density where they cross. If it were only always this easy.
The document info panel tells me that there are four open paths and three closed paths in the red east-west section, which explains its darker shade. In a map, multiple lines usually indicate multiple parallel tracks, so they’d rarely have exact duplicate segments, just similar slightly-offset paths. Sometimes cartographers would want to show parallel lines by exaggerating their spacing, especially if the lines are owned by different railroads. If it’s double track or a passing siding, it may be more detail than the map warrants. When one path is sufficient, I found it easiest to locate and pare these path pile-ups down with Smart Guides on, but feel free to use whatever method works for you (who’s to know—who’s to judge—does that really matter?).
What if the cleanup is just too much busywork?
Sometimes, as much as we’d like to optimize our art, there are times when thorough cleanup just isn’t practical. I’ll often simplify the paths by 98-100% to remove the “jaggies” from areas such as rivers, highways, and railroads that should be smooth curves, clean up the problem areas that show, and let the rest go.
Finally, remember to set your path opacity back to 100% and you can rest easy, knowing that you at least know what’s in there and have cleaned up the most egregious offenders.
The transformation matrix at work
Sometimes we scan and trace a large image in Adobe Illustrator, so large that has to be imported in pieces. You probably start out as I do, sizing, rotating, and shearing the first piece of the series so it fits.
When importing the second scan, you want it to match the first piece as accurately as possible, but what if the first piece needed stretching and twisting to fit? How can anybody perform exactly the same series of operations? I’d found myself “transformed” into a corner once too often and found a way around that dilemma, then built it into the options in the flyout menu of the Nudge Palette plugin for easy access. It’s all based on a property found in every art object in an Adobe Illustrator file called a transformation matrix. A series of six numeric values (named Tx, Ty, A, B, C, and D) define the location, scale, rotation and shearing of an object, and we can make it work for us. Here’s how: Select the first raster object and copy its transformation matrix. Next, import the new image and paste that matrix into it. Bam, it snaps onto the first image.
The images are stacked, though, and need to be stitched together. If there’s a bit of overlap in the images, an easy way to quickly align the two images is by pressing “5” to set the new, still-selected image’s opacity to 50%. Now overlap the images so they match, and press “0” to set its opacity back to 100%.
Repeat this process with every piece you have that make up the whole scanned image, and you’ll have a composite that fits (assuming all of the pieces were scanned at the same orientation).
You can also use this technique to replace a carefully-positioned image with another, with the same transformations as the original. This technique has saved me a lot of time, especially with images that required significant manipulation to fit.
I hope it works for you, too!