There is a newer version of this record available.

Software Open Access

dhermes/bezier: 0.4.0

Danny Hermes


Performance Optimizations
  • Adding Fortran speedups for many crucial computation helpers including
    • intersecting line segments
    • (vectorized) Horner's method for evaluating a Bézier curve at multiple parameters at once
    • (vectorized) Horner's method for evaluating a Bézier surface
    • computing "linearization error" (how close a curve is to a line)
    • specializing a Bézier curve to a sub-interval
    • using Newton's method to refine a curve-curve intersection
  • Adding _verify switch to Surface.locate() and Curve.intersect() to selectively disable overly defensive value checking. (Making sure to use this switch during "internal" computation.)
  • Making sure NumPy arrays are Fortan-contiguous as often as possible (e.g. snippets and source, via np.asfortranarray()). This is to avoid (and emphasize) a non-trivial overhead when passing a C-contiguous array to a Fortran function. (03a7242, 6064e4c, f1804f4)
  • Using Horner's method in Curve.evaluate_multi() and Surface.evaluate_barycentric(), rather than inferior (sometimes non-vectorized) approaches (dee8181, 2611e64)
  • Made surface-surface intersection more resilient / lenient for corner intersections. For "nearby" intersections, parameter values can be rounded to 0 or 1. (4a8458c)
New Features Interface Changes Miscellany
  • Adding IntersectionClassification to docs (ref)
  • Moving most plotting into a dedicated module. More importantly, importing plotting helpers at run-time rather at import time. So if computational code never plots, it won't eat the import cost of matplotlib. Removing matplotlib as a dependency.

Files (3.1 MB)
Name Size
dhermes/ md5:544f2949f54aacd9d913efe4c5314e7f 3.1 MB Download


Cite as