[cgma-dev] r2830 - cgm/trunk/geom/OCC

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Thu Apr 16 13:14:35 CDT 2009


Author: janehu
Date: 2009-04-16 13:14:34 -0500 (Thu, 16 Apr 2009)
New Revision: 2830

Modified:
   cgm/trunk/geom/OCC/OCCSurface.cpp
Log:
Added a check for point containment check for surfaces which is part of a periodic surface. This case, opencascade will use the whole periodic surface as a base to check if the point it on, return INSIDE even if the point is outside of the face but on the whole surface. Double check point projection, and make sure it's on the trimmed surface when state returned as inside.

Modified: cgm/trunk/geom/OCC/OCCSurface.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCSurface.cpp	2009-04-16 18:01:23 UTC (rev 2829)
+++ cgm/trunk/geom/OCC/OCCSurface.cpp	2009-04-16 18:14:34 UTC (rev 2830)
@@ -651,8 +651,19 @@
    face_classifier.Perform(*face, p, tol);
    TopAbs_State state = face_classifier.State();
    
+   //if surface is part of a periodic TopoDS_Face, it'll check the point
+   //againt the whole periodic Face, even it outside the occsurface 
+   //boundary, if it's on its periodic extension, it'll return as in. 
    if (state == TopAbs_IN)
-     return CUBIT_PNT_INSIDE;
+   {
+     //double check if the point is projected on the surface
+     CubitVector closest_point;
+     this->closest_point_trimmed(point, closest_point);
+     if(point.distance_between(closest_point) < tol) 
+       return CUBIT_PNT_INSIDE;
+     else
+       return CUBIT_PNT_OUTSIDE;
+   }
    else if (state == TopAbs_OUT)
      return CUBIT_PNT_OUTSIDE;
    else if (state == TopAbs_ON)
@@ -665,7 +676,7 @@
                                                      double v_param )
 {
   CubitVector point = position_from_u_v(u_param, v_param);
-  return point_containment(point); 
+  return point_containment(point);
 }
 
 



More information about the cgma-dev mailing list