title: Defining BSpline in SciPy knowing its degree, control points, knots, and weights
body: <p>I am trying o re-create a spline curve defined in STEP geometry (entity &quot;B_SPLINE_CURVE_WITH_KNOTS&quot;) for later evaluation using SciPy, knowing its <em>degree</em>, <em>control points</em>, <em>knots</em>, and <em>weights</em>. If needed,I could also have spline starting and ednding point coordinates. I expect not all of those inputs are mandatory for the spline definition.</p>
  <p>Class BSpline in SciPy requires <em>knots</em>, <em>spline coefficients</em> and <em>degree</em>. Obiously, what I miss here are spline coefficients. <strong>Is there a simple way (e. g. using SciPy functions) to compute the <em>spline coefficients</em>, from inputs I have?</strong></p>
  <p>If someone wanted me to be more speciffic, here are example data:</p>
  <pre><code>'knots': [0.0, 0.25, 0.5, 0.75, 1.0],  
  'degree': 3,  
  'weights': [4.0, 1.0, 1.0, 1.0, 4.0],  
  'controlPointsCoords': [ 
  [0.0, 37.5, -18.0],  
  [0.0, 37.5, -18.11781],  
  [0.0, 37.54686, -18.35337],  
  [0.0, 37.74703,-18.65297],  
  [0.0, 38.04663, -18.85314],  
  [0.0, 38.28219, -18.9],  
  [0.0, 38.4, -18.9]
  ]
  
  </code></pre>
  <p>Thanks.</p>