Skip to content

Conversation

@c-mateo
Copy link
Contributor

@c-mateo c-mateo commented Oct 13, 2025

The Round Corners node has a parameter that controls whether rounded corners are created depending on the angle between edges. I found its behavior somewhat counterintuitive.

In the image below, the minimum angle threshold is set to 90°, but the green and cyan angles are not getting rounded corners even though they are greater than or equal to 90°, while the orange angle, which is less than 90°, does.

image

Work in progress to close #3204.
Currently, it ignores vertices with handles but doesn't work well when the vertex is the first in the path. Any help would be appreciated.

image

@c-mateo c-mateo marked this pull request as ready for review October 14, 2025 18:43
@c-mateo
Copy link
Contributor Author

c-mateo commented Oct 14, 2025

I tried pushing the manipulator groups directly, but the problem persisted:

for i in 0..manipulator_groups.len() {
    new_manipulator_groups.push(manipulator_groups[i]);
}

That pointed me to the bezpath_to_manipulator_groups function.
It turns out that last_manipulators.in_handle should be assigned to first_manipulators.in_handle, not to first_manipulators.out_handle. It works fine now.

The current solution for rounding corners is to skip producing a rounded corner for any vertex that either:

  • has its own handles, or
  • has neighboring vertices with handles pointing toward it.

This ensures that existing curve handles are preserved and not overridden by the corner rounding logic.
However, a more robust solution would be to properly combine rounded corners with existing curves, instead of skipping them entirely, so that rounding can coexist with vertices that have handles.

@otdavies
Copy link
Member

Hmm, having played around a bit with this, I think we'll need to potentially put off fixing this issue until we can come up with a new algorithm. Realistically you can improve it a little by avoiding anchors with handles, but it only delays things.. you end up with situations like this, since the algorithm assumes straight edges:
image

I'll think on this a bit. Thanks trying to figure this out!

@c-mateo
Copy link
Contributor Author

c-mateo commented Oct 15, 2025

@otdavies, could you share the Graphite file? I'd like to take a look and see if I can propose a solution. If I can't find a fix, I'll let you know.

@otdavies
Copy link
Member

otdavies commented Oct 15, 2025

@c-mateo This is just with a box with two corners rounded, and this is the non-rounded opposite corner. I wouldn't worry a ton about it, unfortunately I think we need to come up with a slightly different algorithm.

Something that will help though, is the knowledge that when you sharpen corners, sometimes the handles are just hidden below the anchor in the same position - so you also likely need to do a check for distance of anchor to handles to ensure handles do/don't exist.

@c-mateo
Copy link
Contributor Author

c-mateo commented Oct 15, 2025

@otdavies I can't reproduce this. Could you attach the file or a short screen recording showing the issue and the exact steps to reproduce it? I’ll take a quick look.

@otdavies
Copy link
Member

I can't get to reproduce now either, so might have been an editor crash or similar that I didn't catch. @c-mateo

For now I'd pause on this as I think there needs to be a discussion on the goals. We should wait for Keavon. We want the round corners node to behave similar to other vector editors and right now it is not meeting that requirement well. Your changes aren't at all the issue, I just don't think we will be able to make the tool behave better in all cases without an overhaul to the algorithm.

If you specifically want to work towards a final version - go try some other vector editors corner rounding tools and see what ours doesn't do right. Then we can start to build in that direction. Thanks!

@c-mateo
Copy link
Contributor Author

c-mateo commented Oct 16, 2025

@otdavies I'd like to continue working on this feature. Please let me know when you've decided what should be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Round Corners" node removes bezier curves from vectors

2 participants