{"id":28159,"library":"rust-nurbs","title":"rust-nurbs","description":"A Python API for evaluation of Non-Uniform Rational B-Splines (NURBS) curves and surfaces, implemented in Rust for performance. Current version: 0.28.0. Released approximately every few months.","status":"active","version":"0.28.0","language":"python","source_language":"en","source_url":"https://github.com/Maple-Lang/rust-nurbs","tags":["nurbs","curves","surfaces","geometry","rust","high-performance"],"install":[{"cmd":"pip install rust-nurbs","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Package name uses underscore, not hyphen.","wrong":"from rustnurbs import NurbsCurve","symbol":"NurbsCurve","correct":"from rust_nurbs import NurbsCurve"},{"note":"Class name uses camel case with 'Nurbs' not 'NURBS'.","wrong":"from rust_nurbs import NURBSSurface","symbol":"NurbsSurface","correct":"from rust_nurbs import NurbsSurface"}],"quickstart":{"code":"from rust_nurbs import NurbsCurve\nimport numpy as np\n\n# Define control points (4 points, 3D)\ncontrol_points = np.array([[0.0, 0.0, 0.0],\n                           [1.0, 2.0, 0.0],\n                           [3.0, 3.0, 0.0],\n                           [4.0, 0.0, 0.0]])\n\n# Create a degree 3 NURBS curve with uniform knot vector and weights\ncurve = NurbsCurve(control_points, degree=3)\n\n# Evaluate at parameter u=0.5\npoint = curve.evaluate(0.5)\nprint(point)","lang":"python","description":"Create a NURBS curve, evaluate at a parameter."},"warnings":[{"fix":"Ensure control_points etc. are created with dtype=np.float64 or cast via .astype(float).","message":"All input arrays (control_points, knots, weights) must be of type float (e.g., numpy float64). Integer arrays cause silent type coercion errors.","severity":"gotcha","affected_versions":"<=0.28.0"},{"fix":"Use np.linspace(0,1,100) for multiple evaluations.","message":"The evaluate method expects a single float or array-like of floats. Passing a Python list may work but using numpy array is recommended for performance.","severity":"gotcha","affected_versions":"<=0.28.0"},{"fix":"Check knot_vector[i+1] >= knot_vector[i]. Use np.sort if needed.","message":"Knot vector must be non-decreasing. If you supply a custom knot vector with duplicate knots at ends, ensure it is strictly non-decreasing. Errors are not descriptive.","severity":"gotcha","affected_versions":"<=0.28.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Reduce degree or increase control points. Example: 4 control points -> degree <= 3.","cause":"Degree too high for provided number of control points. For a curve with n control points, degree must be <= n-1.","error":"ValueError: The degree must be less than the number of control points."},{"fix":"Convert input to numpy array: control_points = np.array(control_points_list)","cause":"rust-nurbs requires numpy arrays, Python lists are not automatically converted.","error":"TypeError: expected a numpy array, got list"},{"fix":"For n control points and degree d, knot vector length must be n + d + 1.","cause":"Custom knot vector length mismatch.","error":"ValueError: The number of knots must equal number of control points + degree + 1."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}