{"id":21378,"library":"geomdl","title":"geomdl","description":"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.","status":"active","version":"5.4.0","language":"python","source_language":"en","source_url":"https://github.com/orbingol/NURBS-Python.git","tags":["b-spline","nurbs","curves","surfaces","cad","cagd"],"install":[{"cmd":"pip install geomdl","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for array operations","package":"numpy","optional":true},{"reason":"Required for visualization","package":"matplotlib","optional":true},{"reason":"Alternative visualization backend","package":"plotly","optional":true}],"imports":[{"note":"BSpline is a module, the class is inside it","wrong":"from geomdl.BSpline import BSpline","symbol":"BSpline","correct":"from geomdl import BSpline"},{"note":"NURBS is a module; use NURBS.Curve() or NURBS.Surface()","wrong":"from geomdl.NURBS import NURBSCurve","symbol":"NURBS","correct":"from geomdl import NURBS"},{"note":"fitting is a module, not a function; access functions as fitting.approximate_surface()","wrong":"from geomdl.fitting import approximate_surface","symbol":"fitting","correct":"from geomdl import fitting"}],"quickstart":{"code":"from geomdl import BSpline\nfrom geomdl import knotvector\nfrom geomdl import utilities\n\n# Create a 3D B-Spline curve\ncurve = BSpline.Curve()\ncurve.degree = 3\ncurve.ctrlpts = [[0, 0, 0], [1, 2, 0], [3, 1, 0], [4, 2, 0], [5, 0, 0]]\ncurve.knotvector = knotvector.generate(curve.degree, len(curve.ctrlpts))\ncurve.delta = 0.01\ncurve.evaluate()\n\n# Print evaluated points\nfor pt in curve.evalpts:\n    print(pt)","lang":"python","description":"Create and evaluate a B-Spline curve using the geomdl library."},"warnings":[{"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).","message":"In 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.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Always generate knotvector after setting control points: `curve.knotvector = knotvector.generate(curve.degree, len(curve.ctrlpts))`.","message":"The knotvector must be generated explicitly using `knotvector.generate()`. Forgetting to do so leads to an incomplete curve or error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use a reasonable delta (e.g., 0.01 for a parameter range [0,1]) and adjust based on application.","message":"The 'delta' parameter controls evaluation step size. Setting it too large yields jagged curves; too small may cause performance issues.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from geomdl.visualization import VisMPL` or `VisPlotly` instead of the old `vis` module.","message":"The `vis` module for visualization is deprecated in favor of `matplotlib` or `plotly` backends.","severity":"deprecated","affected_versions":">=5.3.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from geomdl import NURBS` or `import geomdl.NURBS`.","cause":"Incorrect import path; NURBS is now a submodule, not a direct attribute.","error":"AttributeError: module 'geomdl' has no attribute 'NURBS'"},{"fix":"Use `from geomdl import BSpline` then `curve = BSpline.Curve()`.","cause":"Attempting to instantiate a class directly from the module (e.g., `BSpline.Curve()` is correct, but `BSpline()` is the module, not the class).","error":"TypeError: curve() takes no arguments"},{"fix":"Use `from geomdl.visualization import VisMPL` instead.","cause":"The vis module was removed in newer versions.","error":"ModuleNotFoundError: No module named 'geomdl.vis'"},{"fix":"Use `knotvector.generate(degree, num_ctrlpts)` to generate correct knot vector.","cause":"Knot vector length must equal number of control points + degree + 1. Generated using helper.","error":"ValueError: knotvector of length 8 is not appropriate for degree 3 with 5 control points"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}