Surface trimming using a curve

Hello!

I’m having the following problem:

First I create an opennurbs surface with the following settings:

// dimension, rational, orderC, orderV, countC, countV
ON_NurbsSurface nurbs(3, false, 3, 3, 2, 2);

After this I add four control vertices to create a square, and then I clamp it.

Then, I create a curve:

// dimension, rational, order, cv_count
ON_NurbsCurve curve(2, false, 3, 9);

I add necessary CVs and weights to form a circle and then I clamp it too.

The problem that I’m having is:
When I use the settings above, and try to trim the surface with the curve, (using pcl library function: nurbs::Triangulation::convertTrimmedSurface2PolygonMesh()) I get this result:

https://postimg.org/image/5fo3qdnbv/

But when I decrease the order of the nurbs surface (orderC & orderV) to 2, I get correct results:

https://postimg.org/image/u2b6s4uk5/

I know I’m using a function outside opennurbs, but does anyone have an idea why I’m getting this result?

Kind regards,

Elias.

Nobody here (McNeel) is familiar with that library - sorry.

Thank you.