Registry / ai-ml / geomdl

geomdl

JSON →
library5.4.0pypypi✓ verified 86d ago

Object-oriented B-Spline and NURBS evaluation library for Python. Current version is 5.4.0, released in December 2022. Maintenance mode with irregular releases.

pip install geomdl
INSTALL
IMPORT
SIG · GEOMDL
G
geomdl
ai-mlpythonv5.4.0
Install
1.6s avg
Import
70ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.074s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.066s · 20MB
17MB installed
● package 17MB
Code
Verified usage

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

BSpline
from geomdl import BSpline
from geomdl.BSpline import BSpline
BSpline is a module, the class is inside it
NURBS
from geomdl import NURBS
from geomdl.NURBS import NURBSCurve
NURBS is a module; use NURBS.Curve() or NURBS.Surface()
fitting
from geomdl import fitting
from geomdl.fitting import approximate_surface
fitting is a module, not a function; access functions as fitting.approximate_surface()

Create and evaluate a B-Spline curve using the geomdl library.

from geomdl import BSpline from geomdl import knotvector from geomdl import utilities # Create a 3D B-Spline curve curve = BSpline.Curve() curve.degree = 3 curve.ctrlpts = [[0, 0, 0], [1, 2, 0], [3, 1, 0], [4, 2, 0], [5, 0, 0]] curve.knotvector = knotvector.generate(curve.degree, len(curve.ctrlpts)) curve.delta = 0.01 curve.evaluate() # Print evaluated points for pt in curve.evalpts: print(pt)
Debug
Known issues
breakingIn version 5.x, the API changed significantly from 4.x. The old `geomdl.NURBS` module no longer exists; use `geomdl.BSpline` and `geomdl.NURBS` as separate modules.
fix
Update imports: replace `from geomdl import NURBS` with `from geomdl import BSpline` for B-spline, or keep `from geomdl import NURBS` for NURBS-specific (but the class names changed).
affects: >=5.0.0
gotchaThe knotvector must be generated explicitly using `knotvector.generate()`. Forgetting to do so leads to an incomplete curve or error.
fix
Always generate knotvector after setting control points: `curve.knotvector = knotvector.generate(curve.degree, len(curve.ctrlpts))`.
affects: all
gotchaThe 'delta' parameter controls evaluation step size. Setting it too large yields jagged curves; too small may cause performance issues.
fix
Use a reasonable delta (e.g., 0.01 for a parameter range [0,1]) and adjust based on application.
affects: all
deprecatedThe `vis` module for visualization is deprecated in favor of `matplotlib` or `plotly` backends.
fix
Use `from geomdl.visualization import VisMPL` or `VisPlotly` instead of the old `vis` module.
affects: >=5.3.0
Errors
Common errors & fixes
AttributeError: module 'geomdl' has no attribute 'NURBS'
Incorrect import path; NURBS is now a submodule, not a direct attribute.
fix
Use `from geomdl import NURBS` or `import geomdl.NURBS`.
TypeError: curve() takes no arguments
Attempting to instantiate a class directly from the module (e.g., `BSpline.Curve()` is correct, but `BSpline()` is the module, not the class).
fix
Use `from geomdl import BSpline` then `curve = BSpline.Curve()`.
ModuleNotFoundError: No module named 'geomdl.vis'
The vis module was removed in newer versions.
fix
Use `from geomdl.visualization import VisMPL` instead.
ValueError: knotvector of length 8 is not appropriate for degree 3 with 5 control points
Knot vector length must equal number of control points + degree + 1. Generated using helper.
fix
Use `knotvector.generate(degree, num_ctrlpts)` to generate correct knot vector.
Upgrade
Version history
5.4.0latest on PyPI · released May 23, 2025
Audit
Dependencies
numpyoptionalRequired for array operations
matplotliboptionalRequired for visualization
plotlyoptionalAlternative visualization backend
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
geomdl — pip install geomdl · libregistry