Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Cutting lines inside / outside of shape.

Community Beginner ,
Oct 12, 2020 Oct 12, 2020

Copy link to clipboard

Copied

Hello,

 

I am using Illustrator to create complex pen-plotter drawings that typically involve a lot of cross-hatched shading.  I am looking for a way to automate one of the most needlessly laborious parts of this process. 

 

At present, to fill an area with parallel lines (I will refer to them as hatch-lines,) I first create the hatch-lines using the blend tool.  I expand the blend, then I place a shape on top to delineate the area I want to cut, and I use the Shape Builder tool to delete the unnecessary parts of each hatch-line individually, using the alt-click.  I am looking for a way to automate this process. (See Image 1).

 

Unfortunately the Pathfinder tool does not do quite what I want.  The Divide command can erase lines outside of a shape, but only if the shape is simple, without "undercuts."  It does not seem to be able to erase lines inside of a shape.  (See Image 2).

 

I need to actually sever the paths at the desired locations (where they intersect the shape's outline) and delete the unwanted parts of the path (either inside or outside the shape, depending on the context.).  I can't simply "mask" the image by layering filled shapes on top, because these are vector files for pen plotter, and all vectors will be plotted whether or not they are obscured.  

 

Does anyone know a solution?  Would it be possible to write a script which could perform these behaviors?  Please let me know if any further clarification or elaboration is needed.  If I could automate this task it would save hours or even days of alt-clicking per drawing!

 

With gratitude,

Automate

 

Automate2

JCO

TOPICS
Feature request, Scripting, Tools

Views

911

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 3 Correct answers

Adobe Community Professional , Oct 13, 2020 Oct 13, 2020
Okay, here is a more elaborate description and some gifs. Here's a screenshot of me defining a pattern. When defining this pattern you get the advantage of not only being able to set the stripes with one click, but more importantly the new pattern will have a name (even a default name is good) so that later actions can reference this swatch. Then draw a sample shape and fill it with the pattern. Next, go to the Object > Expand menu item to 'expand' this pattern into paths. Afterwards use the ...

Likes

Translate

Translate
Adobe Community Professional , Oct 13, 2020 Oct 13, 2020
I found this gif-recorded for Windows called "RecordIt"  and I'm just loving it! Here you can see, I've assigned the F2 key to my action and processed 5 shapes in less than 10 seconds! Notice there is a problem with the curvy arrow's top-right area: there's a doubled-up path that doesn't belong there. I'm sure that with a little different scribble setting or closer pattern lines it could be solved too. I just did this example quick and dirty, in your work you'll want to test this out in many sc...

Likes

Translate

Translate
Adobe Community Professional , Oct 13, 2020 Oct 13, 2020
Update: you can even forget the pattern! You can actually use your current technique by using a blend, then using a clipping path and ensuring the blend is expanded. All you need to do is first Divide with Pathfinder and then add a scribble effect to the result. Then Expand Appearance and you get a group which has your original divided lines at the bottom and just the lines you want at the top! Of course, using a blend is going to be more than a one-click operation of just using a swatch or a gr...

Likes

Translate

Translate
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

I was able to successfully use your action not only in your example file, but also in a a file of my own-- Very exciting!  I understand how some of the steps function, but not all of them.  I will keep playing with it to understand better.  Thank you!

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 22, 2021 Jun 22, 2021

Copy link to clipboard

Copied

LATEST

Hi,

Pathfinder-Crop method.

An old Pathfinder trick should do the cropjob (check the pics).

I use CS5, but it should work exactly the same on CC.

For the Action: put the blend on a new layer & lock all other layers, then run the action.

Note all answers up to now (except scripts) work for straight lines, not for Curved lines inside the crop area, so the question is only partially solved.

As for scripts, there's Serg Osokin's free script called Splitpath.  (it's for >CS6 & i have CS5, but i'm sure it works great).

 

Note also it wouldn't be difficult for Adobe to add a tool or feature doing this cutting-of-lines, and it has been asked regularly, so why they don't is a mystery. And clean, trimmed lines are superior to clipped lines: see comment on pic2 for demonstrating this.

Nic

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
    • 1
    • 2