bezier package

Helper for Bézier Curves, Triangles, and Higher Order Objects.

Intended to perform basic operations on Bézier objects such as intersections, length / area / etc. computations, subdivision, implicitization and other relevant information.

Plotting utilities are also provided.

class bezier.UnsupportedDegree(degree, supported=())

Custom exception to indicate the given degree is unsupported.

This is intentionally a subclass of a NotImplementedError since it’s intended to indicate a lack of an implementation. For example, Curve.reduce_() uses hard-coded matrices for a small subset of possible degrees, so the implementation is degree-specific:

>>> degree = 5
>>> nodes = np.empty((2, degree + 1), order="F")
>>> curve = bezier.Curve(nodes, degree=degree)
>>> curve.reduce_()
Traceback (most recent call last):
  ...
bezier._py_helpers.UnsupportedDegree: The only degrees supported at this
                                      time are 1, 2, 3 and 4 (degree=5)
Parameters
  • degree (int) – The degree that is not possible to support.

  • supported (Tuple [ int, … ]) – The degrees that are actually supported by the failing method.

degree = None

The degree that the caller attempted to use.

Type

int

supported = None

The degrees supported by the failing method.

Type

Tuple [ int, … ]

class bezier.Surface(*args, **kwargs)

Legacy alias for Bézier Surface class.

This will be deprecated in a future release.

bezier.__version__ = '2020.1.14'

The current version of bezier.

Type

str

bezier.get_include()

Get the directory with .h header files.

Extension modules (and Cython modules) that need to compile against libbezier should use this function to locate the appropriate include directory.

For more information, see Binary Extension.

Returns

include directory that contains header files for the libbezier Fortran library.

Return type

str

bezier.get_lib()

Get the directory with .a / .lib static libraries.

Extension modules (and Cython modules) that need to compile against libbezier should use this function to locate the appropriate lib directory.

For more information, see Binary Extension.

Returns

lib directory that contains static libraries for the libbezier Fortran library.

Return type

str

bezier.get_dll()

Get the directory with the Windows shared library.

Extension modules (and Cython modules) that need to compile against libbezier should use this function to locate the appropriate Windows shared library or libraries (DLLs).

For more information, see Binary Extension.

Returns

extra-dll directory that contains the Windows shared library for the libbezier Fortran library.

Return type

str

Raises

OSError – If this function is used anywhere other than Windows.