Recent Releases of Helper for Bézier Curves, Triangles, and Higher Order Objects
Helper for Bézier Curves, Triangles, and Higher Order Objects - 2024.6.20
libbezzier Changes
Packaging
- Stop building with
-staticon Windows (#311). This is entirely enabled by the amazing delvewheel project (non-static dependencies can now easily be packaged into a built wheel for Python).
Python Changes
Packaging
Documentation
- Add
DEVELOPMENT.rstsection about configuring a shell and compilers for Windows development (#311). This had been a hodge podge of local and remote (CI) development for the last 5+ years, so this a big milestone!
Scientific Software - Peer-reviewed
- Python
Published by dhermes almost 2 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 2023.7.28
Robustness
- Fall back to de Casteljau algorithm for evaluation on high degree curves (#264). Fixed #263. The more efficient
evaluate_multi_vs()function relies on the ability to compute binomial coefficients(n C k)but after(55 C 26)these values cannot be computed in floating point without roundoff and for very large degrees these values overflow.
Python Changes
Packaging
- Switched to delvewheel for repairing Windows wheels (#307). This is similar to how Linux and macOS packaging already work. This is vastly superior to the homegrown approach previously used with
extra-dll. - Dropped support for Python 3.7 and added support for Python 3.10 and 3.11 (#271, #302).
- Add strict check for Python version on source installs. Fixed #278.
- Make missing
BEZIER_INSTALL_PREFIXerror message more helpful. In particular, add a suggestion to setBEZIER_NO_EXTENSIONfor a source only install ifBEZIER_INSTALL_PREFIXcannot be set. Fixed #277. - Use cibuildwheel to automate building wheels as part of release (#308).
Bug Fixes
- Allow the extra DLL directory to be absent on Windows. For binary wheel installs, this directory contains the
libbezierDLL (e.g.bezier.libs\bezier-2a44d276.dll). For pure Python installs, thebezier.libsdirectory will be absent. (#307, #255). Fixed #254. - Bug fix for
clip_range()(doc). Intersections with thet=0/t=1sides of the fat line were not taken into account and a value fors_maxcould be accidentally left unset if the intersections occurred in an order where thes-value decreased throughout (#259).
Breaking Changes
- Removing
Surfacealias for theTriangletype (#252). TheSurfacetype was deprecated (and converted to an alias) in the2020.1.14release.
Additive Changes
- Renaming all \"private\"
_verifyargs toverify(#251). For example, inCurve.intersect()(doc) - Adding provisional support for self-intersection checks in planar curves (#265, #267). Fixed #165 and #171. Supported via
Curve.self_intersections()method. - Added
alphaargument toTriangle.plot()andCurvedPolygon.plot()methods (#296).
Documentation
Scientific Software - Peer-reviewed
- Python
Published by dhermes almost 3 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 2021.2.12
Python Changes
Packaging
- Dropped support for Python 3.6 and added support for Python 3.9 (#246).
Breaking Changes
- Moved non-public / experimental
bezier._clippingmodule tobezier.hazmat.clipping(#225).
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 5 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 2020.5.19
Python Changes
Bug Fixes
- Using
importlib.metadatato locateextra-dllon Windows, caused by the behavior of theconda-suppliedsetuptoolsin Python 3.8 (#208, fixed #206).
Breaking Changes
- Created
bezier.hazmatsubpackage (fixed #170).- Moved non-public
bezier._py_helpersmodule tobezier.hazmat.helpers(#201). - Moved non-public
bezier._algebraic_intersectionmodule tobezier.hazmat.algebraic_intersection(#216). - Moved non-public
bezier._py_curve_helpersmodule tobezier.hazmat.curve_helpers(#218). - Moved non-public
bezier._py_triangle_intersectionmodule tobezier.hazmat.triangle_intersection(#219). - Moved non-public
bezier._py_triangle_helpersmodule tobezier.hazmat.triangle_helpers(#220). - Moved non-public
bezier._py_intersection_helpersmodule tobezier.hazmat.intersection_helpers(#222). - Moved non-public
bezier._py_geometric_intersectionmodule tobezier.hazmat.geometric_intersection(#223).
- Moved non-public
Documentation
- Updated
binary-extensiondoc to refer tobezier.libs(#211). This is based on a change toauditwheelfrom the 3.1.0 release. - Removed
algorithms/algebraic-helpersdocument since thebezier.hazmat.algebraic_intersectionmodule is now fully documented (#216). - Updated from
https://docs.scipy.org/doc/numpytohttps://numpy.orgfor references to the NumPy documentation (#221). - Removed
algorithms/geometric-helpersdocument since the functions and classes there are now fully documented inbezier.hazmat(#223).
Scientific Software - Peer-reviewed
- Python
Published by dhermes about 6 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 2020.2.3
ABI Changes
Packaging
Introduced first-class build and install support for
libbeziervia CMake. Achieved with the following PRs- Added
CMakeLists.txtfiles to enable buildinglibbezierwith CMake (#175). - Added
-DTARGET_NATIVE_ARCH:BOOL=OFFflag to enable portable release builds (#182).
and closed the following issues - Use a shared library (rather than a static library) for
libbezier(#54). - Enable Python installs to be "hybrid-editable" (#56). (This means that the Python files reference the source tree but the built components, i.e.libbezierand_speedup.so, are already built and utilize caching of CMake.) - Use build system other than Python /distutils/setuptools(#62). - Add ability to disable-march=nativeflag to make release builds portable across compatible operating systems (#181).- Added
Python Changes
Additive Changes
Packaging
- Removed build dependency on
gfortranand other heavyweight tools (and hacks) such asnumpy.distutils. Now,libbeziermust be built before the Python package can be installed and the install location must be provided via theBEZIER_INSTALL_PREFIXenvironment variable. Achieved with the following PRs - Switch from
manylinux1tomanylinux2010for built wheels (#178). - Delaying imports of
pkg_resources,scipyandsympyuntil actually needed (if ever) (#194, #195, 38602d8). - Adding
matplotlibtopip install bezier[full](8beb036). - Avoiding
bezier.dllname collision on Windows in wheels distributed on PyPI (#190). Fixed #189.
Breaking Changes
- Removed
bezier.get_dll()helper (#184).
Documentation
- Changed "Read the Docs" landing page to point to
.../stable/documentation (i.e. the last published release) instead of.../latestdocumentation (i.e. the last merged commit). - Making sure CMake installed trees (on Linux, macOS and Windows) are verified in
doctestas part of CI (48e4166). - Making sure
example_*.cABI examples are compiled and run (on Linux and macOS) indoctestas part of CI (ffdcdf7, 9551495, 0766649). - Converting (untested, potentially stale) console codeblocks to
doctest(that get run in CI) for Linux sections of binary extension documentation (#188). Fixed #74.
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 6 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 2020.1.14
Breaking Changes
Documentation
Packaging
- Switched from semantic versioning to calendar versioning.
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 6 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.11.0
Python Changes
Packaging
- Explicit support for Python 3.8 has been added (#161). On Windows this required using the
os.add_dll_directory()function to loadbezier.dll(in earlier Python versions, the DLL directory was added by modifying%PATH%).
New Features
- Loosened type constraints in
Curveconstructor andSurfaceconstructor; now any sequence type is accepted rather than only NumPy arrays (68f7dc7, a8c68a3, f5c7869). Fixed #146. - Added
copyandverifyarguments toCurveconstructor andSurfaceconstructor (#163). Fixed #158. - Added SymPy-based helpers for "exact" representations (#164). Fixed #157.
Internals
- Re-factored non-public modules so that algorithms implemented in pure Python only invoke other algorithms written in pure Python (#160). Previously these algorithms invoked the equivalent Fortran speedup if present for a given function. Fixed #159.
Miscellany
- Moved
*.f90Fortran files out of Python source tree (#152).
ABI Changes
Breaking Changes
Additive Changes
Bug Fixes
- Explicitly handle length 0 curves (with an error) in the
compute_length()Fortran subroutine that is used by theCurve.lengthproperty (a24368f). Fixed #148. - Fixed high-degree error in the
Curve.evaluate()method, via theevaluate_curve_barycentric()Fortran subroutine (5768824). Fixed #156. The code uses(n C (k + 1)) = (n - k) / (k + 1) (n C k)to update the value and(30 - 14) (30 C 14)overflows a 32-bit signed integer.
Documentation
- Updated install instructions to show how to disable the binary extension via
BEZIER_NO_EXTENSION(6262594, 00c1e61). Fixed #147. - Added "Citation" section to landing page (9885063). Fixed #150.
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 6 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.10.0
Python Changes
Breaking Changes
- Support for Python 2.7 has been dropped. With the impending EOL of Python 2.7 on January 1, 2020 many of the
bezierdependencies such asnumpy,scipyandpytesthave dropped support for Python 2.7 in their latest releases. Some changes related to this include:
Build
- Integrating
blackcode formatter into thenox --session lintsession to ensure consistent formatting (e659532). - Fully automating the building of wheels in the
bezier-wheelsproject (recent commits). Built wheels are uploaded to a Google Cloud Storage bucket. - Using the same set of optimal flags for Fortran 77 code (i.e.
.ffiles) that are used for Fortran 90 code (i.e..f90files) (e7eb56e). - Unify
requirements.txtfiles and add notes about why each dependency is required (230814d, 1ae147f, e710ee6). - Changing
impusage toimportlibdue to deprecation of the former (9231d92). Fixed #137. - Ditching the
--check-archsflag in the macOS script for building wheels since we can no longer support 32-bit on macOS due to NumPy (37be384). - Improved dev experience with Docker image used on CircleCI by adding a
.dockerignorefile for faster builds, suggesting--workdirand flag during local dev, settingWHEELHOUSEenvironment variable directly in the container (rather than in the CircleCI settings) and allowing "default" locations for pre-built wheels at/wheelhouseand${HOME}/wheelhouse(08be336, 26acc38, 7634779, f9a8fcf).
Miscellany
- Make some functional test cases more lenient so that they pass on 32-bit CentOS 5, which is used for
manylinux(e7eb56e). This was part of a large effort to fully automate the building of wheels in thebezier-wheelsproject. - Replacing
pypywithpypy3in testing as the only non-CPython "unofficially supported" runtime. (This is part of the drop in support for Python 2.7.) Unfortunately the currently (as of August 2019) released versions ofpypy3are not currently working withnumpy >= 1.16(see numpy/numpy#12740) so thenumpy == 1.15.4version is a pinned dependency.- Specifying the NumPy version in
setup.pybased onimplementation_name(7e9046d). - Add
_pypy_speedup.cbuilt with Cython 0.29.11 because the latest Cython (0.29.13 as of August 2019) corresponds to the versions of NumPy that are incompatible with PyPy (7813e41). - Pinning to
numpy==1.15.4andscipy==1.2.0in wheelhouse for pre-built Docker container (7634779).
- Specifying the NumPy version in
- Added
nox --session validate_functional_test_casessession to ensure that functional test cases always adhere to the JSON schema. - Updated
@slowmarker forpytestbecause it used a deprecated API (46f8b57).
Documentation
- Changing all references to Mac OS X to macOS (b10c2fc, c1c2c6b, 131d17b). As of 10.12, the operating system has changed its name.
- Splitting up
algorithms/helpers. The pre-amble has been moved into thealgorithmslanding page and the geometric and algebraic helpers have been moved into separate docs. (889c913).
Scientific Software - Peer-reviewed
- Python
Published by dhermes almost 7 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.9.0
Documentation
- Documenting the C ABI
libbezier(4608364). Fixed #63. This documentation contains a page for each "module" which corresponds to the underlying Fortran module. Each module documents the routines in the corresponding header file, e.g. the surface document corresponds to thebezier/surface.hheader. Fully working C examples have been added for each routine inbezier/curve.hand for the enum inbezier/status.h. - Adding section about environment variables to development document (5186e24). Fixed #78.
- Remove dependency on
rawgit.com(04d0f8d). The website is being turned down. Fixed #130. - Renaming the "Native Libraries" document as "Binary Extension" (f99db20). In the process, changed most references to the "native" Python extension to instead call it a "binary" extension.
- Added a "Cython
.pxdDeclarations" document (f99db20). Fixed #122. - Moving all Python specific documentation under a specific URL path (3db483b). In particular, moving
-
/reference/...to/python/reference/... -
/python-binary-extension.htmlto/python/binary-extension.html -
/pxd/...to/python/pxd/....
-
- Moving all algorithm specific documentation under a specific URL path (6e9c825). In particular, moving
-
/algorithm-helpers.htmlto/algorithms/helpers.html -
/curve-curve-intersection.htmlto/algorithms/curve-curve-intersection.html
-
ABI Changes
New Features
- Added
surface.h::compute_areahelper that can be used to compute the area of both a surface and a curved polygon (d4d7249).
Breaking Changes
- Removing getters and setters for parameters used during curve-curve intersection (2fda3ae):
-
curve_intersection.h::set_max_candidates -
curve_intersection.h::get_max_candidates
-
- Removing
dimensionfromcurve.h::get_curvature(1e39c0c).
Python Changes
New Features
Non-Public API
- Removing getters and setters for parameters used during curve-curve intersection (2fda3ae):
bezier._geometric_intersection.set_max_candidates()bezier._geometric_intersection.get_max_candidates()
- Removing cached values for
Curve.lengthproperty,Surface.areaproperty andSurface.is_validproperty (34d48d6).
Build
- Renaming
libbezier.dllshared library tobezier.dllon Windows (d17a9bc). This follows the correct convention on Windows. - Adding Python 3.7 support and making it the default version used for testing (e368e9f).
- Dropping support for Python 3.5 (f99db20).
- Adding back
-march=nativefor non-wheel builds (1566019). This way, when installing from source (either via a local checkout or from the source distribution on PyPI) the most optimal machine instructions will be produced. Fixed #99. - Removing all traces of 32-bit support for OS X (d7620ad). This was driven by a decision from the NumPy maintainers.
Miscellany
- Adopted
blackcode formatter (f21b52d). - Adding project URLs and keywords for PyPI (cfb070d).
- Added 20 new surface-surface functional tests (9fd9c1e). See #121 for more information.
- Removed time and memory benchmarks due to flakiness and lack of an environment that could be used for benchmarking (6a30dc2). See #125 to follow discussion on re-enabling such benchmarks.
- Using
DEBUG=Trueenvironment variable when running unit tests and other related tests (d84dffb).
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 7 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.8.0
New Features
- Adding support for surface-surface intersections that have coincident segments shared between each surface (cfa2b93, 0a9645c). See cases:
Adding support for curve-curve intersections that are also points of tangency. This was accomplished by five broad changes to the geometric intersection algorithm:
- Checking if almost-linear curves have disjoint bounding boxes before intersecting the linearized segments (05f0343).
- Adding a "full" Newton iteration for finding
B1(s) = B2(t)when known to be near a solution. In particular, this has special handling for tangencies, which cause a singular Jacobian and make convergence drop from quadratic to linear and stalls out convergence early (13a5be5, 4bac61a). Changing how "bad" linearized segments are handled. After subdividing to approximately linear curve segments, there were two problems which are now being handled in the same way. If the line segments connecting the subdivided curve endpoints
- are parallel, then the algorithm failed with a
PARALLELstatus - intersect outside of the unit interval (for either
sort), the curve-curve candidate was rejected (a small amount,0.5^{16}, of "wiggle" room was allowed outside of[0, 1]).
Now both cases are handled in the same way. First, the subdivided curve segments will have a convex hull check applied (which is more strict than a bounding box check). If their convex hulls do collide, they are treated as a normal intersection of curved segments (4457f64, fe453c3).
- are parallel, then the algorithm failed with a
Using the newly added "full" Newton's iteration for all intersections. Before, a single Newton step was applied after intersection the linearized segments (d06430f).
Changing how a candidate pair of
s-tparameters is added. (c998445). In the previous implementation, a pair was considered a duplicate only if there was a difference of at most 1 ULP from an existing intersection (though this could be toggled viaset_similar_ulps()). Now, the pair is "normalized" so thatsandtare away from0. For example, ifs < 2^{-10}then we use1 - sinstead. (This is perfectly "appropriate" since evaluating a Bézier curve requires using bothsand1 - s, so both values are equally relevant.) Once normalized, a relative error threshold is used.
Four curve-curve functional test cases have gone from failing to passing:
and two surface-surface cases have as well: - 10: 20Q-21Q - 42: 41Q-21Q
In order to support the aforementioned surface-surface cases, special support for "tangent corners" was added (12b0de4).
ABI Changes
Breaking Changes
- Removed
BAD_TANGENTstatus enum (b89b2b1). The case where that failure was issued has now been handled as an acceptableTANGENT_BOTHclassification for surface-surface intersection points. (See theclassify_intersection()function for an example.) - Adding
BAD_INTERIORstatus enum (6348dc6). (This is a breaking change rather than additive because it re-uses the enum value of5previously used byBAD_TANGENT.) This value is used byinterior_combine()in the case that the curved polygon intersection(s) cannot be determined from the edge-edge intersections for a given surface-surface pair. See #101. - Removed
PARALLELstatus enum (fe453c3). Now when doing geometric curve-curve intersection, parallel linearized segments are handled by checking if the convex hulls collide and then (if they do) using a modified Newton iteration to converge to a root. - Adding
BAD_MULTIPLICITYstatus enum (fe453c3). (This is a breaking change rather than additive because it re-uses the enum value of1previously used byPARALLEL.) This is used when Newton's method fails to converge to either a simple intersection or a tangent intersection. Such failures to converge, when already starting near an intersection, may be caused by one of:- The intersection was of multiplicity greater than 2
- The curves don't actually intersect, though they come very close
- Numerical issues caused the iteration to leave the region of convergence
- Removed
ulps_away()(c998445). - Removed
set_similar_ulps()andget_similar_ulps()(c998445).
Surface Changes
- Added
SINGULARstatus enum for cases when a linear system can't be solved due to a singular matrix (4457f64). - Adding
statusas a return value innewton_refine_curve_intersect(). This way, when the Jacobian is singular (which happens at points of tangency), theSINGULARstatus can be returned (4457f64). The old behavior would've resulted in a division by zero.
Non-Public API
- Adding custom linear solver for the
2 x 2case (a3fb476). This is modelled afterdgesvfrom LAPACK.
Python Changes
- (Bug fix) The
0.7.0release brokeSurface.plot()andCurvedPolygon.plot()(when the nodes were transposed, the plotting helpers were not correctly updated). Theadd_patch()helper was fixed to account for the changes in data layout (80bfaaa). - Added custom
UnsupportedDegreeexception to be used by routines that have implementations that are hard-coded for specific degrees (87a1f21). See #103. - Removed
ulps_away()(c998445). - Removed
set_similar_ulps()andget_similar_ulps()(c998445).
Non-Public API
- Returning
coincidentflag from curve-curveall_intersections(ebe6617). - Adding a
TANGENT_BOTHclassification for surface-surface intersection points that are interior to both surfaces at the point of tangency (b89b2b1). This previously failed with aNotImplementedError. - Added
COINCIDENTclassification for surface-surface intersection points that occur on a segment that is coincident on an edges of each surface (8b1c59d). Such points previously failed classification because they were interpreted as being tangent and having the same curvature (because the segments are identical). - Added a
COINCIDENT_UNUSEDclassification (cfa2b93) for cases where coincident segments are moving in opposite directions (i.e. the surfaces don't share a common interior). For example see case 44 (29Q-43Q). - Adding custom linear solver for the
2 x 2case (764e56d). This is modelled afterdgesvfrom LAPACK. - Adding some support for Bézier clipping algorithm (fbed62d, ada4ea3). See the original paper by Sederberg and Nishita for more information.
Scientific Software - Peer-reviewed
- Python
Published by dhermes about 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.7.0
Robustness
- Geometric curve-curve intersection has better handling for cases when the number of intersection candidates grows large (
MAX_CANDIDATES == 64):- First tries to reduce the number of candidates by checking if the actual convex hulls of each segment in a candidate pair intersect. This is a much "finer" check than using the "blunt" bounding box check.
- If the convex hull refinement fails, checks if the curves are coincident, i.e. different segments / parameterizations along the same algebraic curve. This is done by using the
Curve.locate()function to try to project each of the four endpoints onto the other curve and then re-parameterizing each curve onto a common interval.
Data Structures
- Storing
xy-points as columns (rather than rows). This was a very large and breaking change, started in b44af8c. See #51 for more information.
Python Changes
Non-Public API
- Requiring contiguous 1D arrays for Cython functions (9ede37d).
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.6.4
Python Changes
Surface Changes
- Stopped raising
ValueError('At least one value outside of unit interval', s_val, t_val)orValueError('outside of unit interval')when a curve-curve intersection falls barely outside of the parameter space[0, 1](329a59a).
ABI Changes
Surface Changes
- Removed
Status_WIGGLE_FAILenum and re-numbered all largerStatusenum values (by subtracting one) - Changing "wiggle failure" in curve-curve intersection from a non-success status to be a dropped candidate for intersection
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.6.3
Python Changes
Surface Changes
- Changed
RuntimeError('Unexpected number of edges', 11)toRuntimeError('Unknown error has occured.')in the speedup that does surface-surface intersection (35ab5d5). The old error message was a "copy-paste" artifact from thebasic_interior_combine()Python helper.
Build
- Removed a flag (
-march=native) from the build process for thebezier._speedupextension module (e739429). Using the flag caused themanylinuxwheels to be "broken" (see #98).
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.6.2
Python Changes
Documentation
Non-Public API
- Collapsed all Cython-generated modules into a single
bezier._speedupmodule (8bcb319).- This is the change that prompted the release.
- Dropped the five
bezier._HAS_*_SPEEDUPmembers for a singlebezier._HAS_SPEEDUP(this was the previous approach before0.6.0). - Renamed a few of the Cython helper functions to avoid name collision.
- This was done to fix a bug and prevent future bugs. The issue was that a mutable Fortran global (
MAX_CANDIDATES) was being included via an object file in separate extension modules. When one module updated the global, the other module never saw the update (because it was a different copy).
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.6.1
PyPI: https://pypi.org/project/bezier/0.6.1/ Docs: https://bezier.readthedocs.io/en/0.6.1/
Python Changes
Documentation
- Noting that
Surface.intersect()can return a list of eitherCurvedPolygonorSurfaceinstances (16e77d7).
Breaking Changes
- Removing
IntersectionClassificationenum from_status.pxd(4da969e).
Non-Public API
- Adding getters and setters for parameters used during curve-curve intersection (
ef4ebc0):bezier._geometric_intersection.set_max_candidates()bezier._geometric_intersection.get_max_candidates()bezier._geometric_intersection.set_similar_ulps()bezier._geometric_intersection.get_similar_ulps()
ABI Changes
Surface Changes
- Switching from
intto an actual enum for relevant functions with output values that are enums: - Adding getters and setters for parameters used during curve-curve intersection (
ef4ebc0):curve_intersection.h::set_max_candidatescurve_intersection.h::get_max_candidatescurve_intersection.h::set_similar_ulpscurve_intersection.h::get_similar_ulps
Breaking Changes
- Removing inputs
curve_start / curve_endand outputstrue_start / true_endincurve.h::specialize_curve(959c547)
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.6.0
PyPI: https://pypi.org/project/bezier/0.6.0/ Docs: https://bezier.readthedocs.io/en/0.6.0/
Performance Optimizations
- Added recommended performance flags for
gfortranbased on recommendations onfortran90.org(3877982). - Added QUADPACK to use in
curve.f90::compute_length(985a4c0). - Implemented curve-curve intersection completely in Fortran (e.g.
4a8f801) which resulted in a 10x speedup when called from Python. Also implemented surface-surface intersection completely in Fortran, resulting in a 3x speedup.
Python Changes
New Features
- Added
CurvedPolygon._metadatato track where edges originated, e.g. from a surface-surface intersection (871d23d). This is used for sanity checking in functional tests (e253da2). - Made speedup checks specific to the module, not all four. I.e.
bezier._HAS_SPEEDUPwas dropped in favor of five members, e.g._HAS_CURVE_SPEEDUP(d798f66). - Added
bezier.__author__andbezier.__version__attributes. - Added
bezier.get_dll()for Windows (699e39b). - Added
bezier/__config__.pythat addslibbezierto%PATH%on Windows (8538af4). - Fortran / Cython speedups added:
_curve_speedup.pyx::subdivide_nodes_curve_speedup.pyx::newton_refine_curve_speedup.pyx::locate_point_curve_speedup.pyx::elevate_nodes_curve_speedup.pyx::get_curvature_curve_speedup.pyx::reduce_pseudo_inverse_curve_speedup.pyx::full_reduce_curve_speedup.pyx::compute_length_curve_intersection_speedup.pyx::all_intersections_curve_intersection_speedup.pyx::free_curve_intersections_workspace_helpers_speedup.pyx::contains_nd_helpers_speedup.pyx::vector_close_helpers_speedup.pyx::in_interval_helpers_speedup.pyx::ulps_away_surface_speedup.pyx::specialize_surface_surface_speedup.pyx::subdivide_nodes_surface_speedup.pyx::compute_edge_nodes_surface_intersection_speedup.pyx::newton_refine_surface_intersection_speedup.pyx::locate_point_surface_intersection_speedup.pyx::surface_intersections_surface_intersection_speedup.pyx::free_surface_intersections_workspace
Breaking Changes
Curve.intersect()returnss-tparameters rather thanx-yvalues (c309998).Surface.intersect()returns a list with a singleSurfacewhen one of the two surfaces is contained in the other (05b1fd9).Surface.is_validwill only returnTrueif the mapB(s, t)determined by the surface has everywhere positive Jacobian. Previously a negative Jacobian was also allowed (260fb51).- Removed data members from
Curve: - Removed data members from
Surface: - Remove
dimensionargument in_curve_speedup.pyx::elevate_nodessince it can be inferred fromnodes(06501c5).
ABI Changes
New Features
- Fully implemented curve-curve intersection (as
curve_intersection.h::curve_intersections) and surface-surface intersection (assurface_intersection.h::surface_intersections) at the ABI level. - Added the
surface_intersection.hheader file and implementations for the described functions (fafd9ff). - Newly added functions
curve.h::subdivide_nodes_curve(efb3ce6)curve.h::newton_refine_curve(2257344)curve.h::locate_point_curve(2121101,32b0fa9)curve.h::elevate_nodes_curve(b03fc28)curve.h::get_curvature(69cb2f8)curve.h::reduce_pseudo_inverse(7c3db17)curve.h::full_reduce(4abd309)curve.h::compute_length(985a4c0,7e71b20)curve_intersection.h::curve_intersections(c92f98d)curve_intersection.h::free_curve_intersections_workspace(c92f98d)helpers.h::contains_nd(36f4b5e)helpers.h::vector_close(9f3716a)helpers.h::in_interval(3c0af5d)helpers.h::ulps_away(0197237)surface.h::specialize_surface(eb8693e,fcd5bad)surface.h::subdivide_nodes_surface(6027210,4fc5f2a,8beb1ac,0b2b1f3,d27b86f,88c302b)surface.h::compute_edge_nodes(2d02590,f86649a)surface_intersection.h::newton_refine_surface(93c288d)surface_intersection.h::locate_point_surface(325ea47,ca134e6,bf69852)surface_intersection.h::surface_intersectionssurface_intersection.h::free_surface_intersections_workspace
- Added
status.hwith an enum for failure states. Each Fortran procedure that returns a status documents the possible values and if each value is set directly or by a called procedure (9fc8575,c2accf7).
Breaking Changes
- Removed functions
curve.h::specialize_curve_generic(d52453b)curve.h::specialize_curve_quadratic(d52453b)curve_intersection.h::from_linearized(d62e462)curve_intersection.h::bbox_line_intersect(72c0179)curve_intersection.h::linearization_error(4a3378b)curve_intersection.h::segment_intersection(4060590)curve_intersection.h::parallel_different(df3e195)
- Renamed functions
- Replaced
degreewithnum_nodes (== degree + 1)in functions that operate on curves:
Miscellany
- Added documentation for "native extensions" in
DEVELOPMENT(2f9f2c4). - Overhauled
native-librariesdoc with subsections for OS X and Windows (bfa75ee,72005fb, etc.). - Added Fortran unit tests (
758bdd1,e8afba7,3164365, etc.). - Began testing in Mac OS X on Travis (
9ac5e8e,85f7619, etc.). - Added a workaround (
include/bezier/_bool_patch.h) for the missing support forboolin old MSVC versions that are required to work with Python 2.7 (5577178).
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.5.0
PyPI: https://pypi.org/project/bezier/0.5.0/ Docs: https://bezier.readthedocs.io/en/0.5.0/
Performance Optimizations
- Change
wiggle_intervalto returnsuccessbool instead of raising an exception. This allows the implicitization approach to use it without having to use exceptions for flow-control. (Fixes #22.) - Switching Fortran speedups from
f2pyto Cython (this is becausef2pyartificially limits the feature set of Fortran, i.e. user defined types) - Moving some more code to Fortran (e.g.
bbox_line_intersect()3dcf640)
New Features
- Making Fortran features available outside of Python (see Native Libraries)
- C headers for each Fortran module (via
bezier.get_include()) - Cython
.pxddeclarations for all Fortran modules -
libbezierstatic library (viabezier.get_lib())
- C headers for each Fortran module (via
- Implementing
bezier_roots()polynomial root solver for polynomials written in Bernstein basis. (0dd6369)
Miscellany
- Getting
bezierpublished in the Journal of Open Source Science (JOSS). See review. (e6c4536and975ac6b) - Updating error message for
locate()methods and adding a note thatlocate()/evaluate*()are (essentially) inverses. H/T to @pdknsk #36 - Using Fortran-contiguous arrays in
_check_non_simple(). (b06c78e) - Moving most of
Curve.subdivide()andSurface.subdivide()logic into helpers. This is part of an effort to make all helpers take low-level data types rather thanCurves,Surfaces, etc. (34515bdand1fc80e5) - Split
speedup.f90into submodulescurve.f90,surface.f90, etc. (75349b7,dfd6bba,7096a9d,c326c00) - Adding
BEZIER_JOURNALoption tosetup.py. This stores a record of compiler commands invoked during installation. See Native Libraries for more details. (3d832e7andc64a97a)
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 8 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.4.0
PyPI: https://pypi.org/project/bezier/0.4.0/ Docs: https://bezier.readthedocs.io/en/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
_verifyswitch toSurface.locate()andCurve.intersect()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
0or1. (4a8458c)
New Features
- Adding optional
strategyargument (one of geometric or algebraic) toSurface.intersect()- Added "algebraic"
IntersectionStrategyvia curve implicitization (reference)
- Added "algebraic"
- Adding
Curve.reduce_()which acts as a partial inverse toCurve.elevate(). 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
showkeyword fromCurve.plot(),Surface.plot()andCurvedPolygon.plot() - Adding
colorkeyword toCurve.plot() - Adding
alphakeyword toCurve.plot() - (Breaking change) Splitting the
Surface.evaluate_multi()method intoSurface.evaluate_barycentric_multi()andSurface.evaluate_cartesian_multi() - Adding
__dict__helpers onCurve,CurvedPolygonandSurface. These are@propertys intended only for REPL use, since classes with__slots__no longer have a__dict__attribute.
Miscellany
- Adding
IntersectionClassificationto 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. Removingmatplotlibas a dependency.
Scientific Software - Peer-reviewed
- Python
Published by dhermes almost 9 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.3.0
PyPI: https://pypi.org/project/bezier/0.3.0/ Docs: http://bezier.readthedocs.io/en/0.3.0/
Performance Optimizations
- Adding
__slots__for all classes - Removing all usage of
@propertycalls from internal callers (to avoid function call overhead) Avoiding un-necessary data copying, e.g.
nodes[[0], :]creates a copy butpython nodes[0, :].reshape((1, 2))does not (more details)
Adding
_verifyswitches to selectively disable overly defensive value checking. Added toCurvedPolygonconstructor,Surface.evaluate_barycentric(),Surface.evaluate_cartesian(),Surface.evaluate_multi()andSurface.intersect(). Internal callers with already verified data now skip verification stepsBailing out early if surface bounding boxes are disjoint in
Surface.intersect()
Breaking Changes
- Requiring
degreeinCurveandSurfaceconstructors, but addingCurve.from_nodes()andSurface.from_nodes()factories to accept nodes only (computing the degree in the constructor every time is a waste of flops, especially if the caller knows the degree) - Removing public
Curve.copy()andSurface.copy() - Removing custom equality checks for
CurveandSurfaceobjects. The previous implementation did not factor in all relevant values - Returning
1xDarrays instead of flattenedD-dimensional 1D arrays fromCurve.evaluate(),Surface.evaluate_barycentric(),Surface.evaluate_cartesian(), and related helpers - Renaming
Intersection.left/rightasfirst/second(They were poorly named originally, since "left" and "right" were in reference to where they were used in code, not geometry. This class is not part of the public interface, but it is documented.)
Bug Fixes
- Handling cases where one corner of a surface touches another but their interiors don't intersect (in
Surface.intersect()). Addingignored_cornerclassification to handle these curve-curve intersecions that don't contribute to a surface-surface intersection - Throwing exception in
Curve.locate()when the subdivided intervals are very far apart (#13) - Improving
Surface.is_validby considering the signs of the Jacobian determinant at corner nodes (#12)
Miscellany
- Adding possible strategy to avoid linear convergence in
newton_refine() - Adding AppVeyor configuration to make sure there are no Windows issues, testing exclusively with
condainstall - Updating generated images with
matplotlib2.0
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 9 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.2.1
PyPI: https://pypi.org/project/bezier/0.2.1/ Docs: http://bezier.readthedocs.io/en/0.2.1/
- Added
Curve.locate()and_curve_helpers.newton_refine()helper - Adding optional
colortoSurface.plot() - Adding
Surface.elevate()for degree elevation - Fixing nodes defining the self-intersecting curve in
curve-curve-intersection(no code inbezierwas broken / fixed, just "bad" docs) - Allow wiggle outside of
[0, 1]when intersecting linearizations infrom_linearized() - Collapsing almost-same parameter values in
intersect_one_round()(viafrom_linearized()). Previously checked for bitwise equality and relied on checking values at the boundary of a subdivided interval - Adding non-public
bezier._plot_helpersmodule
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 9 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.2.0
PyPI: https://pypi.org/project/bezier/0.2.0/ Docs: http://bezier.readthedocs.io/en/0.2.0/
- Primary feature:
Surface.intersect()added - To support intersection, needed
CurvedPolygon, i.e. an object defined only by its curved sides (whereas aSurfacemay have interior control points) Curve.specializefor chopping aCurveat arbitrary parameter values (this is also used in surface-surface intersection)- Added images to most documented functions and methods to illustrate the concept at hand. For example
classify_intersectionhas seven images to enumerate all of the possible cases covered in the algorithm. - Added
Surface.locate(), made possible bynewton_refine - Added Algorithm Helpers doc to try to explain some of the core algorithms at work (not all are documented yet). Some of this content was previously documented in the
bezier.curvemodule, but was moved. Since, documentation has been added forget_curvature,newton_refine(for surfaces),classify_intersection(to determine how two curves interact while intersecting) and for some helper classes. - Added
Surface.base_x,Surface.base_yandSurface.widthproperties to allow tracking a sub-surface during the subdivision process (this is an analogue to theCurve.startandCurve.endproperties) - Added
Curve.edge_index,Curve.next_edgeandCurve.previous_edgeproperties to allow tracking when curves are actually the sides of aSurface
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 9 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.1.1
PyPI: https://pypi.org/project/bezier/0.1.1/ Docs: http://bezier.readthedocs.io/en/0.1.1/
Changes:
- Adding Curve.elevate() for degree elevation
- Upgrading curve-curve intersection algorithm to ignore parallel line segments that don't meet (rather than throwing NotImplementedError)
- Making segment_intersection() return a success bool instead of raising NotImplementedError on failure
- Updating docs for newton_refine() with two examples and making parallel_different() a publicly documented function (as a partner to segment_intersection())
- Adding some more examples / failures to curve-curve-intersection doc
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 9 years ago
Helper for Bézier Curves, Triangles, and Higher Order Objects - 0.1.0
Second Release: https://pypi.org/project/bezier/0.1.0/ Docs: http://bezier.readthedocs.io/en/0.1.0/
Primary changes since previous release (0.0.1) are related to curve-curve intersection. See the intersection docs for examples and more information.
Scientific Software - Peer-reviewed
- Python
Published by dhermes over 9 years ago