1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
@@ -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;
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/SMESH/SMESH_Pattern.cpp
@@ -1234,7 +1234,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]
@@ -1721,9 +1721,9 @@
if ( iDir == 1 )
aNorm[ iDir ].Reverse(); // along iDir isoline
- double angle = tgt1.Angle( tgt2 ); // [-PI, PI]
+ double angle = tgt1.Angle( tgt2 ); // [-M_PI, M_PI]
// maybe angle is more than |PI|
- if ( Abs( angle ) > PI / 2. ) {
+ if ( Abs( angle ) > M_PI / 2. ) {
// check direction of the last but one perpendicular isoline
TIsoNode* prevNode = bndNode2->GetNext( iDir, 0 );
bndNode1 = prevNode->GetBoundaryNode( 1 - iDir, 0 );
@@ -1734,7 +1734,7 @@
double angle2 = tgt1.Angle( isoDir );
//cout << " isoDir: "<< isoDir.X() <<" "<<isoDir.Y() << " ANGLE: "<< angle << " "<<angle2<<endl;
if (angle2 * angle < 0 && // check the sign of an angle close to PI
- Abs ( Abs ( angle ) - PI ) <= PI / 180. ) {
+ Abs ( Abs ( angle ) - M_PI ) <= M_PI / 180. ) {
//MESSAGE("REVERSE ANGLE");
angle = -angle;
}
@@ -1746,7 +1746,7 @@
// cout << "bndNode1: " << bndNode1->myUV.X()<<" "<<bndNode1->myUV.Y()<< endl;
// cout << "bndNode2: " << bndNode2->myUV.X()<<" "<<bndNode2->myUV.Y()<<endl;
// cout <<" tgt: " << tgt1.X()<<" "<<tgt1.Y()<<" "<< tgt2.X()<<" "<<tgt2.Y()<<endl;
- angle += ( angle < 0 ) ? 2. * PI : -2. * PI;
+ angle += ( angle < 0 ) ? 2. * M_PI : -2. * M_PI;
}
}
aTgt[ iDir ] = tgt1.Rotated( angle * ratio[ iDir ] ).XY();
@@ -1785,7 +1785,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;
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/Controls/SMESH_Controls.cpp
@@ -332,12 +332,12 @@
aMin = Min(aMin,A0);
}
- return aMin * 180.0 / PI;
+ return aMin * 180.0 / M_PI;
}
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
{
- //const double aBestAngle = PI / nbNodes;
+ //const double aBestAngle = M_PI / nbNodes;
const double aBestAngle = 180.0 - ( 360.0 / double(nbNodes) );
return ( fabs( aBestAngle - Value ));
}
@@ -831,19 +831,19 @@
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
{
// the warp is in the range [0.0,PI/2]
// 0.0 = good (no warp)
- // PI/2 = bad (face pliee)
+ // M_PI/2 = bad (face pliee)
return Value;
}
@@ -915,14 +915,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 +939,7 @@
if ( A < Precision::Angular() )
return 0.;
- return A * 180. / PI;
+ return A * 180. / M_PI;
}
}
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_CompositeHexa_3D.cpp
@@ -812,7 +812,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 )
{
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cpp
@@ -355,8 +355,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 +404,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 +434,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 +587,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 +1055,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;
}
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cpp
@@ -1037,19 +1037,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]);
--- FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_AutomaticLength.cpp
+++ FreeCAD-0.12.5284/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_AutomaticLength.cpp
@@ -116,7 +116,7 @@
*/
//================================================================================
- const double a14divPI = 14. / PI;
+ const double a14divPI = 14. / M_PI;
inline double segLength(double S0, double edgeLen, double minLen )
{
|