Hi, I just tried to rebuild freecad with the patch you provide for oce 0.10 from experimental (I added it on top on the already applied patches). It gives me some errors. I tried to patch freecad (see attached file) but I stuck with this problem:
TopoShape.cpp:1777:84: error: no matching function for call to 'StlTransfer::BuildIncrementalMesh(const TopoDS_Shape&, Standard_Real, Handle_StlMesh_Mesh&)' TopoShape.cpp:1777:84: note: candidate is: In file included from TopoShape.cpp:1760:0: /usr/include/oce/StlTransfer.hxx:54:15: note: static void StlTransfer::BuildIncrementalMesh(const TopoDS_Shape&, Standard_Real, Standard_Boolean, const Handle_StlMesh_Mesh&) Could you please confirm me that freecad FTBS with latest oce 0.10 from experimental?
Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -52,6 +52,7 @@ #include <gp_Pnt.hxx> #include <gp_Vec.hxx> #include <gp_XYZ.hxx> +#include <math.h> #include "SMDS_Mesh.hxx" #include "SMDS_Iterator.hxx" @@ -332,7 +333,7 @@ aMin = Min(aMin,A0); } - return aMin * 180.0 / PI; + return aMin * 180.0 / M_PI; } double MinimumAngle::GetBadRate( double Value, int nbNodes ) const @@ -831,12 +832,12 @@ gp_XYZ N = GI.Crossed( GJ ); if ( N.Modulus() < gp::Resolution() ) - return PI / 2; + return M_PI / 2; N.Normalize(); double H = ( thePnt2 - theG ).Dot( N ); - return asin( fabs( H / L ) ) * 180. / PI; + return asin( fabs( H / L ) ) * 180. / M_PI; } double Warping::GetBadRate( double Value, int /*nbNodes*/ ) const @@ -915,14 +916,14 @@ return 0.; // Compute skew - static double PI2 = PI / 2.; + static double PI2 = M_PI / 2.; if ( P.size() == 3 ) { double A0 = fabs( PI2 - skewAngle( P( 3 ), P( 1 ), P( 2 ) ) ); double A1 = fabs( PI2 - skewAngle( P( 1 ), P( 2 ), P( 3 ) ) ); double A2 = fabs( PI2 - skewAngle( P( 2 ), P( 3 ), P( 1 ) ) ); - return Max( A0, Max( A1, A2 ) ) * 180. / PI; + return Max( A0, Max( A1, A2 ) ) * 180. / M_PI; } else { @@ -939,7 +940,7 @@ if ( A < Precision::Angular() ) return 0.; - return A * 180. / PI; + return A * 180. / M_PI; } } Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -1374,7 +1374,7 @@ const SMDS_MeshNode * n1, const SMDS_MeshNode * n2) { - double angle = 2*PI; // bad angle + double angle = 2*M_PI; // bad angle // get normals SMESH::Controls::TSequenceOfXYZ P1, P2; Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -58,6 +58,7 @@ #include <gp_Trsf.hxx> #include <gp_XY.hxx> #include <gp_XYZ.hxx> +#include <math.h> #include "SMDS_EdgePosition.hxx" #include "SMDS_FacePosition.hxx" @@ -1234,7 +1235,7 @@ maxLen2 = Max( maxLen2, ( n[1]->myUV - n[2]->myUV ).SquareModulus() ); } maxLen2 = Max( maxLen2, ( n[2]->myUV - node->myUV ).SquareModulus() ); - minDiag = sqrt( maxLen2 ) * PI / 60.; // ~ maxLen * Sin( 3 deg ) + minDiag = sqrt( maxLen2 ) * M_PI / 60.; // ~ maxLen * Sin( 3 deg ) } // check if newUV is behind 3 dirs: n[0]-n[1], n[1]-n[2] and n[0]-n[2] @@ -1785,7 +1786,7 @@ double initAngle = initTgt1.Angle( initTgt2 ); double angle = node->myDir[0].Angle( node->myDir[1] ); if ( reversed ) angle = -angle; - if ( initAngle > angle && initAngle - angle > PI / 2.1 ) { + if ( initAngle > angle && initAngle - angle > M_PI / 2.1 ) { // find a close internal node TIsoNode* nClose = 0; list< TIsoNode* > testNodes; Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_AutomaticLength.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_AutomaticLength.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_AutomaticLength.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -37,6 +37,7 @@ #include <TopExp.hxx> #include <TopoDS.hxx> #include <TopoDS_Edge.hxx> +#include <math.h> using namespace std; @@ -116,7 +117,7 @@ */ //================================================================================ - const double a14divPI = 14. / PI; + const double a14divPI = 14. / M_PI; inline double segLength(double S0, double edgeLen, double minLen ) { Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -52,6 +52,7 @@ #include <gp_Pnt2d.hxx> #include <gp_Vec.hxx> #include <gp_XYZ.hxx> +#include <math.h> #include <list> #include <set> @@ -812,7 +813,7 @@ int iMyCommon; if ( mySides.Contain( otherSide, &iMyCommon ) ) { // check if normals of two faces are collinear at all vertices of a otherSide - const double angleTol = PI / 180 / 2; + const double angleTol = M_PI / 180 / 2; int iV, nbV = otherSide.NbVertices(), nbCollinear = 0; for ( iV = 0; iV < nbV; ++iV ) { Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -39,6 +39,7 @@ #include <TopoDS.hxx> #include <gp_Lin.hxx> #include <gp_Pln.hxx> +#include <math.h> #ifndef __BORLANDC__ #include <NCollection_Array1.hxx> @@ -1037,19 +1038,19 @@ double ang1 = fabs(VN1.Angle(VI1)); double ang2 = fabs(VN2.Angle(VI2)); double h1,h2; - if(ang1>PI/3.) + if(ang1>M_PI/3.) h1 = VI1.Magnitude()/2; else h1 = VI1.Magnitude()*cos(ang1); - if(ang2>PI/3.) + if(ang2>M_PI/3.) h2 = VI2.Magnitude()/2; else h2 = VI2.Magnitude()*cos(ang2); double coef1 = 0.5; - if(ang1<PI/3) + if(ang1<M_PI/3) coef1 -= cos(ang1)*0.25; double coef2 = 0.5; - if(ang2<PI/3) + if(ang2<M_PI/3) coef2 -= cos(ang1)*0.25; SMDS_MeshNode* aNode1 = const_cast<SMDS_MeshNode*>(Ns1[4]); Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -54,6 +54,7 @@ #include <TColgp_SequenceOfPnt2d.hxx> #include <TopExp_Explorer.hxx> #include <TopoDS.hxx> +#include <math.h> using namespace std; @@ -355,8 +356,8 @@ for(; itn != theNodes.end(); itn++ ) { CNodes.push_back( (*itn).second ); double ang = (*itn).first - fang; - if( ang>PI ) ang = ang - 2*PI; - if( ang<-PI ) ang = ang + 2*PI; + if( ang>M_PI ) ang = ang - 2*M_PI; + if( ang<-M_PI ) ang = ang + 2*M_PI; Angles.Append( ang ); } } @@ -404,7 +405,7 @@ // a segment of line double fp, lp; Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast( getCurve( CircEdge, &fp, &lp )); - if( fabs(fabs(lp-fp)-PI) > Precision::Confusion() ) { + if( fabs(fabs(lp-fp)-M_PI) > Precision::Confusion() ) { // not half of circle return error(COMPERR_BAD_SHAPE); } @@ -434,8 +435,8 @@ for(; itn != theNodes.end(); itn++ ) { CNodes.push_back( (*itn).second ); double ang = (*itn).first - fang; - if( ang>PI ) ang = ang - 2*PI; - if( ang<-PI ) ang = ang + 2*PI; + if( ang>M_PI ) ang = ang - 2*M_PI; + if( ang<-M_PI ) ang = ang + 2*M_PI; Angles.Append( ang ); } const SMDS_MeshNode* NF = theNodes.begin()->second; @@ -587,8 +588,8 @@ for(; itn != theNodes.end(); itn++ ) { CNodes.push_back( (*itn).second ); double ang = (*itn).first - fang; - if( ang>PI ) ang = ang - 2*PI; - if( ang<-PI ) ang = ang + 2*PI; + if( ang>M_PI ) ang = ang - 2*M_PI; + if( ang<-M_PI ) ang = ang + 2*M_PI; Angles.Append( ang ); } P1 = gp_Pnt( NF->X(), NF->Y(), NF->Z() ); @@ -1055,7 +1056,7 @@ aLine = Handle(Geom_Line)::DownCast(C3); } bool ok = !aCirc.IsNull() && !aLine.IsNull(); - if( fabs(fabs(lp-fp)-PI) > Precision::Confusion() ) { + if( fabs(fabs(lp-fp)-M_PI) > Precision::Confusion() ) { // not half of circle ok = false; } Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/Mod/Part/App/FeatureRevolution.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/Mod/Part/App/FeatureRevolution.cpp 2012-08-31 17:49:06.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/Mod/Part/App/FeatureRevolution.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -28,7 +28,7 @@ #include "FeatureRevolution.h" - +#include <math.h> using namespace Part; @@ -71,7 +71,7 @@ try { // Now, let's get the TopoDS_Shape TopoDS_Shape revolve = base->Shape.getShape().revolve(gp_Ax1(pnt, dir), - Angle.getValue()/180.0f*Standard_PI); + Angle.getValue()/180.0f*M_PI); if (revolve.IsNull()) return new App::DocumentObjectExecReturn("Resulting shape is null"); this->Shape.setValue(revolve); Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/Mod/Part/App/PrimitiveFeature.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/Mod/Part/App/PrimitiveFeature.cpp 2012-08-31 17:53:58.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/Mod/Part/App/PrimitiveFeature.cpp 2012-08-31 17:53:58.000000000 +0200 @@ -59,6 +59,7 @@ #include "PrimitiveFeature.h" #include <Base/Tools.h> +#include <math.h> #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -263,9 +264,9 @@ return new App::DocumentObjectExecReturn("Radius of sphere too small"); try { BRepPrimAPI_MakeSphere mkSphere(Radius.getValue(), - Angle1.getValue()/180.0f*Standard_PI, - Angle2.getValue()/180.0f*Standard_PI, - Angle3.getValue()/180.0f*Standard_PI); + Angle1.getValue()/180.0f*M_PI, + Angle2.getValue()/180.0f*M_PI, + Angle3.getValue()/180.0f*M_PI); TopoDS_Shape ResultShape = mkSphere.Shape(); this->Shape.setValue(ResultShape); } @@ -321,9 +322,9 @@ gp_Ax2 ax2(pnt,dir); BRepPrimAPI_MakeSphere mkSphere(ax2, Radius2.getValue(), - Angle1.getValue()/180.0f*Standard_PI, - Angle2.getValue()/180.0f*Standard_PI, - Angle3.getValue()/180.0f*Standard_PI); + Angle1.getValue()/180.0f*M_PI, + Angle2.getValue()/180.0f*M_PI, + Angle3.getValue()/180.0f*M_PI); Standard_Real scale = Radius1.getValue()/Radius2.getValue(); gp_Dir xDir = ax2.XDirection(); gp_Dir yDir = ax2.YDirection(); @@ -380,7 +381,7 @@ try { BRepPrimAPI_MakeCylinder mkCylr(Radius.getValue(), Height.getValue(), - Angle.getValue()/180.0f*Standard_PI); + Angle.getValue()/180.0f*M_PI); TopoDS_Shape ResultShape = mkCylr.Shape(); this->Shape.setValue(ResultShape); } @@ -429,7 +430,7 @@ BRepPrimAPI_MakeCone mkCone(Radius1.getValue(), Radius2.getValue(), Height.getValue(), - Angle.getValue()/180.0f*Standard_PI); + Angle.getValue()/180.0f*M_PI); TopoDS_Shape ResultShape = mkCone.Shape(); this->Shape.setValue(ResultShape); } @@ -498,9 +499,9 @@ #else BRepPrimAPI_MakeTorus mkTorus(Radius1.getValue(), Radius2.getValue(), - Angle1.getValue()/180.0f*Standard_PI, - Angle2.getValue()/180.0f*Standard_PI, - Angle3.getValue()/180.0f*Standard_PI); + Angle1.getValue()/180.0f*M_PI, + Angle2.getValue()/180.0f*M_PI, + Angle3.getValue()/180.0f*M_PI); const TopoDS_Solid& ResultShape = mkTorus.Solid(); #endif this->Shape.setValue(ResultShape); Index: freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/Mod/Part/App/TopoShape.cpp =================================================================== --- freecad-0.12.5284-dfsg.obsolete.1346428782.12.orig/src/Mod/Part/App/TopoShape.cpp 2012-08-31 17:53:58.000000000 +0200 +++ freecad-0.12.5284-dfsg.obsolete.1346428782.12/src/Mod/Part/App/TopoShape.cpp 2012-09-03 09:34:47.000000000 +0200 @@ -153,6 +153,8 @@ #include "TopoShapeVertexPy.h" #include "ProgressIndicator.h" +#include <math.h> + using namespace Part; const char* BRepBuilderAPI_FaceErrorText(BRepBuilderAPI_FaceError et) @@ -1370,7 +1372,7 @@ //circular profile Handle(Geom_Circle) aCirc = new Geom_Circle (gp::XOY(), 1.0); - aCirc->Rotate (gp::OZ(), Standard_PI/2.); + aCirc->Rotate (gp::OZ(), M_PI/2.); //perpendicular section Handle(BRepAdaptor_HCurve) myPath = new BRepAdaptor_HCurve(path_adapt); @@ -1469,12 +1471,12 @@ } gp_Pnt2d aPnt(0, 0); - gp_Dir2d aDir(2. * PI, pitch); + gp_Dir2d aDir(2. * M_PI, pitch); gp_Ax2d aAx2d(aPnt, aDir); Handle(Geom2d_Line) line = new Geom2d_Line(aAx2d); gp_Pnt2d beg = line->Value(0); - gp_Pnt2d end = line->Value(sqrt(4.0*PI*PI+pitch*pitch)*(height/pitch)); + gp_Pnt2d end = line->Value(sqrt(4.0*M_PI*M_PI+pitch*pitch)*(height/pitch)); Handle(Geom2d_TrimmedCurve) segm = GCE2d_MakeSegment(beg , end); TopoDS_Edge edgeOnSurf = BRepBuilderAPI_MakeEdge(segm , surf); @@ -1772,7 +1774,7 @@ Standard_Real x3, y3, z3; Handle_StlMesh_Mesh aMesh = new StlMesh_Mesh(); - StlTransfer::BuildIncrementalMesh(this->_Shape, accuracy, aMesh); + StlTransfer::BuildIncrementalMesh(this->_Shape, (Standard_Real) accuracy, aMesh); StlMesh_MeshExplorer xp(aMesh); for (Standard_Integer nbd=1;nbd<=aMesh->NbDomains();nbd++) { for (xp.InitTriangle (nbd); xp.MoreTriangle (); xp.NextTriangle ()) {