TopoDS_Face nextFace1 = GetNextFace( edgeToFace1, *eIt1, face1 );
TopoDS_Face nextFace2 = GetNextFace( edgeToFace2, *eIt2, face2 );
if ( !nextFace1.IsNull() && !nextFace2.IsNull() ) {
+ if ( SMESH_MesherHelper::GetSubShapeOri( nextFace1, *eIt1 ) == eIt1->Orientation() )
+ nextFace1.Reverse();
+ if ( SMESH_MesherHelper::GetSubShapeOri( nextFace2, *eIt2 ) == eIt2->Orientation() )
+ nextFace2.Reverse();
FE1.push_back( make_pair( nextFace1, *eIt1 ));
FE2.push_back( make_pair( nextFace2, *eIt2 ));
}
if ( !VV1[1].IsNull() ) {
InsertAssociation( VV1[0], VV2[0], theMap );
InsertAssociation( VV1[1], VV2[1], theMap );
+ TShapeShapeMap::EAssocType asType = theMap._assocType;
+ theMap.SetAssocType( TShapeShapeMap::PROPAGATION );
if ( FindSubShapeAssociation( theShape1, theMesh1, theShape2, theMesh2, theMap ))
- {
- theMap.SetAssocType( TShapeShapeMap::PROPAGATION );
return true;
- }
+ theMap._assocType = asType;
}
}
break; // try by vertex closeness
{
InsertAssociation( VV1[0], VV1[0], theMap );
InsertAssociation( VV1[1], VV1[1], theMap );
- if (FindSubShapeAssociation( theShape1, theMesh1, theShape2, theMesh2, theMap ))
- {
- theMap.SetAssocType( TShapeShapeMap::COMMON_VERTEX );
+ TShapeShapeMap::EAssocType asType = theMap._assocType;
+ theMap.SetAssocType( TShapeShapeMap::COMMON_VERTEX );
+ if ( FindSubShapeAssociation( theShape1, theMesh1, theShape2, theMesh2, theMap ))
return true;
- }
+ theMap._assocType = asType;
}
}
}
}
if ( TopExp::FirstVertex( *edgeIt ).IsSame( TopExp::LastVertex( *edgeIt )) &&
SMESH_Algo::isDegenerated( *edgeIt )) {
- --edgeIt; // skip a degenerated edge (www.salome-platform.org/forum/forum_11/173031193)
+ --edgeIt; // skip a degenerated edge (test 3D_mesh_Projection_00/A3)
}
if ( !VV1[1].IsSame( TopExp::FirstVertex( *edgeIt, true ))) {
CONT_BAD_RESULT("GetOrderedEdges() failed");
// reverse edges2 if needed
if ( SMESH_MesherHelper::IsClosedEdge( *edge1Beg ))
{
- double f,l;
- Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface( *edge1Beg, face1,f,l );
- if ( edge1Beg->Orientation() == TopAbs_REVERSED )
- std::swap( f,l );
- gp_Pnt2d uv1 = dUV + c1->Value( f * 0.8 + l * 0.2 ).XY();
-
- Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface( *edge2Beg, face2,f,l );
- if ( edge2Beg->Orientation() == TopAbs_REVERSED )
- std::swap( f,l );
- gp_Pnt2d uv2 = c2->Value( f * 0.8 + l * 0.2 );
- gp_Pnt2d uv3 = c2->Value( l * 0.8 + f * 0.2 );
-
- if ( uv1.SquareDistance( uv2 ) > uv1.SquareDistance( uv3 ))
- edge2Beg->Reverse();
+ // Commented (so far?) as it's not checked if orientation must be same or reversed
+ // double f,l;
+ // Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface( *edge1Beg, face1,f,l );
+ // if ( edge1Beg->Orientation() == TopAbs_REVERSED )
+ // std::swap( f,l );
+ // gp_Pnt2d uv1 = dUV + c1->Value( f * 0.8 + l * 0.2 ).XY();
+
+ // Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface( *edge2Beg, face2,f,l );
+ // if ( edge2Beg->Orientation() == TopAbs_REVERSED )
+ // std::swap( f,l );
+ // gp_Pnt2d uv2 = c2->Value( f * 0.8 + l * 0.2 );
+ // gp_Pnt2d uv3 = c2->Value( l * 0.8 + f * 0.2 );
+
+ // if ( uv1.SquareDistance( uv2 ) > uv1.SquareDistance( uv3 ))
+ // edge2Beg->Reverse();
}
else
{
// cout << vec( 1 ) << "\t " << vec( 2 ) << endl
// << vec( 3 ) << "\t " << vec( 4 ) << endl;
- _trsf.SetTranslation( tgtGC );
+ _trsf.SetTranslationPart( tgtGC );
_srcOrig = srcGC;
- gp_Mat2d& M = const_cast< gp_Mat2d& >( _trsf.HVectorialPart());
+ gp_Mat2d& M = const_cast< gp_Mat2d& >( _trsf.VectorialPart());
M( 1,1 ) = vec( 1 );
- M( 2,1 ) = vec( 2 );
- M( 1,2 ) = vec( 3 );
+ M( 2,1 ) = vec( 2 ); // | 1 3 | -- is it correct ????????
+ M( 1,2 ) = vec( 3 ); // | 2 4 |
M( 2,2 ) = vec( 4 );
return true;
// << vec( 7 ) << "\t " << vec( 8 ) << "\t " << vec( 9 ) << endl;
_srcOrig = srcOrig;
- _trsf.SetTranslation( tgtOrig );
+ _trsf.SetTranslationPart( tgtOrig );
- gp_Mat& M = const_cast< gp_Mat& >( _trsf.HVectorialPart() );
+ gp_Mat& M = const_cast< gp_Mat& >( _trsf.VectorialPart() );
M.SetRows( gp_XYZ( vec( 1 ), vec( 2 ), vec( 3 )),
gp_XYZ( vec( 4 ), vec( 5 ), vec( 6 )),
gp_XYZ( vec( 7 ), vec( 8 ), vec( 9 )));
gp_XYZ TrsfFinder3D::TransformVec( const gp_Vec& v ) const
{
- return v.XYZ().Multiplied( _trsf.HVectorialPart() );
+ return v.XYZ().Multiplied( _trsf.VectorialPart() );
}
//================================================================================
/*!
{
// seems to be defined via Solve()
gp_XYZ newSrcOrig = _trsf.TranslationPart();
- gp_Mat& M = const_cast< gp_Mat& >( _trsf.HVectorialPart() );
+ gp_Mat& M = const_cast< gp_Mat& >( _trsf.VectorialPart() );
const double D = M.Determinant();
if ( D < 1e-3 * ( newSrcOrig - _srcOrig ).Modulus() )
{
return false;
}
gp_Mat Minv = M.Inverted();
- _trsf.SetTranslation( _srcOrig );
+ _trsf.SetTranslationPart( _srcOrig );
_srcOrig = newSrcOrig;
M = Minv;
}