: Technique for finding the centerline of a curved object? I'm curious to know if anyone knows of any effective techniques for finding the center line of a curved object. In the screenshot below
I'm curious to know if anyone knows of any effective techniques for finding the center line of a curved object.
In the screenshot below you'll see a crude version of what I mean.
Is there any way to get that line to perfectly trace the center, or is it easiest to just eyeball it?
Photoshop or Illustrator techniques are acceptable.
More posts by @Nimeshi706
4 Comments
Sorted by latest first Latest Oldest Best
Use Illustrator's Blend
Outline your type (Type → Create Outlines)
If needed, ungroup the paths and/or release the compound path (Object → Ungroup / Object → Compound Path → Release)
Use the Direct Selection Tool (A) to select the end paths and delete those segments. You should now have 2 separate paths.
Set the blend options to 1 step (Object → Blend → Blend Options)
Create your blend (Object → Blend → Make)
Blend will usually give the desired result but can sometimes fail with more complex curves.
If the blend fails, use the Scissors Tool (C) to cut both paths at the problem areas and recreate the blend for each section.
For more complex letters or shapes, divide the shape in to more manageable sections. Then create a blend for each section.
This will only work with a graphic of the same width all the way. Select the entire graphic, the S in this case. Then use the selection shrink tool to take it down to 1 or 2 pixels in width. It will shrink from all borders equally, so you'll lose some from the ends of the S, but it should trivial to extrapolate the ends.
If you are happy with just getting close, this works in Illustrator - especially for an image that has a consistent width like your example.
Draw a circle that is the same width as your object's width
Copy/paste the circle as many times as needed and distribute around the object. Use enough of them to follow the shape fairly closely
Using the pen tool simply draw a line through the centerpoints of the circles you made. Just connect them straight, don't worry about curves.
Use the smooth tool to curve the line you just made. (just follow the curve of the original with the smooth tool) If necessary you can make curve adjustments separately at the bezier points.
Delete the circles
The picture below will demonstrate a little better.
If I understand the question correctly, you want to know if there's a way to exactly trace the center line of a thick curved line.
In Photoshop there's no straightforward way to do this that I know of. I would add a Bevel and Emboss effect to the layer, set it to Chisel Soft (works better than Chisel Hard), and increase the size until there was no flat "table" left. Then I would trace the "ridge" of the bevel, which would be centered on the shape, with the pen tool. This would work for a shape of uniform thickness, like your example. Playing with the "Soften" parameter can help to giveyou a smoother and more visible curve for tracing.
In Illustrator you could use a similar approach, or "Offset Path" with a setting that reduced the resulting path to a very thin line.
In both cases, your line won't run all the way to each end, but that should be easy to work around.
[Later Edit]
As promised, here's an alternative Photoshop technique that is quite flexible and may work better in some circumstances. It involves more steps, but seems to trace irregular curves more smoothly. It also extends almost to the ends of the shape.
Here's the starting point:
Copy your shape to a new layer (Ctl/Cmd-J) and apply a blur. Depending on the shape, Gaussian Blur or two passes of Motion Blur (one horizontal, one vertical) may work better. The main thing is to get a good blur that leaves a distinctly darker grey along that critical center line. You want to be able to see the transparency grid through the darkest part. If you can't, part of the image is fully opaque and the next bits won't work as planned.
Apply Filter > Other > Maximum with an amount roughly the same as your blur. Tweak until you have a distinct fine "ridge" along the center line of the shape.
Apply Filter > Unsharp Mask with an amount of 500% and adjust the radius until you have a distinct center line. It turned out, when I was experimenting with my original idea, that this gives a much better result than other methods of tweaking the contrast, such as curves or levels.
From there, you just trace the curve with the pen tool.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.