I am trying to create breps with NurbsSurfaces with data (exported) from another modeling application. I tried, creating the brep from scratch but it proved very difficult to create a valid brep from raw data. But if I try using built in methods for creating and trimming breps, I am getting validity issues like following:
"cv[0*cv_stride + 1] = -1.#IND is not valid.\nON_NurbsCurve.m_cv is not valid.\nON_Brep.m_C3 is invalid."
What’s even stranger is that this issue is not consistent, roughly every 1 out of ten attempts the same code produces a valid brep, with the same raw data ! If I try to put a break point and step through the code, it creates an invalid brep, then I move the execution point to an earlier line of code and run the brep creation line again, it creates a valid brep.
Can anyone explain to me what I am doing wrong? How can I reliably create a brep from raw data of surfaces and trimming curves? Any help is appreciated, thank you very much!