Suppose you have a nurbs_surf as:
You can then convert it to bezier patches according to the span_index.
my question is that does openNURBS provide topological information about these bezier patches? for example what are the neighbouring bezier patches and etc?
No it does not. But it shouldn't be hard to keep track of neighboring patches yourself.
ON_NurbsSurface srf = ...;
for (u = 0; u <= srf.CVCount(0)-srf.Order(0); u++)
for (v = 0; v <= srf.CVCount(1)-srf.Order(1); v++)
if (srf.ConvertSpanToBezier(u, v, bez))
Thanks. But how can I figure out if the current bez (in the nested loop) is a neighbour of the previous bez or not?
Perhaps you should store the results in a 2-d array. Or, store the results in some custom data structure that also maintains the indices of its neighbors.
I rephrase my question. Suppose I have 2 bezier patches
How can I tell if these 2 are neighbours or not.
Like I said, openNURBS does not provide topological information for this. If you wnat to keep track of which patches are neighbors, you will have to do it yourself.
Not sure how to make this more clear...
Thanks very much. Your help is much appreciated.