IPAL52439: 3D Extrusion creates distorted volumes

Fix for a case with a sole wall face
This commit is contained in:
eap 2014-07-03 19:06:08 +04:00
parent 9e3a675848
commit 7a9f9e2e46

View File

@ -65,15 +65,16 @@
using namespace std; using namespace std;
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; } #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z()) #define gpXYZ(n) SMESH_TNodeXYZ(n)
#define SHOWYXZ(msg, xyz) // {\
// gp_Pnt p (xyz); \
// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
// }
#ifdef _DEBUG_ #ifdef _DEBUG_
#define DBGOUT(msg) //cout << msg << endl; #define DBGOUT(msg) //cout << msg << endl;
#define SHOWYXZ(msg, xyz) \
// { gp_Pnt p (xyz); \
// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
#else #else
#define DBGOUT(msg) #define DBGOUT(msg)
#define SHOWYXZ(msg, xyz)
#endif #endif
namespace TAssocTool = StdMeshers_ProjectionUtils; namespace TAssocTool = StdMeshers_ProjectionUtils;
@ -1857,7 +1858,7 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top( const gp_Trsf & bottomToTopTrsf
if ( !botSMDS || botSMDS->NbElements() == 0 ) if ( !botSMDS || botSMDS->NbElements() == 0 )
{ {
_gen->Compute( *myHelper->GetMesh(), botSM->GetSubShape() ); _gen->Compute( *myHelper->GetMesh(), botSM->GetSubShape(), /*aShapeOnly=*/true );
botSMDS = botSM->GetSubMeshDS(); botSMDS = botSM->GetSubMeshDS();
if ( !botSMDS || botSMDS->NbElements() == 0 ) if ( !botSMDS || botSMDS->NbElements() == 0 )
return toSM( error(TCom("No elements on face #") << botSM->GetId() )); return toSM( error(TCom("No elements on face #") << botSM->GetId() ));
@ -3760,8 +3761,8 @@ gp_Pnt StdMeshers_PrismAsBlock::TSideFace::Value(const Standard_Real U,
} }
if ( !edge.IsNull() ) if ( !edge.IsNull() )
{ {
double u1 = myHelper.GetNodeU( edge, nn[0] ); double u1 = myHelper.GetNodeU( edge, nn[0], nn[2] );
double u3 = myHelper.GetNodeU( edge, nn[2] ); double u3 = myHelper.GetNodeU( edge, nn[2], nn[0] );
double u = u1 * ( 1 - hR ) + u3 * hR; double u = u1 * ( 1 - hR ) + u3 * hR;
TopLoc_Location loc; double f,l; TopLoc_Location loc; double f,l;
Handle(Geom_Curve) curve = BRep_Tool::Curve( edge,loc,f,l ); Handle(Geom_Curve) curve = BRep_Tool::Curve( edge,loc,f,l );