Copy link to clipboard
Copied
I'm trying to find a solution to a slightly vexing problem, I have a bunch of paths like following image where I need to smooth only the hard corners while keeping the rest of the shape as it is.
This is an example of the original shape and what I hope to end up with, where only the 'internal' corners have been smoothed.
using the smooth tool does a great job on the cornes but also contracts and expands the other parts of the shape that i need to stay the same as the original.
the closest I've come is to do a simplify by eye, then manually select the corners, then apply Hiroyuki Sato's corner rounding script. This achieves pretty much what I need to do but with quite a bit of manual tweaking and GUI interfacing, and only for a single shape. but I need to process hundreds of similar but all unique shapes, so this process isn't going to feasible.
I'm really hoping someone has a cunning plan for how to appoach this... ideally a scripting solution, but even a 'select all shapes' and do some GUI steps that are applicable to all shapes at once, without having to individually tweaking settings for each and every shape...
any suggestions very greatly appreciated.
Copy link to clipboard
Copied
Hi. This should be possible, with the Corner widgets. As long as the vector shapes are created correctly/clean.
like here: https://www.youtube.com/watch?v=8-yj9iB0Wh0
Copy link to clipboard
Copied
I'm not sure I understand the details of your task. After Object > Path > Simplify for selected paths, you can try running SelectPointsByType to select sharp acnhor points (checks for handles) and round them using native Corner Widget, Hiroyuki Sato's script, or Dynamic Corners Tool by Astute Graphics. This way you don't have to select each vertex by hand.
Copy link to clipboard
Copied
Try the trackpad tool
Copy link to clipboard
Copied
Jeff,
Maybe of little help, but you can start with the Round Any Corner, and use it (maybe in groups) with different values, or easily selecting them as Sergey said.
I am afraid the simplifying goes against the "while keeping the rest of the shape as it is".
Copy link to clipboard
Copied
Copy link to clipboard
Copied
thanks everyone for the suggestions.
It turned out to be a rather more vexing problem than I had anticipated, mainly due to the range of possible shapes I was needing to deal with.
I went a long way down Sergey's path trying to isolate the hard corner anchors and it was going quite well but the initial simplification required to open up the point spacing kept messing with the corners of certain outlier shapes, too many to tweak manually.
BryanPagenkopf's idea of doing two opposed path offsets was very cunning and I managed to wrangle it into a script that works enough of the time to be almost universal to my process, requiring only a minimal pass over the final thing to tweak the few outliers...
generally works pretty well with smaller offsets (i.e. less rounding), keeping the original inner shapes perfectly.
The main issue is when the offset is too large for small shapes, such that the shape will disappear entirely, the first shrinking offset just doesn't happen, but there's no warning or error that it hasn't been applied, so they're really hard to catch.
and the sweetspot is a bit of a moving target! It's WAY beyond my skills (or needs) but the ideal solution would be adaptive in some way. shrinking when it need to within a specified tolerance.
the other thing I thought was interesting in this whole exercise was the 'percieved' roundness of a corner, ideally the more oblique the corner the larger its radius would be and the opposite for more acute corners so that the final shape has rounded corners that feel more natural... but that is a whole other kettle of fish...
two corners with the exact same radius but the more acute corner feels like it's been more rounded than the oblique corner.