From e6e014f1dbb9183b5cb8431f2482684de7df5254 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 13 Apr 2012 19:54:27 +0000 Subject: [PATCH] revert to previous version --- Geo/OCCFace.cpp | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/Geo/OCCFace.cpp b/Geo/OCCFace.cpp index 4eb29773b2..172f1e1b35 100644 --- a/Geo/OCCFace.cpp +++ b/Geo/OCCFace.cpp @@ -14,7 +14,6 @@ #include "Context.h" #if defined(HAVE_OCC) -#include <TColStd_MapIteratorOfMapOfAsciiString.hxx> #include <Standard_Version.hxx> #include <Geom_CylindricalSurface.hxx> #include <Geom_ConicalSurface.hxx> @@ -26,8 +25,6 @@ #include <Geom_Plane.hxx> #include <gp_Pln.hxx> #include <BRepMesh_FastDiscret.hxx> -#include <BRepMesh_PDiscretRoot.hxx> -#include <BRepMesh_DiscretFactory.hxx> #include <IntTools_Context.hxx> #include <BOPTools_Tools2D.hxx> #include <BOPTools_Tools3D.hxx> @@ -339,37 +336,16 @@ bool OCCFace::buildSTLTriangulation(bool force) Bnd_Box aBox; BRepBndLib::Add(s, aBox); - - Standard_Real aDiscret, aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - Standard_Real dX, dY, dZ, dMax, aCoeff, aAngle = .5; - aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - dX=aXmax-aXmin; - dY=aYmax-aYmin; - dZ=aZmax-aZmin; - dMax=dX; - if (dY>dMax) { - dMax=dY; - } - if (dZ>dMax) { - dMax=dZ; - } - // - aCoeff=0.1; - aDiscret=aCoeff*dMax; - - // std::cout << BRepMesh_DiscretFactory::Get().Names() << "\n"; - // const TColStd_MapOfAsciiString &aaa = BRepMesh_DiscretFactory::Get().Names(); - // TColStd_MapIteratorOfMapOfAsciiString It (aaa); - // for (; It.More(); It.Next()) { - // std::cout << It.Key() << "\n"; - // } - - BRepMesh_PDiscretRoot pAlgo = BRepMesh_DiscretFactory::Get().Discret(s, aDiscret, aAngle); - if (pAlgo) pAlgo->Perform(); + BRepMesh_FastDiscret aMesher(0.1, 0.5, aBox, Standard_False, Standard_False, + Standard_True, Standard_False); +#if (OCC_VERSION_MAJOR == 6) && (OCC_VERSION_MINOR < 5) + aMesher.Add(s); +#else + aMesher.Perform(s); +#endif TopLoc_Location loc; Handle(Poly_Triangulation) triangulation = BRep_Tool::Triangulation(s, loc); - if(triangulation.IsNull() || !triangulation->HasUVNodes()){ if(triangulation.IsNull()) -- GitLab