diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d1605dce57231b50b45a06ad1d808b83c19275dc..d549f25a34c9c08c499f07b55d4f051d757f8e8e 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,6 @@
+4.10.2 (Work-in-progress): fixed regression introduced in 4.9 for recombined
+meshes with boundary layers.
+
 4.10.1 (May 1, 2022): small bug fixes.
 
 4.10.0 (April 25, 2022): more flexible homology/cohomology workflow in the API;
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4d32e7ddca94c64400b30ea050ecf736c5febc9..912dff46073c498a32b7c2f103cca0b6aca1831e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,7 +108,7 @@ opt(ZIPPER "Enable Zip file compression/decompression" OFF)
 
 set(GMSH_MAJOR_VERSION 4)
 set(GMSH_MINOR_VERSION 10)
-set(GMSH_PATCH_VERSION 1)
+set(GMSH_PATCH_VERSION 2)
 if(NOT GMSH_EXTRA_VERSION)
   set(GMSH_EXTRA_VERSION "")
 endif()
diff --git a/api/gmsh.h b/api/gmsh.h
index ea0a891402a17486ca5a30c8fbe0ac360274fe45..ab41cde5a4f861bf294f35ec98421d8ca82265de 100644
--- a/api/gmsh.h
+++ b/api/gmsh.h
@@ -6,7 +6,7 @@
 #ifndef GMSH_H
 #define GMSH_H
 
-// This file defines the Gmsh C++ API (v4.10.0).
+// This file defines the Gmsh C++ API (v4.10.2).
 //
 // Do not edit this file directly: it is automatically generated by `api/gen.py'.
 //
@@ -20,10 +20,10 @@
 #include <utility>
 #include <functional>
 
-#define GMSH_API_VERSION "4.10.0"
+#define GMSH_API_VERSION "4.10.2"
 #define GMSH_API_VERSION_MAJOR 4
 #define GMSH_API_VERSION_MINOR 10
-#define GMSH_API_VERSION_PATCH 0
+#define GMSH_API_VERSION_PATCH 2
 
 #if defined(GMSH_DLL)
 #if defined(GMSH_DLL_EXPORT)
diff --git a/api/gmsh.h_cwrap b/api/gmsh.h_cwrap
index 7719867646600869a6956fadf1642f89b2f91b87..875dce47bec490a0751641bb197e564562f76bf7 100644
--- a/api/gmsh.h_cwrap
+++ b/api/gmsh.h_cwrap
@@ -6,7 +6,7 @@
 #ifndef GMSH_H
 #define GMSH_H
 
-// This file redefines the Gmsh C++ API in terms of the C API (v4.10.0).
+// This file redefines the Gmsh C++ API in terms of the C API (v4.10.2).
 //
 // This is provided as a convenience for users of the binary Gmsh SDK whose C++
 // compiler ABI is not compatible with the ABI of the C++ compiler used to create
diff --git a/api/gmsh.jl b/api/gmsh.jl
index 463dcc5212e7c1ceb403793de40e37b4c84c3533..226e941f774a6deb8780b8fdbc6a8158b1639e43 100644
--- a/api/gmsh.jl
+++ b/api/gmsh.jl
@@ -3,7 +3,7 @@
 # See the LICENSE.txt file in the Gmsh root directory for license information.
 # Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
 
-# This file defines the Gmsh Julia API (v4.10.0).
+# This file defines the Gmsh Julia API (v4.10.2).
 #
 # Do not edit this file directly: it is automatically generated by `api/gen.py'.
 #
@@ -18,10 +18,10 @@ Top-level functions
 """
 module gmsh
 
-const GMSH_API_VERSION = "4.10.0"
+const GMSH_API_VERSION = "4.10.2"
 const GMSH_API_VERSION_MAJOR = 4
 const GMSH_API_VERSION_MINOR = 10
-const GMSH_API_VERSION_PATCH = 0
+const GMSH_API_VERSION_PATCH = 2
 const libdir = dirname(@__FILE__)
 const libname = Sys.iswindows() ? "gmsh-4.10.dll" : "libgmsh"
 import Libdl
diff --git a/api/gmsh.py b/api/gmsh.py
index 089026cbd0a56d804ca71f1b27d9d1431105fe80..5279bc4f4fd2ab19d75d16862047ea972cf7bee1 100644
--- a/api/gmsh.py
+++ b/api/gmsh.py
@@ -3,7 +3,7 @@
 # See the LICENSE.txt file in the Gmsh root directory for license information.
 # Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
 
-# This file defines the Gmsh Python API (v4.10.0).
+# This file defines the Gmsh Python API (v4.10.2).
 #
 # Do not edit this file directly: it is automatically generated by `api/gen.py'.
 #
@@ -18,10 +18,10 @@ import os
 import platform
 from math import pi
 
-GMSH_API_VERSION = "4.10.0"
+GMSH_API_VERSION = "4.10.2"
 GMSH_API_VERSION_MAJOR = 4
 GMSH_API_VERSION_MINOR = 10
-GMSH_API_VERSION_PATCH = 0
+GMSH_API_VERSION_PATCH = 2
 
 __version__ = GMSH_API_VERSION
 
diff --git a/api/gmshc.h b/api/gmshc.h
index bde7060d9bb5ef8ab6f8ae8df9ccc10660431b16..41adfc119b82813d5b62928ffd0fae9fa1603193 100644
--- a/api/gmshc.h
+++ b/api/gmshc.h
@@ -9,7 +9,7 @@
 #define GMSHC_H
 
 /*
- * This file defines the Gmsh C API (v4.10.0).
+ * This file defines the Gmsh C API (v4.10.2).
  *
  * Do not edit this file directly: it is automatically generated by `api/gen.py'.
  *
@@ -19,10 +19,10 @@
 
 #include <stddef.h>
 
-#define GMSH_API_VERSION "4.10.0"
+#define GMSH_API_VERSION "4.10.2"
 #define GMSH_API_VERSION_MAJOR 4
 #define GMSH_API_VERSION_MINOR 10
-#define GMSH_API_VERSION_PATCH 0
+#define GMSH_API_VERSION_PATCH 2
 
 #if defined(GMSH_DLL)
 #if defined(GMSH_DLL_EXPORT)
diff --git a/api/gmshf.h b/api/gmshf.h
index 5f66b77ee5d7d87489808e0181f9498ea5565db9..1edd5a71dde0c0e606d96c568866b2839b03c5b7 100644
--- a/api/gmshf.h
+++ b/api/gmshf.h
@@ -10,7 +10,7 @@ c
 !DEC$ DEFINE GMSHF_H
 
 c
-c  This file defines the Gmsh Fortran API (v4.10.0).
+c  This file defines the Gmsh Fortran API (v4.10.2).
 c
 c  Do not edit this file directly: it is automatically generated by `api/gen.py'.
 c
@@ -21,13 +21,13 @@ c
 
 !DEC$ DEFINE GMSH_API_VERSION_MAJOR = 4
 !DEC$ DEFINE GMSH_API_VERSION_MINOR = 10
-!DEC$ DEFINE GMSH_API_VERSION_PATCH = 0
+!DEC$ DEFINE GMSH_API_VERSION_PATCH = 2
 
       module gmsh_fortran
 
         use, intrinsic :: iso_c_binding
 
-        character(len = 5), parameter :: GMSH_API_VERSION = "4.10.0"
+        character(len = 5), parameter :: GMSH_API_VERSION = "4.10.2"
         real(c_double), parameter::M_PI = 3.14159265358979323846d0
 
         interface
diff --git a/benchmarks/2d/naca12_2d.geo b/benchmarks/2d/naca12_2d.geo
index f348e0e2ca4f7dd4f4ce677b5c39c1688b756174..c6579ccc9f5f29c67fbbfd5acd66c4e2fd2fc1bb 100644
--- a/benchmarks/2d/naca12_2d.geo
+++ b/benchmarks/2d/naca12_2d.geo
@@ -250,3 +250,6 @@ Background Field = 3;
 BoundaryLayer Field = 2;
 
 Mesh.BoundaryLayerFanElements = 30;
+
+//Mesh.Algorithm = 8; // del for quads
+//Mesh.RecombineAll = 1;
diff --git a/benchmarks/2d/naca12_2d_trailing.geo b/benchmarks/2d/naca12_2d_trailing.geo
index 3b8a1ca084e310305fdbd9b36665dba379eb5530..e57db5872d1be91d1ba845e977d0dfa66f6b9e6c 100755
--- a/benchmarks/2d/naca12_2d_trailing.geo
+++ b/benchmarks/2d/naca12_2d_trailing.geo
@@ -1,5 +1,5 @@
 lc = .033 ;
-lc2 = 2.2 ;
+lc2 = 0.3 ;
 lc3 = .03 ;
 Point(1) =  {1.000000e+00,0.000000e+00,0.000000e+00,lc3};
 Point(2) =  {9.997533e-01,0.000000e+00,-3.498543e-05,lc};
@@ -238,3 +238,6 @@ Field[2].FanPointsList = {1004};
 Field[2].Quads = 1;
 
 BoundaryLayer Field = 2;
+
+Mesh.Algorithm = 8; // del for quads
+Mesh.RecombineAll = 1;
diff --git a/doc/texinfo/api.texi b/doc/texinfo/api.texi
index 038dbd3c51cf207af355a8f9f140f81453329bfc..10f9c57ed0201316b228e28de1aba31fc5df5dfd 100644
--- a/doc/texinfo/api.texi
+++ b/doc/texinfo/api.texi
@@ -1179,7 +1179,7 @@ entities.
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L643,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L551,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L1636,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L1333,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L133,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L166,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/opt.py#L12,opt.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_boundary_layer.py#L53,tube_boundary_layer.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L140,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L166,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/opt.py#L12,opt.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_boundary_layer.py#L53,tube_boundary_layer.py})
 @end table
 
 @item gmsh/model/mesh/recombine
@@ -1225,7 +1225,7 @@ Set the order of the elements in the mesh of the current model to @code{order}.
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L661,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L564,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L1688,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L1377,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/x6.cpp#L27,x6.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/x6.py#L27,x6.py}, @url{@value{GITLAB-PREFIX}/examples/api/hybrid_order.py#L18,hybrid_order.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L132,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L165,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_boundary_layer.py#L52,tube_boundary_layer.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/x6.cpp#L27,x6.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/x6.py#L27,x6.py}, @url{@value{GITLAB-PREFIX}/examples/api/hybrid_order.py#L18,hybrid_order.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L139,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L165,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_boundary_layer.py#L52,tube_boundary_layer.py})
 @end table
 
 @item gmsh/model/mesh/getLastEntityError
@@ -1356,6 +1356,8 @@ of type @code{elementType}. The other arguments are treated as in
 -
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L726,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L622,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L1841,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L1531,Julia}
+@item Examples:
+Python (@url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L19,stl_to_brep.py})
 @end table
 
 @item gmsh/model/mesh/getNode
@@ -1696,7 +1698,7 @@ indexed by @code{task}.
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L947,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L822,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L2338,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L1963,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/x7.cpp#L58,x7.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/x7.py#L50,x7.py}, @url{@value{GITLAB-PREFIX}/examples/api/adapt_mesh.py#L18,adapt_mesh.py}, @url{@value{GITLAB-PREFIX}/examples/api/neighbors.py#L15,neighbors.py}, @url{@value{GITLAB-PREFIX}/examples/api/poisson.py#L95,poisson.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/x7.cpp#L58,x7.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/x7.py#L50,x7.py}, @url{@value{GITLAB-PREFIX}/examples/api/adapt_mesh.py#L18,adapt_mesh.py}, @url{@value{GITLAB-PREFIX}/examples/api/neighbors.py#L15,neighbors.py}, @url{@value{GITLAB-PREFIX}/examples/api/poisson.py#L95,poisson.py}, @url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L18,stl_to_brep.py})
 @end table
 
 @item gmsh/model/mesh/getMaxElementTag
@@ -2256,7 +2258,7 @@ indexed by @code{task}.
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L1312,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L1158,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L3050,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L2585,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/x7.cpp#L34,x7.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/x7.py#L30,x7.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/x7.cpp#L34,x7.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/x7.py#L30,x7.py}, @url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L20,stl_to_brep.py})
 @end table
 
 @item gmsh/model/mesh/getElementFaceNodes
@@ -3174,7 +3176,7 @@ Set the numerical list option @code{option} to value @code{value} for field
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L1788,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L1573,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L4163,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L3601,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t10.cpp#L48,t10.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t10.py#L44,t10.py}, @url{@value{GITLAB-PREFIX}/examples/api/extend_field.py#L23,extend_field.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L115,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/ocean.py#L4544,ocean.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t10.cpp#L48,t10.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t10.py#L44,t10.py}, @url{@value{GITLAB-PREFIX}/examples/api/extend_field.py#L23,extend_field.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L122,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/ocean.py#L4544,ocean.py})
 @end table
 
 @item gmsh/model/mesh/field/getNumbers
@@ -3220,7 +3222,7 @@ Set the field @code{tag} as a boundary layer size field.
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L1807,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L1589,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L4217,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L3651,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L125,naca_boundary_layer_2d.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L132,naca_boundary_layer_2d.py})
 @end table
 
 @end ftable
@@ -4121,7 +4123,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2358,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2073,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5349,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L4638,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/crack.py#L13,crack.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L67,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L70,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_hole_boundary_layer.py#L30,tube_hole_boundary_layer.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/crack.py#L13,crack.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L67,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L70,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L41,stl_to_brep.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_hole_boundary_layer.py#L30,tube_hole_boundary_layer.py})
 @end table
 
 @item gmsh/model/occ/addCircleArc
@@ -4162,7 +4164,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2382,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2095,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5396,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L4681,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t19.cpp#L25,t19.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t19.py#L23,t19.py}, @url{@value{GITLAB-PREFIX}/examples/api/bspline_bezier_trimmed.py#L30,bspline_bezier_trimmed.py}, @url{@value{GITLAB-PREFIX}/examples/api/closest_point.py#L7,closest_point.py}, @url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L4,prim_axis.py}, @url{@value{GITLAB-PREFIX}/examples/api/trimmed.py#L9,trimmed.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t19.cpp#L25,t19.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t19.py#L23,t19.py}, @url{@value{GITLAB-PREFIX}/examples/api/bspline_bezier_trimmed.py#L30,bspline_bezier_trimmed.py}, @url{@value{GITLAB-PREFIX}/examples/api/closest_point.py#L7,closest_point.py}, @url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L6,prim_axis.py}, @url{@value{GITLAB-PREFIX}/examples/api/trimmed.py#L9,trimmed.py})
 @end table
 
 @item gmsh/model/occ/addEllipseArc
@@ -4204,7 +4206,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2416,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2127,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5457,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L4727,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L9,prim_axis.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L11,prim_axis.py})
 @end table
 
 @item gmsh/model/occ/addSpline
@@ -4306,7 +4308,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2482,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2188,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5596,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L4833,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t19.cpp#L26,t19.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t19.py#L24,t19.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L73,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/surface_filling.py#L16,surface_filling.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t19.cpp#L26,t19.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t19.py#L24,t19.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L73,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L46,stl_to_brep.py}, @url{@value{GITLAB-PREFIX}/examples/api/surface_filling.py#L16,surface_filling.py})
 @end table
 
 @item gmsh/model/occ/addRectangle
@@ -4348,7 +4350,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2509,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2213,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5652,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L4876,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t19.cpp#L77,t19.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t19.py#L68,t19.py}, @url{@value{GITLAB-PREFIX}/examples/api/pipe.py#L23,pipe.py}, @url{@value{GITLAB-PREFIX}/examples/api/poisson.py#L37,poisson.py}, @url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L13,prim_axis.py})
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t19.cpp#L77,t19.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t19.py#L68,t19.py}, @url{@value{GITLAB-PREFIX}/examples/api/pipe.py#L23,pipe.py}, @url{@value{GITLAB-PREFIX}/examples/api/poisson.py#L37,poisson.py}, @url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L15,prim_axis.py})
 @end table
 
 @item gmsh/model/occ/addPlaneSurface
@@ -4368,7 +4370,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2525,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2228,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5685,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L4897,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L109,naca_boundary_layer_2d.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L118,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L47,stl_to_brep.py})
 @end table
 
 @item gmsh/model/occ/addSurfaceFilling
@@ -4534,6 +4536,8 @@ that share geometrically identical (but topologically different) curves.
 integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2654,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2348,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5915,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L5070,Julia}
+@item Examples:
+Python (@url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L56,stl_to_brep.py})
 @end table
 
 @item gmsh/model/occ/addVolume
@@ -4552,6 +4556,8 @@ tag of the volume.
 integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2665,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2358,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L5940,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L5091,Julia}
+@item Examples:
+Python (@url{@value{GITLAB-PREFIX}/examples/api/stl_to_brep.py#L57,stl_to_brep.py})
 @end table
 
 @item gmsh/model/occ/addSphere
@@ -4654,7 +4660,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2745,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2433,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L6084,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L5199,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L19,prim_axis.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L21,prim_axis.py})
 @end table
 
 @item gmsh/model/occ/addTorus
@@ -4675,7 +4681,7 @@ integer value
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2763,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2450,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L6117,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L5220,Julia}
 @item Examples:
-Python (@url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L16,prim_axis.py})
+Python (@url{@value{GITLAB-PREFIX}/examples/api/prim_axis.py#L18,prim_axis.py})
 @end table
 
 @item gmsh/model/occ/addThruSections
@@ -4888,7 +4894,7 @@ Remove the object if @code{removeObject} is set. Remove the tool if
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L2929,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2605,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L6442,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L5506,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t16.cpp#L41,t16.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t16.py#L32,t16.py}, @url{@value{GITLAB-PREFIX}/examples/api/boolean.py#L27,boolean.py}, @url{@value{GITLAB-PREFIX}/examples/api/extend_field.py#L7,extend_field.py}, @url{@value{GITLAB-PREFIX}/examples/api/gui.py#L28,gui.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L111,naca_boundary_layer_2d.py}, ...)
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t16.cpp#L41,t16.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t16.py#L32,t16.py}, @url{@value{GITLAB-PREFIX}/examples/api/boolean.py#L27,boolean.py}, @url{@value{GITLAB-PREFIX}/examples/api/extend_field.py#L7,extend_field.py}, @url{@value{GITLAB-PREFIX}/examples/api/gui.py#L28,gui.py}, @url{@value{GITLAB-PREFIX}/examples/api/spherical_surf.py#L13,spherical_surf.py}, ...)
 @end table
 
 @item gmsh/model/occ/fragment
@@ -5159,7 +5165,7 @@ entities are returned as a vector of (dim, tag) integer pairs.
 @item Language-specific definition:
 @url{@value{GITLAB-PREFIX}/api/gmsh.h#L3097,C++}, @url{@value{GITLAB-PREFIX}/api/gmshc.h#L2756,C}, @url{@value{GITLAB-PREFIX}/api/gmsh.py#L6797,Python}, @url{@value{GITLAB-PREFIX}/api/gmsh.jl#L5846,Julia}
 @item Examples:
-C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t20.cpp#L90,t20.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t20.py#L73,t20.py}, @url{@value{GITLAB-PREFIX}/examples/api/bspline_bezier_patches.py#L70,bspline_bezier_patches.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_2d.py#L71,naca_boundary_layer_2d.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L74,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_boundary_layer.py#L17,tube_boundary_layer.py}, ...)
+C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t20.cpp#L90,t20.cpp}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t20.py#L73,t20.py}, @url{@value{GITLAB-PREFIX}/examples/api/bspline_bezier_patches.py#L70,bspline_bezier_patches.py}, @url{@value{GITLAB-PREFIX}/examples/api/naca_boundary_layer_3d.py#L74,naca_boundary_layer_3d.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_boundary_layer.py#L17,tube_boundary_layer.py}, @url{@value{GITLAB-PREFIX}/examples/api/tube_hole_boundary_layer.py#L52,tube_hole_boundary_layer.py})
 @end table
 
 @item gmsh/model/occ/getEntitiesInBoundingBox
diff --git a/doc/texinfo/version.texi b/doc/texinfo/version.texi
index 27a785272077d43b400bb728ae9fc97d8d8d9a72..c5f90c86e41236aacbd3f0163f1c69793ffed7c5 100644
--- a/doc/texinfo/version.texi
+++ b/doc/texinfo/version.texi
@@ -1,4 +1,4 @@
 @c This file was generated by cmake: do not edit manually!
 
-@set GMSH-VERSION 4.10.1 (development version)
+@set GMSH-VERSION 4.10.2 (development version)
 @set GITLAB-PREFIX https://gitlab.onelab.info/gmsh/gmsh/blob/master
diff --git a/src/geo/GModelIO_OCC.cpp b/src/geo/GModelIO_OCC.cpp
index e1eda87840c65a9195c52fe10ebebeb16d5de69a..7fc3bb06974063d89dfd271ec523475c6c5fe2b7 100644
--- a/src/geo/GModelIO_OCC.cpp
+++ b/src/geo/GModelIO_OCC.cpp
@@ -4416,6 +4416,11 @@ bool OCC_Internals::exportShapes(GModel *model, const std::string &fileName,
             split[2] == ".STEP" || split[2] == ".STP") {
       STEPControl_Writer writer;
       setTargetUnit(CTX::instance()->geom.occTargetUnit);
+
+      // this does not seem to solve the issue that entities get duplicated when
+      // exporting STEP files (see issue #906):
+      // Interface_Static::SetIVal("write.step.nonmanifold", 1);
+
       if(writer.Transfer(c, STEPControl_AsIs) == IFSelect_RetDone) {
         if(writer.Write(occfile.ToCString()) != IFSelect_RetDone) {
           Msg::Error("Could not create file '%s'", fileName.c_str());
diff --git a/src/mesh/meshGFace.cpp b/src/mesh/meshGFace.cpp
index a8c4e24b8ab7ec68d255f1e5fc0054b33e355084..c7e9b47c44f3e4b94c0a907bd650017eb7bf5caa 100644
--- a/src/mesh/meshGFace.cpp
+++ b/src/mesh/meshGFace.cpp
@@ -825,6 +825,8 @@ static void addOrRemove(MVertex *v1, MVertex *v2,
   }
 }
 
+bool meshGenerator(GFace *, int, bool, int, bool, std::vector<GEdge *> *);
+
 static void modifyInitialMeshForBoundaryLayers(
   GFace *gf, std::vector<MQuadrangle *> &blQuads,
   std::vector<MTriangle *> &blTris, std::set<MVertex *> &verts, bool debug)
@@ -1018,7 +1020,7 @@ static void modifyInitialMeshForBoundaryLayers(
 
   deMeshGFace kil_;
   kil_(gf);
-  meshGenerator(gf, 0, 0, true, false, &hop);
+  meshGenerator(gf, 0, false, 99, false, &hop);
 }
 
 static bool improved_translate(GFace *gf, MVertex *vertex, SVector3 &v1,
@@ -1154,7 +1156,7 @@ static void _deleteUnusedVertices(GFace *gf)
 // Builds An initial triangular mesh that respects the boundaries of
 // the domain, including embedded points and surfaces
 bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
-                   bool onlyInitialMesh, bool debug,
+                   int onlyInitialMesh, bool debug,
                    std::vector<GEdge *> *replacement_edges)
 {
   if(CTX::instance()->debugSurface > 0 &&
@@ -1768,8 +1770,8 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   splitElementsInBoundaryLayerIfNeeded(gf);
 
   if((CTX::instance()->mesh.recombineAll || gf->meshAttributes.recombine) &&
-     (CTX::instance()->mesh.algoRecombine <= 1 ||
-      CTX::instance()->mesh.algoRecombine == 4)) {
+     (onlyInitialMesh != 99) && (CTX::instance()->mesh.algoRecombine <= 1 ||
+                                 CTX::instance()->mesh.algoRecombine == 4)) {
 
     if(CTX::instance()->mesh.algoRecombine == 4) {
       meshGFaceQuadrangulateBipartiteLabelling(gf->tag());
@@ -2989,8 +2991,9 @@ void meshGFace::operator()(GFace *gf, bool print)
   }
   else {
     meshGenerator(gf, 0, repairSelfIntersecting1dMesh,
-                  gf->getMeshingAlgo() == ALGO_2D_INITIAL_ONLY,
-                  debugSurface >= 0 || debugSurface == -100);
+                  (gf->getMeshingAlgo() == ALGO_2D_INITIAL_ONLY) ? 1 : 0,
+                  (debugSurface >= 0 || debugSurface == -100),
+                  NULL);
   }
 
   Msg::Debug("Type %d %d triangles generated, %d internal nodes",
diff --git a/src/mesh/meshGFace.h b/src/mesh/meshGFace.h
index 665982c00382c95826fe51548003a2c0b40d658b..a1f002d14685db673bf275c2cab175d33ccbc862 100644
--- a/src/mesh/meshGFace.h
+++ b/src/mesh/meshGFace.h
@@ -50,9 +50,6 @@ int MeshTransfiniteSurface(GFace *gf);
 int MeshExtrudedSurface(
   GFace *gf,
   std::set<std::pair<MVertex *, MVertex *> > *constrainedEdges = nullptr);
-bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
-                   bool onlyInitialMesh, bool debug = true,
-                   std::vector<GEdge *> *replacement_edges = nullptr);
 bool pointInsideParametricDomain(std::vector<SPoint2> &bnd, SPoint2 &p,
                                  SPoint2 &out, int &N);