Skip to content
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

Closed all-smooth shapes not smooth #6

Open
terryspitz opened this issue Jul 23, 2020 · 1 comment
Open

Closed all-smooth shapes not smooth #6

terryspitz opened this issue Jul 23, 2020 · 1 comment

Comments

@terryspitz
Copy link

The following closed shape with three smooth point and no tangents doesn't appear smooth at the first point:

{"subpaths":[{"closed":true,"pts":[{"x":223.86,"y":168.2,"c":1},{"x":483.06,"y":64.2,"c":1},{"x":491.86,"y":273,"c":1}]}]}

Whereas setting explicit tangents on one point makes all points properly smooth.

{"subpaths":[{"closed":true,"pts":[{"x":223.86,"y":168.2,"c":1},{"x":483.06,"y":64.2,"c":1},{"x":491.86,"y":273,"c":1,"t":2.393}]}]}

@terryspitz
Copy link
Author

I think a fix is to average the first and last ths after fixing endpoint tangents in iterdumb:

            let avgth = (_ths[0] + _ths[n - 1]) / 2.
            _ths[0] = avgth
            _ths[n - 1] = avgth
         }

terryspitz added a commit to terryspitz/dactyl-font that referenced this issue Jul 26, 2020
Implement LineToCurve and CurveToLine in splines
Fix curves including all smooth shapes (reported at raphlinus/spline-research#6)
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

No branches or pull requests

1 participant