From 592c117c43a8d2add1c83c7696b8fa0231976a83 Mon Sep 17 00:00:00 2001 From: rnc Date: Mon, 16 Sep 2013 15:53:30 +0000 Subject: [PATCH] BUG: HexoticPlugin/SizeMaps: The shape location wasn'takebn into account when building the size map control points. Thus the resulting size map was false in case of transformed shapes. Also the Hexotic working files removal is now performed only in release mode to allow debugging. --- src/HexoticPlugin/HexoticPlugin_Hexotic.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx index c3c54a3..b6be4d6 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -1147,9 +1147,13 @@ void HexoticPlugin_Hexotic::createPointsSampleFromFace( const TopoDS_Shape& aSha BRepMesh_IncrementalMesh M(aShape, 0.01, Standard_True); TopLoc_Location aLocation; TopoDS_Face aFace = TopoDS::Face(aShape); - Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aFace, aLocation); + + // Triangulate the face Handle(Poly_Triangulation) aTri = BRep_Tool::Triangulation (aFace, aLocation); + // Get the transformation associated to the face location + gp_Trsf aTrsf = aLocation.Transformation(); + // Get triangles int nbTriangles = aTri->NbTriangles(); Poly_Array1OfTriangle triangles(1,nbTriangles); @@ -1168,6 +1172,10 @@ void HexoticPlugin_Hexotic::createPointsSampleFromFace( const TopoDS_Shape& aSha gp_Pnt p2 = nodes.Value(aTriangle.Value(2)); gp_Pnt p3 = nodes.Value(aTriangle.Value(3)); + p1.Transform(aTrsf); + p2.Transform(aTrsf); + p3.Transform(aTrsf); + subdivideTriangle(p1, p2, p3, theSize, thePoints); } } @@ -1547,6 +1555,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, if (myError) */ hexahedraMessage = "success"; + #ifndef _DEBUG_ removeFile(Hexotic_Out); removeFile(Hexotic_In); removeFile(aLogFileName); @@ -1554,6 +1563,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, { removeFile( TCollection_AsciiString( sizeMapFiles[i].c_str() ) ); } + #endif } else { hexahedraMessage = "failed"; -- 2.39.2