Like the title says, I want to make a stroke along the lines made with the mesh tool.
How can this be achieved?
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
You have a possibility to get strokes which have same lengths and directions as the curves in the mesh. Use the mesh to envelope distort actual strokes. Generally you will not get exactly the same strokes as the curves in the mesh, but they can be near enough. An example:
In the left there's a mesh which was originally rectangular but it is mangled a little with the direct selection tool. It was originally made by clicking few times with the mesh tool on a rectangle.
In the right there's horizontal and vertical lines which are grouped and the group is sent to back
The mesh and the group are selected. The group is mangled to the same form by applying Object > Envelope Distort > Make with Top Object. There's no need to move the mesh, it only must be on top. The result is in the left:
The version in the right is a copy. It's there only to show the lines really have became independent curves. To make them free apply
No guarantee it works with more complex meshes. But it works equally with gradient meshes, too. You must have a copy because using it as top object for envelope distortion destroys colors. See an example:
If you need as strokes exactly the same curves as the mesh you generally must tinker substantially more. If you are lucky you have uniformly spaced original mesh. Then you envelope distort uniformly spaced line grid and that's that. The previous gradient mesh example is good for showing also this.
For irreqular mesh curve spacings you need Inkscape.
Open in Inkscape the Ai file which contains the mesh. Use Internal Import option.
Apply Extension> Arrange > Deep Ungroup to disassemble the complex grouping that imported Ai files and PDFs have
Select all. Apply Object > Clip > Release to get everything visible under clipping paths. Every part seems to have one. This is the view after releasing:
The items "usexxx" in the objects panel are the released clipping paths. They all seem to have black fill and they cover the whole mesh area. They can be selected and deleted by selecting one, then applying Edit > Select same > Fill color and pressing DEL.
The actual paths become visible after you give to them some stroke width and color. Remove the possible fill color. It seems to be inherited from the original shape which was converted to mesh in Illustrator. I cannot prove the dependency exactly. The mesh is now as closed paths, every cell of the mesh is separate closed path. In the next image one of the cells is moved apart and colored to red:
The result can be taken back to Illustrator if you save it as Plain SVG.
You can't apply strokes to inner mesh paths. They aren't actually paths. And there's nothing you can do to "expand" or otherwise turn them into paths. They are data constructs. You'll have to find another way to achieve what you want.
Your best bet is to probably to take a screenshot of the highlighted mesh (because the inner lines only show when the mesh is selected). Then use that as a template and manually reconstruct the inner paths tracing the screenshot.