Registry / data / bezier

bezier

JSON →
library2024.6.20pypypi✓ verified 84d ago

Helper for Bézier Curves, Triangles, and Higher Order Objects. Pure Python and compiled backend for computing with Bézier curves, triangles, surfaces, and volumes. Current version 2024.6.20, requires Python >=3.10. Released approximately yearly since 2017.

pip install bezier
INSTALL
IMPORT
SIG · BEZIER
B
bezier
datapythonv2024.6.20
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BezierCurve
from bezier import Curve
from bezier import BezierCurve
Class named Curve, not BezierCurve, since v0.9.0
Triangle
from bezier import Triangle
from bezier import Surface
Surface renamed to Triangle in v2020.1.14
intersections
from bezier import intersection_curves_curves
from bezier import intersect
Function renamed to intersection_curves_curves

Create and evaluate a quadratic Bézier curve defined by three control points.

import numpy as np from bezier import Curve nodes = np.asfortranarray([ [0.0, 0.5, 1.0], [0.0, 1.0, 0.0], ]) curve = Curve(nodes, degree=2) print(curve.evaluate(0.5))
Debug
Known issues
breakingSurface class renamed to Triangle in v2020.1.14. Code using `Surface` will break.
fix
Replace `Surface` with `Triangle` in imports and usage.
affects: <2020.1.14
gotchaNodes array must be Fortran-contiguous (column-major). Use `np.asfortranarray` or ensure array is C-contiguous with correct shape.
fix
Always pass nodes as Fortran-contiguous arrays: `nodes = np.asfortranarray(...)`
affects: all
deprecatedPython 3.9 support dropped, requires >=3.10 as of v2024.6.20.
fix
Upgrade Python to 3.10 or later.
affects: >=2024.6.20
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'bezier'
Package not installed or installed in wrong environment.
fix
Run `pip install bezier` in the correct Python environment.
ValueError: nodes must be 2D array (num_axes, num_nodes)
Nodes array not shaped as (num_axes, num_nodes) or not Fortran-contiguous.
fix
Ensure nodes is 2D with shape (dims, points) and convert to Fortran order using `np.asfortranarray(nodes)`.
Upgrade
Version history
2024.6.20latest on PyPI · released Jun 21, 2024
Audit
Dependencies
numpyrequiredRequired for array operations and geometry computations
Agent activity
18 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
bezier — pip install bezier · libregistry