• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating a sliced path (dashed/dotted path)

Explorer ,
Feb 07, 2022 Feb 07, 2022

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.  

WIDSnonamer_0-1644241041626.png

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.

WIDSnonamer_1-1644241475373.png

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:

 

WIDSnonamer_3-1644241618483.png

 

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

 

TOPICS
Bug , Draw and design , Scripting , Third party plugins , Tools

Views

839

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 1 Correct answer

Community Expert , Feb 09, 2022 Feb 09, 2022

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 

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 07, 2022 Feb 07, 2022

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

Votes

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
Explorer ,
Feb 08, 2022 Feb 08, 2022

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. 

 

Votes

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 Expert ,
Feb 08, 2022 Feb 08, 2022

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.

Votes

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
Explorer ,
Feb 08, 2022 Feb 08, 2022

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.

WIDSnonamer_2-1644312804556.png

 

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.

WIDSnonamer_0-1644312204527.png

As soon as i expand the view and substract it from the path underneeth it i get this result:

WIDSnonamer_1-1644312341716.png

Adjusting the width of the pink dotted path does not resolve this issue.

Votes

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 Expert ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

Dis you try to increase the precision in the Pathfinder panel menu?

Votes

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
Explorer ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

Yes, same result event if i change the precision from 0.028pt to 0.0001pt.

 

Votes

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 Expert ,
Feb 08, 2022 Feb 08, 2022

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

Votes

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
Explorer ,
Feb 08, 2022 Feb 08, 2022

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!

Votes

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 Expert ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

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 

Votes

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
Explorer ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

LATEST

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!

Votes

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