Commit dfeac5ac authored by Christophe Geuzaine's avatar Christophe Geuzaine

BRepMesh_FastDiscret -> BRepMesh_IncrementalMesh for future OCC 7.4

parent e25ad13f
Pipeline #2857 passed with stage
in 57 minutes and 49 seconds
......@@ -40,7 +40,6 @@
#include <BRepFilletAPI_MakeFillet.hxx>
#include <BRepGProp.hxx>
#include <BRepLib.hxx>
#include <BRepMesh_FastDiscret.hxx>
#include <BRepOffsetAPI_MakeFilling.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepOffsetAPI_MakeThickSolid.hxx>
......@@ -99,6 +98,12 @@
#error "Gmsh requires OpenCASCADE >= 6.9"
#endif
#if OCC_VERSION_HEX > 0x070300
#include <BRepMesh_IncrementalMesh.hxx>
#else
#include <BRepMesh_FastDiscret.hxx>
#endif
#if defined(HAVE_OCC_CAF)
#include <Quantity_Color.hxx>
#include <TDocStd_Document.hxx>
......@@ -3848,24 +3853,25 @@ static bool makeSTL(const TopoDS_Face &s, std::vector<SPoint2> *verticesUV,
{
if(CTX::instance()->geom.occDisableSTL) return false;
// printf("coucou\n");
#if OCC_VERSION_HEX > 0x070300
BRepMesh_IncrementalMesh aMesher(s, 0.1, Standard_False, 0.35, Standard_True);
#elif OCC_VERSION_HEX > 0x070000
Bnd_Box aBox;
BRepBndLib::Add(s, aBox);
#if(OCC_VERSION_MAJOR >= 7)
double fact = 1;
BRepMesh_FastDiscret::Parameters parameters;
parameters.Deflection = fact * 0.1;
parameters.Angle = fact * 0.35;
// parameters.InternalVerticesMode = Standard_False;
parameters.Deflection = 0.1;
parameters.Angle = 0.35;
parameters.Relative = Standard_False;
BRepMesh_FastDiscret aMesher(aBox, parameters);
aMesher.Perform(s);
#else
Bnd_Box aBox;
BRepBndLib::Add(s, aBox);
BRepMesh_FastDiscret aMesher(0.1, 0.35, aBox, Standard_False, Standard_False,
Standard_True, Standard_False);
#endif
aMesher.Perform(s);
#endif
TopLoc_Location loc;
Handle(Poly_Triangulation) triangulation = BRep_Tool::Triangulation(s, loc);
......
  • I have two questions here @geuzaine ...

    1. Does the macro if(OCC_VERSION_MAJOR >= 7) trigger if using OCE 0.18?
    2. What is the difference between BRepMesh_IncrementalMesh.hxx and BRepMesh_FastDiscret.hxx?
  • I believe OCE 0.18 is based on a much older version of occt (6.9 ?), so no.

    BRepMesh_FastDiscret will be deprecated in occt 7.4: occt docs ask to transition to the new stuff - no idea if there are underlying algorithmic changes.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment