From ca6b87abe2fd39460f314a7bff6a3dce3ee78096 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 10 Jul 2017 21:24:28 +0200
Subject: [PATCH] fix issue #323: extrusion of points would not return the
 correct entities

---
 Common/CMakeLists.txt | 1 +
 Geo/GModelIO_OCC.cpp  | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt
index 8742f1ce5f..282e7218e8 100644
--- a/Common/CMakeLists.txt
+++ b/Common/CMakeLists.txt
@@ -24,6 +24,7 @@ set(SRC
   onelabUtils.cpp
   GamePad.cpp
   GmshRemote.cpp
+  GmshAPI.cpp
 )
 
 if(ENABLE_ONELAB AND NOT ENABLE_ONELAB2)
diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp
index 9d4504f66a..92583faa85 100644
--- a/Geo/GModelIO_OCC.cpp
+++ b/Geo/GModelIO_OCC.cpp
@@ -1941,15 +1941,16 @@ bool OCC_Internals::_extrude(int mode,
   _multiBind(result, -1, outDimTags, true, true);
 
   // return entities in the same order as the built-in kernel extrusion
-  if(dim >= 1 && dim <= 3 && top.size() == inDimTags.size() &&
-     top.size() == body.size() && top.size() == lateral.size()){
+  if(dim >= 1 && dim <= 3 &&
+     top.size() == inDimTags.size() && top.size() == body.size()){
     outDimTags.clear();
     for(unsigned int i = 0; i < top.size(); i++){
       if(_isBound(dim - 1, top[i]))
         outDimTags.push_back(std::pair<int, int>(dim - 1, _find(dim - 1, top[i])));
       if(_isBound(dim, body[i]))
         outDimTags.push_back(std::pair<int, int>(dim, _find(dim, body[i])));
-      if(CTX::instance()->geom.extrudeReturnLateral){
+      if(CTX::instance()->geom.extrudeReturnLateral &&
+         top.size() == lateral.size()){
         for(unsigned int j = 0; j < lateral[i].size(); j++){
           if(_isBound(dim - 1, lateral[i][j]))
             outDimTags.push_back
-- 
GitLab