3

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:

stroke that needs clipping to shape area

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?

Edit:

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?

3 Answers 3

4

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.

enter image description here

5
  • Thanks for that, this solution works although it's a little fiddly especially for more complex clipping paths. It just seems crazy that this isn't something that the Pathfinder feature can automate, since computationally clipping shapes is far more complex than lines. Commented Sep 9, 2020 at 23:23
  • 1
    Pathfinder simply doesn't do well with stroked paths. It never has. Adobe hasn't updated it in some years, if ever actually. I think the panel operations are all the same as it was when it was introduced. They simply reversed the "expand" aspect and that button operation around CS5, that's all. Ido not think you'll find a "one click" solution. There's often no substitute for craftsmanship.
    – Scott
    Commented Sep 9, 2020 at 23:29
  • This is the best you can do for your lasercut project needing only strokes. You are stuck with the 3 stroke endcap options. Your clipping mask contours the stroke ends very nicely to the mask shape.
    – Kyle
    Commented Sep 10, 2020 at 2:59
  • @MikeDSutton illustrator works on the assumptioon that you want to create images. So it prioritizes fills, not strokes. So illustrator would expand the strokes in the process to keep the ends conforming to the clip. It does not occour to many graphic designers that you could pioritize lines. Illustrator just isnt geared to this usecase because its not a what you see is what you get function.
    – joojaa
    Commented Sep 10, 2020 at 4:58
  • @Kyle that wont work because the lasercutter will just ignore the clipping mask and cut the entire line.
    – joojaa
    Commented Sep 10, 2020 at 4:59
1

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.

Before and after trimming edges

2
  • 😃 Kind of 6-of-1 -- Delete the extra paths and clipping mask as I detailed or scour the layers panel to delete objects - guess it depends upon the nature of the artwork.
    – Scott
    Commented Sep 10, 2020 at 17:15
  • Some of the clipping paths were over 20k points with lots of fiddly areas which were difficult and error prone to clip manually. Whilst it's a little time consuming to find the start of the outline path segments, after that it's seconds to clip the entire shape with no ambiguity as to whether everything's been removed. Both methods have their merits, it's just a shame either are required! Commented Sep 10, 2020 at 20:07
0

To answer the question: you CAN apply a clipping mask on strokes, or "permanently clip a group of line segments using a shape". Try following steps:

  1. Make a Blend of (straight) lines w desired spacing
  2. Put a shape on top, & make a clipping mask
  3. Select your Blend, Expand it
  4. Select Expanded group of lines, Swap Fill & Stoke (so now your straight lines have a fill & no stroke)
  5. Select All (clipping mask + lines) > Pathfinder Crop.
  6. set stroke-width: job done!

(note i do this with CS5, but it should be the same with CC)

For more info, see: https://community.adobe.com/t5/illustrator/cutting-lines-inside-outside-of-shape/m-p/12131531#M280621 I call my method: "pathfinder-crop method". But check also Vasily Hall's Scribble method for a very original approach.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.