SMESH_MeshAlgos::FaceNormal( face, const_cast< gp_XYZ& >( polySeg.myVector.XYZ() ));
polySeg.myMidProjPoint = pMid + polySeg.myVector.XYZ();
}
+ else
+ {
+ polySeg.myVector = polySeg.myMidProjPoint.XYZ() - pMid;
+ }
}
}
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() ) {
*closestPnt = tmpPnt;
}
}
- return Abs( distToFacePlane );
+ return distToFacePlane;
}
case POS_VERTEX:
{
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
{
{
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 );