X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FPlanarIntersector.txx;h=5824d6923dfa381650dc35d39ef22abf60e3de0c;hb=19a5d11f2c31745a83bd6993357263641c0babe5;hp=6f0c5aa5d0f7d8363446a06d42154dfe066f098d;hpb=1498517be5cddfb2b03167c7683955c205065044;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/PlanarIntersector.txx b/src/INTERP_KERNEL/PlanarIntersector.txx index 6f0c5aa5d..5824d6923 100644 --- a/src/INTERP_KERNEL/PlanarIntersector.txx +++ b/src/INTERP_KERNEL/PlanarIntersector.txx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -32,7 +32,7 @@ namespace INTERP_KERNEL template PlanarIntersector::PlanarIntersector(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel): _meshT(meshT),_meshS(meshS), - _dim_caracteristic(dimCaracteristic),_max_distance_3Dsurf_intersect(md3DSurf),_precision(precision),_median_plane(medianPlane), + _dim_caracteristic(dimCaracteristic),_max_distance_3Dsurf_intersect(md3DSurf),_min_dot_btw_3Dsurf_intersect(minDot3DSurf),_precision(precision),_median_plane(medianPlane), _do_rotate(doRotate),_orientation(orientation),_print_level(printLevel) { _connectT=meshT.getConnectivityPtr(); @@ -93,7 +93,7 @@ namespace INTERP_KERNEL } /*! - Computes the bouding box of a given element. iP in numPol mode. + Computes the bounding box of a given element. iP in numPol mode. */ template void PlanarIntersector::getElemBB(double* bb, const MyMeshType& mesh, ConnType iP, ConnType nb_nodes) @@ -344,7 +344,13 @@ namespace INTERP_KERNEL if(i_A2(normal_A,normal_B)>=0; + + double dotProd(dotprod(normal_A,normal_B)/(normA*normB)); + + if(fabs(dotProd)=0); if(!same_orientation) for(int idim =0; idim< SPACEDIM; idim++) @@ -374,12 +380,12 @@ namespace INTERP_KERNEL Coords_B[SPACEDIM*i_B+idim] -= proj*linear_comb[idim]; } - //Buid the matrix sending A into the Oxy plane and apply it to A and B + //Build the matrix sending A into the Oxy plane and apply it to A and B if(do_rotate) { TranslationRotationMatrix rotation; //rotate3DTriangle(Coords_A, &Coords_A[SPACEDIM*i_A1], &Coords_A[SPACEDIM*i_A2], rotation); - rotate3DTriangle(Coords_B, Coords_B+SPACEDIM*i_B1, Coords_B+SPACEDIM*i_B2, rotation); + Rotate3DTriangle(Coords_B, Coords_B+SPACEDIM*i_B1, Coords_B+SPACEDIM*i_B2, rotation); for (int i=0; i - void PlanarIntersector::rotate3DTriangle(double* PP1, double*PP2, double*PP3, + void PlanarIntersector::Rotate3DTriangle(double* PP1, double*PP2, double*PP3, TranslationRotationMatrix& rotation_matrix) { //initializes