- if ( (p1.Distance(p2) > threshold ||
- p2.Distance(p3) > threshold ||
- p3.Distance(p1) > threshold))
- {
- std::vector<gp_Pnt> midPoints = computePointsForSplitting(p1, p2, p3);
-
- subdivideTriangle( midPoints[0], midPoints[1], midPoints[2], theSize, thePoints );
- subdivideTriangle( midPoints[0], p2, midPoints[1], theSize, thePoints );
- subdivideTriangle( midPoints[2], midPoints[1], p3, theSize, thePoints );
- subdivideTriangle( p1, midPoints[0], midPoints[2], theSize, thePoints );
- }
- else
- {
- double x = (p1.X() + p2.X() + p3.X()) / 3 ;
- double y = (p1.Y() + p2.Y() + p3.Y()) / 3 ;
- double z = (p1.Z() + p2.Z() + p3.Z()) / 3 ;
+ if ( p1.Distance(p2) > threshold ||
+ p2.Distance(p3) > threshold ||
+ p3.Distance(p1) > threshold )
+ try
+ {
+ gp_Pnt midPoints[3];
+ computePointsForSplitting( p1, p2, p3, midPoints );
+
+ subdivideTriangle( midPoints[0], midPoints[1], midPoints[2], theSize, thePoints );
+ subdivideTriangle( midPoints[0], p2, midPoints[1], theSize, thePoints );
+ subdivideTriangle( midPoints[2], midPoints[1], p3, theSize, thePoints );
+ subdivideTriangle( p1, midPoints[0], midPoints[2], theSize, thePoints );
+ return;
+ }
+ catch (...)
+ {
+ }