From: eap Date: Thu, 16 Dec 2010 16:33:26 +0000 (+0000) Subject: 0020832: EDF 1359 SMESH : Automatic meshing of boundary layers X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a7556ff75204b110c76b41ba474772f9fff692b;p=modules%2Fsmesh.git 0020832: EDF 1359 SMESH : Automatic meshing of boundary layers use two-side intersection check --- diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 011463541..21c5049c8 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -1293,7 +1293,7 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data, int nbSteps) int step = 0, badNb = 0; moved = true; while (( ++step <= 5 && moved ) || improved ) { - dumpFunction(SMESH_Comment("smooth")<GetFaces( data._solid )); + auto_ptr searcher + ( editor.GetElementSearcher( data._proxyMesh->GetFaces( data._solid )) ); vector< const SMDS_MeshElement* > suspectFaces; for ( unsigned i = 0; i < data._edges.size(); ++i ) @@ -1529,31 +1529,54 @@ bool _LayerEdge::SegTriaInter( const gp_Ax1& lastSegment, /* if determinant is near zero, ray lies in plane of triangle */ double det = edge1 * pvec; - if (det < EPSILON) - return false; + if (det > -EPSILON && det < EPSILON) + return 0; + double inv_det = 1.0 / det; /* calculate distance from vert0 to ray origin */ gp_XYZ tvec = orig - vert0; /* calculate U parameter and test bounds */ - double u = tvec * pvec; - if (u < 0.0 || u > det) + double u = ( tvec * pvec ) * inv_det; + if (u < 0.0 || u > 1.0) return 0; /* prepare to test V parameter */ gp_XYZ qvec = tvec ^ edge1; /* calculate V parameter and test bounds */ - double v = dir * qvec; - if (v < 0.0 || u + v > det) + double v = (dir * qvec) * inv_det; + if ( v < 0.0 || u + v > 1.0 ) return 0; - /* calculate t, scale parameters, ray intersects triangle */ - double t = edge2 * qvec; - double inv_det = 1.0 / det; - t *= inv_det; - //u *= inv_det; - //v *= inv_det; + /* calculate t, ray intersects triangle */ + double t = (edge2 * qvec) * inv_det; + + // if (det < EPSILON) + // return false; + + // /* calculate distance from vert0 to ray origin */ + // gp_XYZ tvec = orig - vert0; + + // /* calculate U parameter and test bounds */ + // double u = tvec * pvec; + // if (u < 0.0 || u > det) +// return 0; + +// /* prepare to test V parameter */ +// gp_XYZ qvec = tvec ^ edge1; + +// /* calculate V parameter and test bounds */ +// double v = dir * qvec; +// if (v < 0.0 || u + v > det) +// return 0; + +// /* calculate t, scale parameters, ray intersects triangle */ +// double t = edge2 * qvec; +// double inv_det = 1.0 / det; +// t *= inv_det; +// //u *= inv_det; +// //v *= inv_det; bool intersection = t < _len; if ( intersection )