]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Invalid work in preview mode
authoreap <eap@opencascade.com>
Tue, 3 Oct 2017 14:32:53 +0000 (17:32 +0300)
committereap <eap@opencascade.com>
Tue, 3 Oct 2017 14:32:53 +0000 (17:32 +0300)
src/SMESH/SMESH_MeshEditor.cxx
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx

index 45d0f256cc01d38e68632a7e29c62eab7786d8f0..981458a6a8362b66dd24e4693e79fb5859d01f1b 100644 (file)
@@ -13233,6 +13233,10 @@ void SMESH_MeshEditor::MakePolyLine( TListOfPolySegments&   theSegments,
         SMESH_MeshAlgos::FaceNormal( face, const_cast< gp_XYZ& >( polySeg.myVector.XYZ() ));
         polySeg.myMidProjPoint = pMid + polySeg.myVector.XYZ();
       }
+      else
+      {
+        polySeg.myVector = polySeg.myMidProjPoint.XYZ() - pMid;
+      }
     }
   }
 
index 8e03e4e679e6ecdd6bf67c4f0366e01f59e34e3e..4bcfc1d97ac42121e6d072fbf0723c15f237efdb 100644 (file)
@@ -1641,7 +1641,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
   case POS_RIGHT:
   {
     // point is inside the face
-    double distToFacePlane = tmpPnt.Y();
+    double distToFacePlane = Abs( tmpPnt.Y() );
     if ( closestPnt )
     {
       if ( distToFacePlane < std::numeric_limits<double>::min() ) {
@@ -1653,7 +1653,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
         *closestPnt = tmpPnt;
       }
     }
-    return Abs( distToFacePlane );
+    return distToFacePlane;
   }
   case POS_VERTEX:
   {
index 7ef2f4633a874324b8ad4062caaabf77b36ef40d..5e4c7fd65660432881fdc4315637b60abb28495d 100644 (file)
@@ -6864,12 +6864,14 @@ void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments,
   initData(/*deleteSearchers=*/false);
 
   SMESHDS_Group* groupDS = 0;
+  SMESHDS_Mesh*   meshDS = getMeshDS();
   if ( myIsPreviewMode ) // copy faces to the tmp mesh
   {
     TPreviewMesh * tmpMesh = getPreviewMesh( SMDSAbs_Edge );
     SMDS_ElemIteratorPtr faceIt = getMeshDS()->elementsIterator( SMDSAbs_Face );
     while ( faceIt->more() )
       tmpMesh->Copy( faceIt->next() );
+    meshDS = tmpMesh->GetMeshDS();
   }
   else if ( theGroupName[0] ) // find/create a group of segments
   {
@@ -6898,10 +6900,10 @@ void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments,
   {
     SMESH::PolySegment&               segIn = theSegments[ i ];
     ::SMESH_MeshEditor::PolySegment& segOut = segments[ i ];
-    segOut.myNode1[0] = getMeshDS()->FindNode( segIn.node1ID1 );
-    segOut.myNode2[0] = getMeshDS()->FindNode( segIn.node1ID2 );
-    segOut.myNode1[1] = getMeshDS()->FindNode( segIn.node2ID1 );
-    segOut.myNode2[1] = getMeshDS()->FindNode( segIn.node2ID2 );
+    segOut.myNode1[0] = meshDS->FindNode( segIn.node1ID1 );
+    segOut.myNode2[0] = meshDS->FindNode( segIn.node1ID2 );
+    segOut.myNode1[1] = meshDS->FindNode( segIn.node2ID1 );
+    segOut.myNode2[1] = meshDS->FindNode( segIn.node2ID2 );
     segOut.myVector.SetCoord( segIn.vector.PS.x,
                               segIn.vector.PS.y,
                               segIn.vector.PS.z );