-
-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the spline node algorithm to be continuous across start/end points #2086
Comments
Hi @Keavon I was interested into contributing this code , I have already setup the project locally by following all the guidelines listed on the contribution page. This will be the first time I'll be contributing to graphite, so I'm not totally aware about the codebase, still I wanted to solve this issue I need to add a calculate_spline_control_points function that will calculate the spline control points instead of solve_spline_first_handle and Update the spline node code to handle closed paths. But I'm little confused to be honest any feedback on how should I approach this problem. Looking forward for your response , Divv |
Welcome @DivvSaxena! We can continue this discussion through Discord. |
Just tried my first contribution, and have a working fix for this now on my computer. My method was to "overshoot" by using the two next nodes in the loop, and then copy the Bezier handle from the first "extra" node to the first node. |
Thanks for working on it, @kalle95data! Could you please open a PR for it? (Let me know on Discord if you need help with the Git aspects.) I look forward to testing out your solution to see whether this produces a sufficiently close result to the mathematically "correct" approach. It'll certainly be a good improvement, even if we end up revisiting this later to implement the mathematically correct approach. |
@0HyperCube wrote in Discord:
|
I haven't managed to get cubic spline with a loop / cyclic boundaries all the way yet (the best so far is where the handles were rotated 90 degrees), but unfortunately there is still something wrong. I submitted a solution now which is based on the "normal" cubic spline but to "overshoot" around the loop by 9 more segments and then replace the segments around the boundary with these "overlapping" segments. This solution is probably good enough, visually almost perfect (haven't "proved" it mathematically, but feels good enough). |
Currently, the Spline from Points node doesn't handle continuity across the start/end point portion of the edge flow. This is what a square looks like when the node is applied, which fails in the top left corner where the start/end points connect:
Instead, this example should look like a symmetrical blob, with the same roundness around all corners.
This task involves updating the spline calculation algorithm, as pointed out by this todo comment.
The text was updated successfully, but these errors were encountered: