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
|
--- FreeCAD-0.12.5284/src/Mod/Part/App/TopoShape.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/TopoShape.cpp
@@ -1370,7 +1370,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 +1469,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 +1772,7 @@
Standard_Real x3, y3, z3;
Handle_StlMesh_Mesh aMesh = new StlMesh_Mesh();
- StlTransfer::BuildIncrementalMesh(this->_Shape, accuracy, aMesh);
+ StlTransfer::BuildIncrementalMesh(this->_Shape, accuracy, false, aMesh);
StlMesh_MeshExplorer xp(aMesh);
for (Standard_Integer nbd=1;nbd<=aMesh->NbDomains();nbd++) {
for (xp.InitTriangle (nbd); xp.MoreTriangle (); xp.NextTriangle ()) {
--- FreeCAD-0.12.5284/src/Mod/Part/App/FeatureRevolution.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/FeatureRevolution.cpp
@@ -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);
--- FreeCAD-0.12.5284/src/Mod/Part/App/PrimitiveFeature.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/PrimitiveFeature.cpp
@@ -263,9 +263,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 +321,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 +380,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 +429,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 +498,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);
--- FreeCAD-0.12.5284/src/Mod/Part/App/AppPartPy.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/AppPartPy.cpp
@@ -492,7 +492,7 @@
d.SetCoord(vec.x, vec.y, vec.z);
}
Handle_Geom_Plane aPlane = new Geom_Plane(p, d);
- BRepBuilderAPI_MakeFace Face(aPlane, 0.0, length, 0.0, width);
+ BRepBuilderAPI_MakeFace Face(aPlane, 0.0, length, 0.0, width, Precision::Confusion());
return new TopoShapeFacePy(new TopoShape((Face.Face())));
}
catch (Standard_DomainError) {
--- FreeCAD-0.12.5284/src/Mod/Part/App/GeometrySurfacePyImp.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/GeometrySurfacePyImp.cpp
@@ -79,7 +79,7 @@
s->Bounds(u1,u2,v1,v2);
if (!PyArg_ParseTuple(args, "|dddd", &u1,&u2,&v1,&v2))
return 0;
- BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2);
+ BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2, Precision::Confusion());
TopoDS_Shape sh = mkBuilder.Shape();
return new TopoShapeFacePy(new TopoShape(sh));
}
--- FreeCAD-0.12.5284/src/Mod/Part/App/Geometry.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/Geometry.cpp
@@ -1252,7 +1252,7 @@
Handle_Geom_Surface s = Handle_Geom_Surface::DownCast(handle());
Standard_Real u1,u2,v1,v2;
s->Bounds(u1,u2,v1,v2);
- BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2);
+ BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2, Precision::Confusion());
return mkBuilder.Shape();
}
--- FreeCAD-0.12.5284/src/Mod/Part/App/PrimitiveFeature.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/PrimitiveFeature.cpp
@@ -191,7 +191,7 @@
gp_Pnt pnt(0.0,0.0,0.0);
gp_Dir dir(0.0,0.0,1.0);
Handle_Geom_Plane aPlane = new Geom_Plane(pnt, dir);
- BRepBuilderAPI_MakeFace mkFace(aPlane, 0.0, L, 0.0, W);
+ BRepBuilderAPI_MakeFace mkFace(aPlane, 0.0, L, 0.0, W, Precision::Confusion());
const char *error=0;
switch (mkFace.Error())
--- FreeCAD-0.12.5284/src/Mod/Part/App/TopoShape.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/TopoShape.cpp
@@ -1338,7 +1338,7 @@
double u1,u2,v1,v2;
surf->Bounds(u1,u2,v1,v2);
- BRepBuilderAPI_MakeFace mkBuilder(surf, umin, umax, v1, v2);
+ BRepBuilderAPI_MakeFace mkBuilder(surf, umin, umax, v1, v2, Precision::Confusion());
return mkBuilder.Face();
}
@@ -1391,7 +1391,7 @@
Standard_Real u1,u2,v1,v2;
mySurface->Bounds(u1,u2,v1,v2);
- BRepBuilderAPI_MakeFace mkBuilder(mySurface, u1, u2, v1, v2);
+ BRepBuilderAPI_MakeFace mkBuilder(mySurface, u1, u2, v1, v2, Precision::Confusion());
return mkBuilder.Shape();
}
@@ -1443,7 +1443,7 @@
mkSweep.Perform(tol, Standard_False, GeomAbs_C1, BSplCLib::MaxDegree(), 1000);
const Handle_Geom_Surface& surf = mkSweep.Surface();
- BRepBuilderAPI_MakeFace mkBuilder(surf, umin, umax, vmin, vmax);
+ BRepBuilderAPI_MakeFace mkBuilder(surf, umin, umax, vmin, vmax, Precision::Confusion());
return mkBuilder.Face();
}
--- FreeCAD-0.12.5284/src/Mod/Part/App/TopoShapeFacePyImp.cpp
+++ FreeCAD-0.12.5284/src/Mod/Part/App/TopoShapeFacePyImp.cpp
@@ -135,7 +135,7 @@
return -1;
}
- BRepBuilderAPI_MakeFace mkFace(S);
+ BRepBuilderAPI_MakeFace mkFace(S, Precision::Confusion());
if (bound) {
Py::List list(bound);
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
--- FreeCAD-0.12.5284/src/Mod/Fem/App/AppFemPy.cpp
+++ FreeCAD-0.12.5284/src/Mod/Fem/App/AppFemPy.cpp
@@ -498,12 +498,12 @@
//Do a Monte Carlo approach and start from the Principal Axis System
//and rotate +/- 60° around each axis in a first iteration
- double angle_range_min_x=-PI/3.0,angle_range_max_x=PI/3.0,
- angle_range_min_y=-PI/3.0,angle_range_max_y=PI/3.0,
- angle_range_min_z=-PI/3.0,angle_range_max_z=PI/3.0;
+ double angle_range_min_x=-M_PI/3.0,angle_range_max_x=M_PI/3.0,
+ angle_range_min_y=-M_PI/3.0,angle_range_max_y=M_PI/3.0,
+ angle_range_min_z=-M_PI/3.0,angle_range_max_z=M_PI/3.0;
//We rotate until we are 0.1° sure to be in the right position
- for (step_size = (2.0*PI/it_steps);step_size>(2.0*PI/3600.0);step_size=(2.0*PI/it_steps))
+ for (step_size = (2.0*M_PI/it_steps);step_size>(2.0*M_PI/3600.0);step_size=(2.0*M_PI/it_steps))
{
for(alpha_x=angle_range_min_x;alpha_x<angle_range_max_x;alpha_x=alpha_x+step_size)
{
@@ -744,11 +744,11 @@
//Do a Monte Carlo approach and start from the Principal Axis System
//and rotate +/- 60° around each axis in a first iteration
- double angle_range_min_x=-PI/3.0,angle_range_max_x=PI/3.0,
- angle_range_min_y=-PI/3.0,angle_range_max_y=PI/3.0,
- angle_range_min_z=-PI/3.0,angle_range_max_z=PI/3.0;
+ double angle_range_min_x=-M_PI/3.0,angle_range_max_x=M_PI/3.0,
+ angle_range_min_y=-M_PI/3.0,angle_range_max_y=M_PI/3.0,
+ angle_range_min_z=-M_PI/3.0,angle_range_max_z=M_PI/3.0;
- for (step_size = (2.0*PI/it_steps);step_size>(2.0*PI/360.0);step_size=(2.0*PI/it_steps))
+ for (step_size = (2.0*M_PI/it_steps);step_size>(2.0*M_PI/360.0);step_size=(2.0*M_PI/it_steps))
{
for(alpha_x=angle_range_min_x;alpha_x<angle_range_max_x;alpha_x=alpha_x+step_size)
{
|