cleanup to avoid linting issues
parent
a2b62fc011
commit
413a2864f6
|
@ -1,17 +1,23 @@
|
||||||
"""The goal of this gist is to show how to compute many points on a path
|
""" An example of how to speed up point() calculations with vectorization.
|
||||||
|
|
||||||
|
The goal of this gist is to show how to compute many points on a path
|
||||||
quickly using NumPy arrays. I.e. there's a much faster way than using, say
|
quickly using NumPy arrays. I.e. there's a much faster way than using, say
|
||||||
[some_path.point(t) for t in many_tvals]. The example below assumes the
|
[some_path.point(t) for t in many_tvals]. The example below assumes the
|
||||||
`Path` object is composed entirely of `CubicBezier` objects, but this can
|
`Path` object is composed entirely of `CubicBezier` objects, but this can
|
||||||
easily be generalized to paths containing `Line` and `QuadraticBezier` objects
|
easily be generalized to paths containing `Line` and `QuadraticBezier` objects
|
||||||
also.
|
also.
|
||||||
|
|
||||||
Note: The relevant matrix transformation for quadratics can be found in the
|
Note: The relevant matrix transformation for quadratics can be found in the
|
||||||
svgpathtools.bezier module."""
|
svgpathtools.bezier module.
|
||||||
|
"""
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from svgpathtools import *
|
from svgpathtools import bezier_point, bpoints2bezier, polynomial2bezier, Path
|
||||||
|
|
||||||
|
|
||||||
class HigherOrderBezier:
|
class HigherOrderBezier:
|
||||||
|
"""Bezier curve of arbitrary degree"""
|
||||||
def __init__(self, bpoints):
|
def __init__(self, bpoints):
|
||||||
self.bpts = bpoints
|
self.bpts = bpoints
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue