From: eap Date: Fri, 6 Sep 2019 16:02:21 +0000 (+0300) Subject: #17636 [CEA 17369] Extrusion by normal: along average normal option issue X-Git-Tag: V9_4_0a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b26faec59918ed0fa8e7ecd35991dae979229164;p=modules%2Fsmesh.git #17636 [CEA 17369] Extrusion by normal: along average normal option issue --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index d029fe5ca..7466070e4 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -5850,6 +5850,11 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet theElemSets[2], } else { + if ( theParams.ToMakeBoundary() ) + { + GetMeshDS()->Modified(); + throw SALOME_Exception( SMESH_Comment("Can't extrude node #") << node->GetID() ); + } break; // newNodesItVec will be shorter than nbNodes } } diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index cb9c2d6bc..2fe9e92bc 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -1223,8 +1223,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() bool byAverageNormal = ByAverageNormalCheck->isChecked(); int dim = (maxSelType == SMESH::FACE) ? 2 : 1; - groups = meshEditor->ExtrusionByNormal( faces, stepSize, nbSteps, useInputElemsOnly, - byAverageNormal, makeGroups, dim ); + groups = meshEditor->ExtrusionByNormal( faces, stepSize, nbSteps, byAverageNormal, + useInputElemsOnly, makeGroups, dim ); } else { @@ -1261,9 +1261,9 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() SMESH::Update( actor->getIO(), actor->GetVisibility() ); if ( makeGroups ) mySMESHGUI->updateObjBrowser(true); // new groups may appear - Init(false); + mySelectionMgr->clearSelected(); - SelectorWdg->Clear(); + Init(false); SMESHGUI::Modified(); } @@ -1615,8 +1615,8 @@ void SMESHGUI_ExtrusionDlg::onDisplaySimulation( bool toDisplayPreview ) bool byAverageNormal = ByAverageNormalCheck->isChecked(); int dim = (maxSelType == SMESH::FACE) ? 2 : 1; - groups = meshEditor->ExtrusionByNormal( faces, stepSize, nbSteps, useInputElemsOnly, - byAverageNormal, makeGroups, dim ); + groups = meshEditor->ExtrusionByNormal( faces, stepSize, nbSteps, byAverageNormal, + useInputElemsOnly, makeGroups, dim ); } else { diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index afa315b9b..df65f685f 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -5595,6 +5595,8 @@ class Mesh(metaclass = MeshMeta): if isinstance( Elements, list ): if not Elements: raise RuntimeError("Elements empty!") + if isinstance( Elements[0], Mesh ): + Elements = [ Elements[0].GetMesh() ] if isinstance( Elements[0], int ): Elements = self.GetIDSource( Elements, SMESH.ALL ) unRegister.set( Elements )