I’m producing some vector artwork for laser cutting, and need to create some hatching using parallel lines.
This has been built using two initial line profiles, then using a shape blend between them set to the desired spacing. This is then expanded to create the individual lines, then a clipping mask applied over the top to clip the hatching to the desired area (an offset compound path if that makes a difference.)
This appears exactly how I need it to, however when switching to outline view the hatching lines still extend outside the clipping mask, which is how the laser cutting software interprets the design and so would cut incorrectly. I need to "apply" the clipping mask to trim each of the hatching lines to the clipping path area, however when trying to do this using pathfinder it just gives the error "The filter produced no results. Please select two filled and overlapping paths."
I can get the desired effect by first expanding the hatching lines into shapes then using pathfinder, however this then converts each stroke into a filled box which will not be interpreted correctly.
Take this simplified case as an example:
This shows one of the strokes which make up the hatched area, that need to be clipped to the shape bounds, not just hidden by the clipping mask.
Is there a way of permanently clipping a group of line segments using a shape?
Pathfinder in outline mode almost does what I want, but additionally adds the clipping path boundary to the final shape. An alternate question would therefore be how to use outline mode and not have it add the clipping path boundary to the final shape?
I've found a workaround in case it helps anyone else in a similar situation. When Pathfinder runs in outline mode, the path segments relating to the original clipping path as opposed to the clipped strokes seem to always get added to the bottom of the layers list.
In this case it's quite easy to visually differentiate in the layers panel between the long thin hatching lines, and the short stubby lines that make up the border, so selecting everything from the first of these stubbly paths down to the bottom of the group and deleting them does the trick.
Again, strange that this is not something that Illustrator offers out of the box since Pathfinder in crop mode is first clipping the strokes then reassembling the resultant shapes, so this should be a simpler task.
For simple shapes then @Scott's solution above is likely simpler and faster, however it's always good to have options.
Correct answer by Mike D Sutton on December 2, 2020
Release the Clipping Mask.
With it all selected still, use the Shape Builder Tool and hold down the Option/Alt Key while dragging over the extended paths. This will remove them.
Lastly select the hollow, no fill, no stroke, path that was the mask and remove it. You'll be left with only paths in the shape you want.
Answered by Scott on December 2, 2020
1 Asked on January 6, 2022 by elizabeth-hale
1 Asked on January 6, 2022 by cyril-gliner
1 Asked on January 4, 2022 by moller-peter
1 Asked on January 4, 2022 by mily-digital
1 Asked on January 4, 2022 by homan-cheung
1 Asked on January 2, 2022 by daniels-jack
1 Asked on December 31, 2021
1 Asked on December 31, 2021 by brett-reynolds
3 Asked on December 28, 2021 by simonz
2 Asked on December 28, 2021 by amanwhoneedhelp
1 Asked on December 26, 2021 by dsaj34v
7 Asked on December 24, 2021 by echo-yang
1 Asked on December 15, 2021 by user23891
1 Asked on December 12, 2021 by user149088
1 Asked on December 10, 2021 by grey-krav
1 Asked on December 8, 2021
Get help from others!