0.4.0
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 toSurface.locate()
(doc) andCurve.intersect()
(doc) to selectively disable overly defensive value checking. (Making sure to use this switch during “internal” computation.) - Making sure NumPy arrays are Fortran-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()
andSurface.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
or1
. (4a8458c)
New Features
- Adding
optional
strategy
argument (one of geometric or algebraic) to theSurface.intersect()
method- Added “algebraic”
IntersectionStrategy
enum via curve implicitization (reference)
- Added “algebraic”
- Adding
Curve.reduce_()
method which acts as a partial inverse toCurve.elevate()
method. It is only a complete inverse when a curve is degree-elevated, otherwise it returns the “best” reduced form (in the least squares sense).
Interface Changes
- (Breaking change)
Removing
show
keyword fromCurve.plot()
(doc),Surface.plot()
(doc) andCurvedPolygon.plot()
(doc) - Adding
color
keyword toCurve.plot()
method - Adding
alpha
keyword toCurve.plot()
method - (Breaking change)
Splitting
the
Surface.evaluate_multi()
method intoSurface.evaluate_barycentric_multi()
(doc) andSurface.evaluate_cartesian_multi()
(doc) - Adding
__dict__
helpers onCurve
,CurvedPolygon
andSurface
. These are@property
s intended only for REPL use, since classes with__slots__
no longer have a__dict__
attribute.