: Illustrator CC: how to join lines without closing? I'm a map-maker working with line information for roads, railways and other network data. I make my maps pretty with Illustrator, but I am
I'm a map-maker working with line information for roads, railways and other network data. I make my maps pretty with Illustrator, but I am running into a problem, a combination of two aspects:
The data I am using consists of many line fragments. This is common in GIS-data. I want to mark the information with a dashed line, which means I need to join the line for aesthetic presentation.
For most designers the goal seems to be to close shapes, but I precisely want to keep my lines "open", or I run the risk of drawing streets and rivers that don't exist just to close the shape.
Does anyone have a suggestion for how to join lines that overlap or are near one another without closing any line?
I've tried a couple of options now including the toolbox with scripts by Hiroyuki Sato (I think: the one including metaball), but they all close lines I want to keep open.
More posts by @Vandalay110
2 Comments
Sorted by latest first Latest Oldest Best
The default join is indeed a bit over aggressive for this kind of import use as it does not have any merge distance option.
This is possible to script or program with the plugin api. Its a bit tedious as illustrator scripting API is very low level when it comes to Bézier data. However, there is more to consider than just joining such as how to handle forks in the path and overlapping data.
Image 1: How do you handle joins so that offsets match.
So there are many implementation details to consider beyond just merging close points and ignoring the forked neighboring paths.
I am currently a but short on time so I can not script this for you, even tough I've needed this same thing occasionally when dealing with CAD/GIS/3D Render Files. It should not be impossibly hard for a developer to actually do this, but i am not aware of anybody who has done this implementation in way that would work out for you. This is on my list of things to do however but I'm a bit skeptical whether I will ever have time to go that far down the list unless this becomes a weekly issue for me personally. I would say that it is a 1-2 workdays task to program this.
However, there might be a shortcut for doing this. It is possible to circumvent the problem if your data consists of short spans. The extra joining lines tend to be much longer than your initial data segments. So you could instead join with the builtin join tool, then select spans that are longer than a certain value and delete them. This would be much faster to implement as you wouldn't need to build acceleration structures direction checking etc etc.
Image 2: Alternative, even if somewhat inferior method.
Though obviously this is inferior as it can get errors in the result as some join spans can certainly be short. However this trick only works if your data is made out of smaller segments so not a suitable solution for all cases. Asw you did not answer my comment i can not know if this helps you or not so I wont invest time in scripting it.
Image 3: Result of trick and dashes.
The standard join function in Illustrator will do what you need. I'm slightly muddled about the distinction that you are making between joining and closing so I'll cover a few options. All of the following rely on first selecting the two ends of the paths that you wish to join with the direct selection tool (white arrow):
Object > Path > Join (command-j) will add an extra segment of path between the two points to create the join.
Object > Path > Average (command-alt-j) will move the two points together, but not join them so they will still be separate paths, but with a common position for their ends.
Finally, I don't know where (or if) this option lives in a menu, but command-alt-shift-j will move the points together (like average) and then join them at that point. Nice and tidy and doesn't add any extra line segments which might mess up the aesthetics, especially for dashed lines.
Hopefully one of the above will work for you, none of them result in closed paths.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.