Skip to content

Conversation

@scottshambaugh
Copy link
Contributor

PR summary

This speeds up Path.get_extents which calls these bezier operations by a factor of 4-5x.

There are two changes here:

  • We can hardcode the coefficient matrices for degrees up to 4, which is all we use anyway
  • Instead of np.roots which does expensive eigenvalue decomposition, we can take advantage of the fact that we are only looking for roots on the [0, 1] interval and just do bisection for degree >= 3. Or we can calculate exactly for degree == 2. These both end up being much faster.

PR checklist

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant