Skip to main content
WIDSnonamer
Inspiring
February 7, 2022
Answered

Creating a sliced path (dashed/dotted path)

  • February 7, 2022
  • 1 reply
  • 1738 views

Hey there! 
I am trying to achive following effect for my paths. I need to divide my path into 2 separate colored paths. For example after each 200pt long black path is a 20pt long pink path. For a simple shape as a circle i have found a simple solution, that would work for me.  

I use a pattern brush  and can expand the apperance to have unique paths for black and pink. Unfortunately this solution isn't working for more complex paths beacause i require  a long pattern (280pt balck and 1.5pt pink) and illustrator cant handle this on corner points. I get the following result. On the left is the original path and on the right is the pattern brush applied.

After adjusting the corner options of the pattern brush, i get a better result, but  illustartor applies the pattern between corner points, which leads to results like this:

 

 

The whole pattern is compressed to a mush shorter path than wanted as you can see on the curved path. On the right side is the pink path, which should be much longer or even not on this position regarding the whole shape

 

Is there a way to achive it in Illustrator or even a script that manage to do that?

 

I dismissed following aproaches:

  • Dotted path can only be transformed to shapes and not paths and cant create a solution with the pathfinder tool and the original shape.
  • the cut tool can only be used manualy and I need a solution that potentualy can be run with an action or a script


Thank you in advance
-Maxim

 

This topic has been closed for replies.
Correct answer sttk3

That post looks very promissing, i tried the script approach from @sttk3 and it worked with 1 of two paths so far. Will try to figure out why it is not working, but so far i am now very close to a solution.

Thank you!


Hi @WIDSnonamer, I've written a script to do this.

 

  1. The pink path is a dashed line. Place it in the foreground.
  2. Black path is a normal line. Place it behind the pink path.
  3. Select the two and run the script. The path will be split by color. The behavior is similar to pathfinder trim.

 

https://gist.github.com/sttk3/1727713c6c182c40df172112279fd2ba 

1 reply

m1b
Community Expert
February 7, 2022

Hi @WIDSnonamer, sounds like an interesting problem. Is it viable to give it a solid black stroke and a duplicate object (or second stroke appearance) with the dash in pink on top of it?

- Mark

WIDSnonamer
Inspiring
February 8, 2022

Hi @m1b, sadly it won't do it for me. I intend to use the files for lasercutting, so i need "one" path with sliced parts. The pattern brush is almost the perfect solutinion, but the complex shapes create a lot of artifacts. 

 

m1b
Community Expert
February 8, 2022

I'm not sure what you mean by "one" path. Also just to clarify you understood what I was suggesting earlier: I meant to do what I asked earlier, (also make pink stroke should be thicker than the black) then Outline Stroke to both black and pink paths, then duplicate both paths and on one copy use PathFinder intersect and on the other copy use PathFinder minus front. This should give you two groups of "dashes"—black and pink. If it helps choose "align to corners.." in the Stroke Panel.

Could you confirm that this won't work for you? I think it'd be worth sharing a sample file with a path you have treated to your satisfaction and also a path that doesn't work, so we can test ideas.

- Mark

 

P.S. @Kurt Gold is expert at this stuff. We can see if he's not too busy to take a look.