Copy link to clipboard
Copied
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:
Thank you in advance
-Maxim
Hi @WIDSnonamer, I've written a script to do this.
https://gist.github.com/sttk3/1727713c6c182c40df172112279fd2ba
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
To clarify the "one" path - as shown with the simplyfied circle. In the end i need the whole path of the circle without gaps and overlapping paths. Its not one path but the multiple segments complete the "one" path.
I already tried this aproach, but pathfinder wont return a valid result.
So i create a copy of the Path and convert this to a dotted path with a 280pt gap and 5pt pink dash. Visualy it looks right.
As soon as i expand the view and substract it from the path underneeth it i get this result:
Adjusting the width of the pink dotted path does not resolve this issue.
Copy link to clipboard
Copied
Dis you try to increase the precision in the Pathfinder panel menu?
Copy link to clipboard
Copied
Yes, same result event if i change the precision from 0.028pt to 0.0001pt.
Copy link to clipboard
Copied
Thank you, so you want path segments made of single open paths. Maybe you should take a look at this post on dividing dashed strokes. There are some quite sophisticated approaches to solving that problem and they might work in your case too.
- Mark
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Hi @WIDSnonamer, I've written a script to do this.
https://gist.github.com/sttk3/1727713c6c182c40df172112279fd2ba
Copy link to clipboard
Copied
Hi @sttk3!
That was the right aproach!
I was trying to create two dashed paths and convert them, but it deletet one of them. I had to adjust one of them to the other, so the dashes dont overlap and had to use 0pt as the first dash, which the script could not handle.
But using only the pink one as the dashed path works flawlessly!
Thank you very much!