I have problem with forming invalid Brep after some transformations.Here is my code for checking:

bool isValidONXF=modelTransform.IsValid(); // ON_Xform is valid
ON_BrepPtr brep = models.at(j)->mBreps.at(k);
bool transfSucc = brep->Transform(modelTransform); // transformation is successful
bool brepAfterTransformatio=brep->IsValid(); // brep is invalid after transformation

I see that transformations as well as ON_Xform matrix is valid but after brep transform it become invalid. Could you please help me why is this happening and what may be error in this situation (Brep or ON_Xform) and how I can transform Brep correctly.

Actually I get transform matrix from debugger and put the same values in my test sample to get the same result invalid brep…

I think that I solve my problem. First I create transformation from other library (combination of rotation and translation) and put transformation matrix directly to ON_Xform. Library works with float values, instead ON_Xform works with double which I think I lose some precision during casting process. In this case on debugger i have transformation as was written previously (with xForm[1][1]=0.999). As a result of your recommendation Dale I use ON_Xform step by step with functions Translation and Rotation using double for angles and suitable axis and rotation center. After these step by step transformation there is no Invalid Brep