'Exporting BSpline/NURBS control polygon and Knot vectors from Blender
Given a Blender file with one BSpline/NURBS surface (for example, Add -> Surface -> NURBS Sphere), I'm interested in exporting its control polygon (the 3D points which define it) and its Knot vector.
The exact format is less important, as long as it is text. (I tried exporting to OBJ, but got a triangulated approximation to the sphere, in stead of coefficients and points.)
Any help/hints would be greatly appreciated.
Solution 1:[1]
If the "Endpoint" option is unchecked, the knot vector is a linear interpolation between zero and one. For example, a 7 point curve with degree 3 has a knot vector of [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.8, 1.0].
If the "Endpoint" option is checked, then the knot vector starts with D+1 values of 0.0, end with D+1 values of 1.0, and the remaining values linearly interpolated between zero and one, where D is the degree of the curve. For example, a 7 point curve with degree 3 has a knot vector of [0.0, 0.0, 0.0, 0.0, 0.4, 0.5, 0.6, 1.0, 1.0, 1.0, 1.0]
If "Circular" is checked, Blender acts as if the first D points are appended to the end of the curve, where D is the curve degree, and the "Endpoint" option has no effect.
Found this out by exporting the curves to Wavefront OBJ with the "Curves as NURBS" option checked. The knot vector is represented as the param u directive.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Colonel Thirty Two |
