Yes, after explicitly specifying "knot" attribute the curve is drawn properly. Could you please tell me how to calculate knots using degree and number of points?

Prashant

Your raw code specified a Nurbs curve of order 3 (so polynomial degree 2, a quadratic curve), and set 5 control points. Since the 'knot' attribute was not specified, I assume you relied on the default.

Does the code get the behavior you expect if you explicitly specify a "knot" attribute ? ( for example: