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

clip splines don't dash them #95

Open
gordonwoodhull opened this issue Dec 17, 2018 · 1 comment
Open

clip splines don't dash them #95

gordonwoodhull opened this issue Dec 17, 2018 · 1 comment

Comments

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Dec 17, 2018

Using stroke-dasharray and stroke-dashoffset in order to leave space for arrowheads/arrowtails is clever and maybe efficient.

But it's still buggy, especially during animations, and of course it breaks use of nodeStrokeDashArray irretrievably (duh!)

We should probably just break the spline. Currently we don't have a good function to break a spline at a certain length, only t. getPointAtLength is neat but doesn't provide the spline pieces.

We do bisection in order to find a point at an certain distance (should be close to the same thing) for the marker orientation, and bezier_point just discards the split spline. So that's probably where to grow.

A further complication is that we should consider the possibility that there may be a bezier segment shorter than the arrowhead (more likely with compound/multiple arrowheads).

@gordonwoodhull
Copy link
Contributor Author

This is fixed on the chop-splines branch, except for the last case. I'm wary of bisection but everything I've read seems to indicate that numerical methods are the best you can do. Technically it is more exact since we can do the straight-line distance, and the arrowhead is straight. It still spooks me though, so I'm holding it for the next release.

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