How to sample 3D points to visualize a B-spline surface? Given that I have implemented a function called calc_bspline_surf() in C, and that function has the following declaration:

calc_bspline_surf(ctrlnet, p, q, U, V, u, v)
/*
  ctrlnet --&gt; control net of B-spline surface
  p, q --&gt; degree of B-spline surface
  U, V --&gt; the knots vector in two directions
  u, v --&gt; parameter pair
*/


So for a pair of parameters {u, v}, corresponding B-spline surface coordinate could be generated via calling function calc_bspline_surf(u, v).

Here is a solution that sampling the 3D points uniformly in two direction

for u = {0, 0.05, ..., 1}
    for v= {0, 0.05, ..., 1}
       calc_bspline_surf(u, v)




However, how many 3D-points I need to sample? Is there classical sample strategy?
Based on your linked question, the problem appears to be that you don't get enough samples in highly curved areas of the surface. You could increase the sample density everywhere, but then you oversample the flatter areas and it becomes too slow.

So, you need to increase the sample density locally in areas where it's needed. A conceptually simple algorithm for this is adaptive refinement. You would start out with a uniform sample grid in UV space. Then, detect grid squares in which the curvature is too high for the grid spacing (above some threshold), and subdivide them, adding additional samples in between the existing ones. This process can be repeated recursively on the new, smaller grid squares, subdividing as finely as the surface requires. You can tune the curvature threshold to balance fidelity versus performance.

Since B-splines (NURBS) are based on rational functions, I would guess that the maximum curvature in a region can be found (or at least bounded) analytically. This would be ideal, if possible, since it would avoid the problem of missing a small high-curvature area if none of the initial grid points happen to land in it. However, in a pinch the curvature can be estimated by looking at the sample points you've evaluated. For instance, if $p_1, p_2, p_3$ are three sample points collinear in UV space, they should be close to collinear as well, if the surface is adequately sampled. So, you could for instance evaluate
$$\frac{\|p_2 - p_1\| + \|p_3 - p_2\|}{\|p_3 - p_1\|}$$
where the double bars mean vector length. If this is greater than some threshold value such as 1.1 or 1.5 (note that 1.0 would be perfectly flat), then you would subdivide the area between these points.