diff --git a/api/GenApi.py b/api/GenApi.py
index 9f3020355d5226e4743ce0a47bd27dfae7f00823..a542075cfe0777a03d908c5ef256b367e0d7dac7 100644
--- a/api/GenApi.py
+++ b/api/GenApi.py
@@ -767,10 +767,6 @@ cpp_header = """// {0}
 // types from the C++ standard library. See `tutorial/c++' and `demos/api' for
 // examples.
 
-#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
-#define _USE_MATH_DEFINES
-#endif
-
 #include <cmath>
 #include <vector>
 #include <string>
@@ -790,6 +786,10 @@ cpp_header = """// {0}
 #define {2}_API
 #endif
 
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
 namespace {6} {{
 
   // A geometrical entity in the {3} API is represented by two integers: its
@@ -907,16 +907,16 @@ cwrap_header = """// {0}
 //
 // Do not edit this file directly: it is automatically generated by `api/gen.py'.
 
-#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
-#define _USE_MATH_DEFINES
-#endif
-
 #include <cmath>
 #include <vector>
 #include <string>
 #include <utility>
 #include <string.h>
 
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
 extern \"C\" {{
   #include "{6}c.h"
 }}
diff --git a/api/gmsh.h b/api/gmsh.h
index 6d57b9dbe6e4672362d8dd284a8448f507357f0c..42ee85157ed5338a760ef9946d977c968673aa8f 100644
--- a/api/gmsh.h
+++ b/api/gmsh.h
@@ -14,10 +14,6 @@
 // types from the C++ standard library. See `tutorial/c++' and `demos/api' for
 // examples.
 
-#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
-#define _USE_MATH_DEFINES
-#endif
-
 #include <cmath>
 #include <vector>
 #include <string>
@@ -37,6 +33,10 @@
 #define GMSH_API
 #endif
 
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
 namespace gmsh {
 
   // A geometrical entity in the Gmsh API is represented by two integers: its
diff --git a/api/gmsh.h_cwrap b/api/gmsh.h_cwrap
index 88491882aa57d46060656f33c1bb40be7eb0fca9..50ba98d457b312cb545060b917ce630151e86a2b 100644
--- a/api/gmsh.h_cwrap
+++ b/api/gmsh.h_cwrap
@@ -21,16 +21,16 @@
 //
 // Do not edit this file directly: it is automatically generated by `api/gen.py'.
 
-#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
-#define _USE_MATH_DEFINES
-#endif
-
 #include <cmath>
 #include <vector>
 #include <string>
 #include <utility>
 #include <string.h>
 
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
 extern "C" {
   #include "gmshc.h"
 }
diff --git a/doc/texinfo/api.texi b/doc/texinfo/api.texi
index 832bd2648e1ae17643fb9475d5ad7c165c0200ee..aec0f9f92a4ed1fc31c9e4f51015a80dab797d3e 100644
--- a/doc/texinfo/api.texi
+++ b/doc/texinfo/api.texi
@@ -288,6 +288,8 @@ the same name, select the one that was added first.
 -
 @item Return:
 -
+@item Examples:
+Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L123,x3.py})
 @end table
 
 @item gmsh/model/getEntities
@@ -505,7 +507,7 @@ overall model.
 @item Return:
 integer value
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L77,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L11,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L63,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L63,faces.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L11,plugin.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L74,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L10,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L11,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L9,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/reparamOnFace.py#L23,reparamOnFace.py}, ...)
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L77,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L11,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L63,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L63,faces.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L11,plugin.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L74,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L72,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L10,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L11,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L9,plugin.py}, ...)
 @end table
 
 @item gmsh/model/removeEntities
@@ -1136,7 +1138,7 @@ automatically assigned to the nodes.
 @item Return:
 -
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L91,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L14,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L12,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L11,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L88,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L13,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/flatten.py#L37,flatten.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L16,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L10,plugin.py}, ...)
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L91,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L14,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L12,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L11,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L88,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L73,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L13,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/flatten.py#L37,flatten.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L16,mesh_from_discrete_curve.py}, ...)
 @end table
 
 @item gmsh/model/mesh/reclassifyNodes
@@ -1390,7 +1392,7 @@ are automatically assigned to the elements.
 @item Return:
 -
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L97,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L67,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L67,faces.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L94,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/terrain.py#L59,terrain.py})
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L97,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L67,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L67,faces.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L94,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L78,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/terrain.py#L59,terrain.py})
 @end table
 
 @item gmsh/model/mesh/getIntegrationPoints
@@ -3914,7 +3916,7 @@ associate a new tag. Return the view tag.
 @item Return:
 integer value
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L111,t4.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L246,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L18,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L17,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L20,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L119,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L90,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L41,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L16,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L228,poisson.py}, ...)
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L111,t4.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L246,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L18,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L17,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L20,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L119,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L27,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L90,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L41,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L16,plugin.py}, ...)
 @end table
 
 @item gmsh/view/remove
@@ -3983,7 +3985,7 @@ data. @code{partition} allows to specify data in several sub-sets.
 @item Return:
 -
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L248,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L19,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L21,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L91,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L17,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L229,poisson.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L20,view.py})
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L248,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L19,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L21,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L86,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L91,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L17,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L229,poisson.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L20,view.py})
 @end table
 
 @item gmsh/view/addHomogeneousModelData
@@ -4001,6 +4003,8 @@ but only if data is associated to elements of the same type for
 -
 @item Return:
 -
+@item Examples:
+Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L96,x3.py})
 @end table
 
 @item gmsh/view/getModelData
@@ -4034,7 +4038,7 @@ contains the data for the @code{numEle} elements.
 @item Return:
 -
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L25,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L42,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L19,view_combine.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.py#L20,viewlist.py})
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L25,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L44,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L42,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L19,view_combine.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.py#L20,viewlist.py})
 @end table
 
 @item gmsh/view/getListData
@@ -4068,7 +4072,7 @@ views) strings. @code{style} contains pairs of styling parameters, concatenated.
 @item Return:
 -
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L115,t4.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L123,t4.py})
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L115,t4.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L123,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L50,x3.py})
 @end table
 
 @item gmsh/view/getListDataStrings
@@ -4164,7 +4168,7 @@ file extension. Append to the file if @code{append} is set.
 @item Return:
 -
 @item Examples:
-C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L249,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L44,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L25,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L27,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L93,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L43,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L34,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L28,view.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L26,view_combine.py}, ...)
+C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L249,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L44,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L25,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L27,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L121,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L93,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L43,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L34,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L28,view.py}, ...)
 @end table
 
 @end ftable