Merging straight broken multiple overlayed path lines into one

Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Hello.

I want to give my sincere gratitude to anyone who manages to help me on this.

I have vector SVG file of maze that was produced by maze generating software. I want to apply my brush to it but what I see as one straight line is actually set of multiple broken lines all over (the part in red rectangle is what makes the overall shape). 

Is there any way I can combine these single paths in to one uniform path so I can apply brush to it?
At the moment when I apply brush I get broken up pattern and obviously the corners are just two patterns overlaping, it is not the actual corner of the brush pattern.
For example heart brush, on the left is brush applied to connected path I) draw manually and right is same brush applied on the shapes I have. 

I have multiple files in same manner, all SVG files. Ideally if it is possible to join them I would need batch processing action/script to merge them in all files in folder.

I tried with Pathfinder and Shapebuilder but with no success.

I have attached the original SVG file for testing.

Thank you!!

Marinapomorac_0-1642591847727.png

 



TOPICS
How to , Scripting

Views

327

Likes

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

Adobe Community Professional , Jan 19, 2022 Jan 19, 2022
Marina, instead of using pattern brushes you may find this alternative approach a bit useful. Certainly not exactly what you are looking for, but give it a try. You can download a sample here: Amazing Hearts The .zip file contains a sample Illustrator file (amazing_hearts_001.ai) and an action set file (hearts_1.aia). Instruction: - Download and unzip the file - Open amazing_hearts_001.ai - In the Actions palette import hearts_1.aia - Run the action hearts_001 Instead of hearts one...

Likes

Translate

Translate
Adobe Community Professional ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Hi @Marinapomorac, it's an interesting challenge, but I don't know a way to do it how you want without scripting. Maybe there's an existing script? It would need to find anchor points that matched and, if two, join, but if three or more, work out which points to join based on the angle between them (add guess only join 180° straight runs).

- Mark

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Thank you for fast response.
I did say it would be ideal to have script that I can run to fix it. 
I was given this to test out:

/version 3
/name [ 5
5365742031
]
/isOpen 1
/actionCount 1
/action-1 {
/name [ 8
416374696f6e2031
]
/keyIndex 0
/colorIndex 0
/isOpen 1
/eventCount 6
/event-1 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_find)
/localizedName [ 8
53656c6563743a20
]
/isOpen 1
/isOn 1
/hasDialog 0
/parameterCount 1
/parameter-1 {
/key 1851878757
/showInPalette -1
/type (enumerated)
/name [ 17
53616d65205374726f6b6520436f6c6f72
]
/value 5
}
}
/event-2 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_pathfinder)
/localizedName [ 10
5061746866696e646572
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 1
/parameter-1 {
/key 1851878757
/showInPalette -1
/type (enumerated)
/name [ 7
4f75746c696e65
]
/value 6
}
}
/event-3 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_setStroke)
/localizedName [ 10
536574205374726f6b65
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 7
/parameter-1 {
/key 2003072104
/showInPalette -1
/type (unit real)
/value 7.5361
/unit 592476268
}
/parameter-2 {
/key 1667330094
/showInPalette -1
/type (enumerated)
/name [ 8
4275747420436170
]
/value 0
}
/parameter-3 {
/key 1836344690
/showInPalette -1
/type (real)
/value 10.0
}
/parameter-4 {
/key 1785686382
/showInPalette -1
/type (enumerated)
/name [ 10
4d69746572204a6f696e
]
/value 0
}
/parameter-5 {
/key 1684825454
/showInPalette -1
/type (integer)
/value 0
}
/parameter-6 {
/key 1684104298
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-7 {
/key 1634494318
/showInPalette -1
/type (enumerated)
/name [ 6
43656e746572
]
/value 0
}
}
/event-4 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_setColor)
/localizedName [ 9
53657420636f6c6f72
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 6
/parameter-1 {
/key 1768186740
/showInPalette -1
/type (ustring)
/value [ 12
5374726f6b6520636f6c6f72
]
}
/parameter-2 {
/key 1718185068
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-3 {
/key 1954115685
/showInPalette -1
/type (enumerated)
/name [ 9
52474220636f6c6f72
]
/value 2
}
/parameter-4 {
/key 1919247406
/showInPalette -1
/type (real)
/value 100.0
}
/parameter-5 {
/key 1735550318
/showInPalette -1
/type (real)
/value 100.0
}
/parameter-6 {
/key 1651275109
/showInPalette -1
/type (real)
/value 100.0
}
}
/event-5 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_setStroke)
/localizedName [ 10
536574205374726f6b65
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 7
/parameter-1 {
/key 2003072104
/showInPalette -1
/type (unit real)
/value 7.5361
/unit 592476268
}
/parameter-2 {
/key 1667330094
/showInPalette -1
/type (enumerated)
/name [ 9
526f756e6420436170
]
/value 1
}
/parameter-3 {
/key 1836344690
/showInPalette -1
/type (real)
/value 10.0
}
/parameter-4 {
/key 1785686382
/showInPalette -1
/type (enumerated)
/name [ 10
4d69746572204a6f696e
]
/value 0
}
/parameter-5 {
/key 1684825454
/showInPalette -1
/type (integer)
/value 0
}
/parameter-6 {
/key 1684104298
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-7 {
/key 1634494318
/showInPalette -1
/type (enumerated)
/name [ 6
43656e746572
]
/value 0
}
}
/event-6 {
/useRulersIn1stQuadrant 0
/internalName (ai_plugin_setStroke)
/localizedName [ 10
536574205374726f6b65
]
/isOpen 0
/isOn 1
/hasDialog 0
/parameterCount 6
/parameter-1 {
/key 2003072104
/showInPalette -1
/type (unit real)
/value 7.5361
/unit 592476268
}
/parameter-2 {
/key 1667330094
/showInPalette -1
/type (enumerated)
/name [ 9
526f756e6420436170
]
/value 1
}
/parameter-3 {
/key 1785686382
/showInPalette -1
/type (enumerated)
/name [ 10
526f756e64204a6f696e
]
/value 1
}
/parameter-4 {
/key 1684825454
/showInPalette -1
/type (integer)
/value 0
}
/parameter-5 {
/key 1684104298
/showInPalette -1
/type (boolean)
/value 0
}
/parameter-6 {
/key 1634494318
/showInPalette -1
/type (enumerated)
/name [ 6
43656e746572
]
/value 0
}
}
}

But it doesn't work. Besides corners with these paths all broken up another issue is random flipping of the pattern in straight line. 

Marinapomorac_0-1642594591313.png

I tried even exporting SVG to png and then back tracing them to vector but then I get shape not path lines #headache.. 

Likes

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
Advisor ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

AFAIK Illy can't do a three line corner, so you're gonna have to fake it anyway.

Happy to be proven wrong!

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Well, I just discovered how old I am. I had to google AFAIK to find out what it means 😄

The three splits I understand it can't merge but at least some of the 2 ones  (that are straight) to get combined will be helpful, to avoid pattern being flipped in a straight line. 

Likes

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
Advisor ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

You could selectively select a group of lines and try join... I did a quick test and proximity seems to be the default determination, rather than drawing order...

 

joinLines.jpg

PS - ah, it's selection order...

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

That is still manual labour. I could trace the lines with pen tool faster than doing the merging between selective paths. I am hoping to avoid that. 

As I wait for possible solution I am playing with brush options. It seams some brushes work and look nice (have simetrical up/down left right concept) and in that case errors are less visible.

Likes

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
Advisor ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Well, yes, if you think Select All is manual labour...

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

What you are saying is that there is a way to automate what you have done? So it can be run automatically and convert all the files (merge the paths selectively)?

When I say manually I mean to do each file yourself. I have millions of files.

 

Likes

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
Advisor ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Ah, no, I don't remember reading above that you had millions of files...

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Files come from maze generator so I can generate 100 mazes file like above (SVG samples) under minute in SVG file format. 
I plan to change them from ordinary line to have custom shaped walls. 
So the plan was:
a) generate SVG maze files
b) run action or script to fix lines
c) run action to apply brush to path
d) merge 6 or 12 solutions on one page and export all in one book PDF ready for print.  

Likes

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
Adobe Community Professional ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Marina,

 

instead of using pattern brushes you may find this alternative approach a bit useful. Certainly not exactly what you are looking for, but give it a try.

 

You can download a sample here:

 

Amazing Hearts

 

The .zip file contains a sample Illustrator file (amazing_hearts_001.ai) and an action set file (hearts_1.aia).

 

Instruction:

 

- Download and unzip the file
- Open amazing_hearts_001.ai
- In the Actions palette import hearts_1.aia
- Run the action hearts_001

 

Instead of hearts one could use any other shape.

 

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

I exported the files and within the ai file under the brush menu there is a heart shape. When I copy paste my shape from another file in to that file and select the heart I get what you see in the screenshot.

Marinapomorac_2-1642615236389.png

When I try to run action in another file I get two errors. 

Marinapomorac_0-1642615106767.png

Marinapomorac_1-1642615140156.png
And when I apply this new brush on path I get this:

Marinapomorac_3-1642615725427.png

 

 

 

 

Likes

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
Adobe Community Professional ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Hi Kurt, I tried your sample file. Very cool!  

 

Screen Shot 2022-01-20 at 7.06.18 am.png

 

Likes

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
Participant ,
Jan 27, 2022 Jan 27, 2022

Copy link to clipboard

Copied

LATEST

Hello @Kurt Gold 

I marked your reply as correct answer because it does solve the problem in title, merging of the path lines.
I started another thread for the brush issue. 
https://community.adobe.com/t5/illustrator-discussions/automate-brush-application-to-all-paths-in-fi...

I tried everything and asked other professional in AI to solve the automated custom brush application to multiple SVG files (as the ones I added here for testing) but so far in three days no one was able to find a working solution so I created another thread here.
From your reply I get it should/could be possible to have custom brush applied to all paths in file. I created scattered brushes thanks to your guide. 
Thank you!


Likes

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
Adobe Community Professional ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Yes, the action is bound to the sample Illustrator file I provided. I thought that was rather obvious.

 

You can of course use it in other files, but you would first have to prepare them a bit.

 

Likes

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
Adobe Community Professional ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Thanks, Mark (m1b), for showing how the action is supposed to work.

 

Of course, in this case it works pretty well because all the individual line segments have the same length. In case there are different lengths one would have to take another approach, but I think it would be doable (even with a bumpy action).

 

Likes

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
Adobe Community Professional ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

"Files come from maze generator so I can generate 100 mazes file like above (SVG samples) under minute in SVG file format. 
I plan to change them from ordinary line to have custom shaped walls. 
So the plan was:
a) generate SVG maze files
b) run action or script to fix lines
c) run action to apply brush to path
d) merge 6 or 12 solutions on one page and export all in one book PDF ready for print."

 

That's a promising plan, Marina.

 

Can you perhaps provide 10 or 15 different mazes that were created by your maze generator? Please put them in a single .zip file and make sure that there are different constructions (e.g. different line segment lengths, angles etc.).

 

Then one may see what ways are possible.

 

Likes

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
Participant ,
Jan 19, 2022 Jan 19, 2022

Copy link to clipboard

Copied

Sure thing.
https://drive.google.com/file/d/17qBPUZRpBGdSv1tDLw5Lyk4slW2RcW6l/view?usp=sharing

Let me know is it working. I rarely use Gdrive.

 

Likes

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
Adobe Community Professional ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

Thanks for the sample files.

 

As far as I can see they are all ready to be used with the action I provided.

 

All you have to do is to make sure that the brush heart_001 is in the main Brushes palette.

 

Of course, it may be that some other modifications are required (e.g. brush definition size, number of the desired addtional anchor points etc.). Probably you may also want to modify the action a bit, so it suits your specific needs.

 

And there are certainly some other approaches to make the hearts or any other shape.

 

Likes

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
Participant ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

Thank you. I appreciate you testing it. Now the problem lies in me. 
Unfortunately, you mentioned some file preparation is necessary before running action.
Also, you mentioned that the brush element (heart) can be changed. I will have to figure that out as well.  And how to get it to main brush palette. 
Since from this point, my questions are truly very basic on how to use Illustrator (e.g. brush definition size, number of the desired additional anchor points, etc.) plus I do not know how to change action, I might try hiring someone to take what you prepared and make it into one clickable action I would then just run on my files.

As I said, the most important part was to find out is it possible, now I just need to learn to do it. 
Thank you!

 

Likes

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
Participant ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

@Kurt Gold One more question please, regarding these brushes (in screenshot), the action will work the same or for these brushes I have to find another solution? I like the bottom left one the most (realistic grass) and that is the one I plan to use.

Thank you!

Marinapomorac_0-1642757436429.png

 

Likes

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
Adobe Community Professional ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

Yes, some of them can also be done with an action, but the one on the right might be better done with two or three combined scatter brushes. The one with the daisies would probably require some manual work.

 

If you are going to use the grass or hedge texture, I would just create and apply a single scatter brush with one or a couple of randomization settings as shown in the screenshot below. It wouldn't be necessary to use an action since it is just a one-click event to apply the brush to all line segments.

 

grass_maze_001.png

 

Likes

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
Participant ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

I am in shock!
That heart looks exactly how I want it and yes, I did plan to put daisies or leaves or lady bugs or something on top of the grass after finishing. The grass-shaped maze is just starting base for decoration.
Is that grass brush available to purchase? Please share link.
Is there a video tutorial on how to create what you have?

 

I can't believe you created what I have in my head exactly.   

THANK YOU!
I am so happy now.




 

Likes

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
Adobe Community Professional ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

I created this custom brush just for this exercise, but you can do it yourself. It's quite easy. Just draw two or three dozens of different blades of grass, fill them with different shades of green, duplicate all blades until you get a bunch of some hundreds blades, select them all, open the Transform Each dialog (see Object menu), play with its random options and after that arrange and rotate some blades manually until you get a dense bunch of blades.

 

Take this bunch, create a scatter brush out of it, apply it to one of your mazes, then play with the scatter brush options until you are satisfied with the result.

 

Likes

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