void ExtrusionSweep(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps);
+ /*!
+ * \brief Genarate dim+1 elements by extrusion of elements along vector
+ * \param IDsOfElements - elements to sweep
+ * \param StepVector - vector giving direction and distance of an extrusion step
+ * \param NbOfSteps - number of elements to generate from one element
+ */
+ void ExtrusionSweep0D(in long_array IDsOfElements,
+ in DirStruct StepVector,
+ in long NbOfSteps);
/*!
* \brief Same as previous but additionally create groups of elements
* generated from elements belonging to preexisting groups
ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
in DirStruct StepVector,
in long NbOfSteps);
+ /*!
+ * \brief Same as previous but elements are nodes
+ */
+ ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
+ in DirStruct StepVector,
+ in long NbOfSteps);
/*!
* Generate new elements by extrusion of theElements
* by StepVector by NbOfSteps
in DirStruct StepVector,
in long NbOfSteps);
+ void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
+ in DirStruct StepVector,
+ in long NbOfSteps);
+ ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
+ in DirStruct StepVector,
+ in long NbOfSteps);
+
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
in DirStruct StepVector,
in long NbOfSteps);
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
+ QPixmap image3 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
setModal( false );
setAttribute( Qt::WA_DeleteOnClose, true );
ConstructorsBoxLayout->setSpacing(SPACING);
ConstructorsBoxLayout->setMargin(MARGIN);
+ RadioButton0= new QRadioButton(ConstructorsBox);
+ RadioButton0->setIcon(image3);
RadioButton1= new QRadioButton(ConstructorsBox);
RadioButton1->setIcon(image0);
RadioButton2= new QRadioButton(ConstructorsBox);
RadioButton2->setIcon(image1);
+ ConstructorsBoxLayout->addWidget(RadioButton0);
ConstructorsBoxLayout->addWidget(RadioButton1);
ConstructorsBoxLayout->addWidget(RadioButton2);
- GroupConstructors->addButton(RadioButton1, 0);
- GroupConstructors->addButton(RadioButton2, 1);
+ GroupConstructors->addButton(RadioButton0, 0);
+ GroupConstructors->addButton(RadioButton1, 1);
+ GroupConstructors->addButton(RadioButton2, 2);
/***************************************************************/
GroupButtons = new QGroupBox(this);
GroupButtonsLayout->addWidget(buttonHelp);
/***************************************************************/
- GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
+ GroupArguments = new QGroupBox(tr("EXTRUSION_0D"), this);
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
GroupArgumentsLayout->setSpacing(SPACING);
GroupArgumentsLayout->setMargin(MARGIN);
SpinBox_NbSteps->setRange(1, 999999);
SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
- RadioButton1->setChecked(true);
+ RadioButton0->setChecked(true);
RadioButton3->setChecked(true);
MakeGroupsCheck->setChecked(true);
switch (constructorId) {
case 0:
{
- GroupArguments->setTitle(tr("EXTRUSION_1D"));
+ GroupArguments->setTitle(tr("EXTRUSION_0D"));
if (!CheckBoxMesh->isChecked())
- {
- LineEditElements->clear();
- myIDs.clear();
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
+ {
+ LineEditElements->clear();
+ myIDs.clear();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ }
break;
}
case 1:
+ {
+ GroupArguments->setTitle(tr("EXTRUSION_1D"));
+ if (!CheckBoxMesh->isChecked())
+ {
+ LineEditElements->clear();
+ myIDs.clear();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
+ break;
+ }
+ case 2:
{
GroupArguments->setTitle(tr("EXTRUSION_2D"));
if (!CheckBoxMesh->isChecked())
- {
- LineEditElements->clear();
- myIDs.clear();
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ {
+ LineEditElements->clear();
+ myIDs.clear();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
break;
}
}
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
- if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ if( CheckBoxMesh->isChecked() )
+ switch (GetConstructorId() ) {
+ case 0:
+ {
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepObject0DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ case 1:
+ {
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ case 2:
+ {
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ }
+ else
+ {
+ SMESH::ListOfGroups_var groups;
+ if (GetConstructorId() == 0)
+ groups = aMeshEditor->ExtrusionSweepMakeGroups0D(myElementsId.inout(), aVector, aNbSteps);
else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ groups = aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
}
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
+
}
else {
- if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
- else
- aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+ if( CheckBoxMesh->isChecked() )
+ switch( GetConstructorId() ) {
+ case 0:
+ {
+ aMeshEditor->ExtrusionSweepObject0D(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ case 1:
+ {
+ aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ case 2:
+ {
+ aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
}
else
- aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+ if (GetConstructorId() == 0)
+ aMeshEditor->ExtrusionSweep0D(myElementsId.inout(), aVector, aNbSteps);
+ else
+ aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
if (send == LineEditElements)
{
SMDS_Mesh* aMesh = myActor ? myActor->GetObject()->GetMesh() : 0;
- SMESH::ElementType SMESHType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
- SMDSAbs_ElementType SMDSType = GetConstructorId() ? SMDSAbs_Face: SMDSAbs_Edge;
-
+ SMESH::ElementType SMESHType;
+ SMDSAbs_ElementType SMDSType;
+ switch (GetConstructorId()) {
+ case 0:
+ {
+ SMESHType = SMESH::NODE;
+ SMDSType = SMDSAbs_Node;
+ break;
+ }
+ case 1:
+ {
+ SMESHType = SMESH::EDGE;
+ SMDSType = SMDSAbs_Edge;
+ break;
+ }
+ case 2:
+ {
+ SMESHType = SMESH::FACE;
+ SMDSType = SMDSAbs_Face;
+ break;
+ }
+ }
myElementsId = new SMESH::long_array;
myElementsId->length( aListId.count() );
TColStd_MapOfInteger newIndices;
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
int aConstructorId = GetConstructorId();
- if (aConstructorId == 0)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
- else if (aConstructorId == 1)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ switch(aConstructorId) {
+ case 0:
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ break;
+ }
+ case 1:
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ break;
+ }
+ case 2:
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
- }
+ break;
+ }
+ }
}
}
else if (send == SelectVectorButton){
LineEditElements->setValidator(0);
} else {
int aConstructorId = GetConstructorId();
- if (aConstructorId == 0)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
- else if (aConstructorId == 1)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
-
+ switch(aConstructorId) {
+ case 0:
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ break;
+ }
+ case 1:
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ break;
+ }
+ case 2:
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ break;
+ }
+ }
LineEditElements->setReadOnly(false);
LineEditElements->setValidator(myIdValidator);
onTextChange(LineEditElements->text());
if ( !myFilterDlg )
{
QList<int> types;
+ types.append( SMESH::NODE );
types.append( SMESH::EDGE );
types.append( SMESH::FACE );
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
}
- myFilterDlg->Init( GetConstructorId() ? SMESH::FACE : SMESH::EDGE );
+ switch( GetConstructorId() ){
+ case 0:
+ {
+ myFilterDlg->Init( SMESH::NODE );
+ break;
+ }
+ case 1:
+ {
+ myFilterDlg->Init( SMESH::EDGE );
+ break;
+ }
+ case 2:
+ {
+ myFilterDlg->Init( SMESH::FACE );
+ break;
+ }
+ }
+
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMesh );
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
- else
- aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+ switch (GetConstructorId()) {
+ case 0:
+ {
+ aMeshEditor->ExtrusionSweepObject0D(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ case 1:
+ {
+ aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ case 2:
+ {
+ aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+ break;
+ }
+ }
}
else
- aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+ if(GetConstructorId() == 0)
+ aMeshEditor->ExtrusionSweep0D(myElementsId.inout(), aVector, aNbSteps);
+ else
+ aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
mySimulation->SetData(aMeshPreviewStruct._retn());
// widgets
QGroupBox* ConstructorsBox;
QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton0;
QRadioButton* RadioButton1;
QRadioButton* RadioButton2;
QRadioButton* RadioButton3;
<source>CANT_GET_TANGENT</source>
<translation>Can't get tangent for one of the path nodes</translation>
</message>
+ <message>
+ <source>EXTRUSION_0D</source>
+ <translation>Extrusion of 0D elements</translation>
+ </message>
<message>
<source>EXTRUSION_1D</source>
<translation>Extrusion of 1D elements</translation>
if ( type == theAvoidType ||
( theSelectType != SMDSAbs_All && type != theSelectType ))
continue;
-
- if ( const SMDS_MeshElement* anElemCopy = Copy( anElem ))
+ const SMDS_MeshElement* anElemCopy;
+ if ( type == SMDSAbs_Node)
+ anElemCopy = Copy( cast2Node(anElem) );
+ else
+ anElemCopy = Copy( anElem );
+ if ( anElemCopy )
theCopyElements.insert( theCopyElements.end(), anElemCopy );
}
}
gp_Vec stepVec( P->x, P->y, P->z );
TIDSortedElemSet* workElements = & elements;
- TPreviewMesh tmpMesh( SMDSAbs_Face );
- SMESH_Mesh* mesh = myMesh;
-
+
+ SMDSAbs_ElementType aType = SMDSAbs_Face;
+ ::SMESH_MeshEditor::ExtrusionFlags aFlag = ::SMESH_MeshEditor::ExtrusionFlags::EXTRUSION_FLAG_BOUNDARY;
+ if (theElementType == SMDSAbs_Node)
+ {
+ aType = SMDSAbs_Edge;
+ aFlag = ::SMESH_MeshEditor::ExtrusionFlags::EXTRUSION_FLAG_SEW;
+ }
+ TPreviewMesh tmpMesh( aType );
+ SMESH_Mesh* mesh = myMesh;
+
if ( myPreviewMode ) {
SMDSAbs_ElementType select = SMDSAbs_All, avoid = SMDSAbs_Volume;
tmpMesh.Copy( elements, copyElements, select, avoid );
TElemOfElemListMap aHystory;
::SMESH_MeshEditor anEditor( mesh );
- ::SMESH_MeshEditor::PGroupIDs groupIds =
- anEditor.ExtrusionSweep (*workElements, stepVec, theNbOfSteps, aHystory, theMakeGroups);
+ ::SMESH_MeshEditor::PGroupIDs groupIds =
+ anEditor.ExtrusionSweep (*workElements, stepVec, theNbOfSteps, aHystory, theMakeGroups, aFlag);
myMesh->GetMeshDS()->Modified();
storeResult(anEditor);
}
}
+//=======================================================================
+//function : ExtrusionSweep0D
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::ExtrusionSweep0D(const SMESH::long_array & theIDsOfElements,
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps)
+{
+ extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
+ if (!myPreviewMode) {
+ TPythonDump() << this << ".ExtrusionSweep0D( "
+ << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ }
+}
//=======================================================================
//function : ExtrusionSweepObject
}
}
+//=======================================================================
+//function : ExtrusionSweepObject0D
+//purpose :
+//=======================================================================
+
+void SMESH_MeshEditor_i::ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps)
+{
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Node );
+ if ( !myPreviewMode ) {
+ TPythonDump() << this << ".ExtrusionSweepObject0D( "
+ << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ }
+}
+
//=======================================================================
//function : ExtrusionSweepObject1D
//purpose :
return aGroups;
}
+//=======================================================================
+//function : ExtrusionSweepMakeGroups0D
+//purpose :
+//=======================================================================
+
+SMESH::ListOfGroups*
+SMESH_MeshEditor_i::ExtrusionSweepMakeGroups0D(const SMESH::long_array& theIDsOfElements,
+ const SMESH::DirStruct& theStepVector,
+ CORBA::Long theNbOfSteps)
+{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
+ SMESH::ListOfGroups* aGroups = extrusionSweep(theIDsOfElements, theStepVector, theNbOfSteps, true,SMDSAbs_Node);
+
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".ExtrusionSweepMakeGroups0D( " << theIDsOfElements
+ << ", " << theStepVector <<", " << theNbOfSteps << " )";
+ }
+ return aGroups;
+}
+
//=======================================================================
//function : ExtrusionSweepObjectMakeGroups
//purpose :
return aGroups;
}
+//=======================================================================
+//function : ExtrusionSweepObject0DMakeGroups
+//purpose :
+//=======================================================================
+
+SMESH::ListOfGroups*
+SMESH_MeshEditor_i::ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::DirStruct& theStepVector,
+ CORBA::Long theNbOfSteps)
+{
+ TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
+
+ SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::ListOfGroups * aGroups = extrusionSweep(anElementsId, theStepVector,
+ theNbOfSteps, true, SMDSAbs_Node);
+ if (!myPreviewMode) {
+ DumpGroupsList(aPythonDump, aGroups);
+ aPythonDump << this << ".ExtrusionSweepObject0DMakeGroups( " << theObject
+ << ", " << theStepVector << ", " << theNbOfSteps << " )";
+ }
+ return aGroups;
+}
+
//=======================================================================
//function : ExtrusionSweepObject1DMakeGroups
//purpose :
void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
const SMESH::DirStruct & StepVector,
CORBA::Long NbOfSteps);
+ void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
+ const SMESH::DirStruct & StepVector,
+ CORBA::Long NbOfSteps);
+
void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct & StepVector,
CORBA::Long NbOfSteps);
+
+ void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::DirStruct & StepVector,
+ CORBA::Long NbOfSteps);
void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct & StepVector,
CORBA::Long NbOfSteps);
SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
const SMESH::DirStruct& StepVector,
CORBA::Long NbOfSteps);
+ SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
+ const SMESH::DirStruct& StepVector,
+ CORBA::Long NbOfSteps);
+
SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
const SMESH::DirStruct& StepVector,
CORBA::Long NbOfSteps,
SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
const SMESH::DirStruct& StepVector,
CORBA::Long NbOfSteps);
+ SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
+ const SMESH::DirStruct& StepVector,
+ CORBA::Long NbOfSteps);
SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
const SMESH::DirStruct& StepVector,
CORBA::Long NbOfSteps);
# @param StepVector vector or DirStruct, defining the direction and value of extrusion for one step (the total extrusion length will be NbOfSteps * ||StepVector||)
# @param NbOfSteps the number of steps
# @param MakeGroups forces the generation of new groups from existing ones
+ # @param IsNodes is True if elements with given ids are nodes
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
# @ingroup l2_modif_extrurev
- def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False):
+ def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
if IDsOfElements == []:
IDsOfElements = self.GetElementsId()
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
Parameters = StepVectorParameters + var_separator + Parameters
self.mesh.SetParameters(Parameters)
if MakeGroups:
- return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
- self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
+ if(IsNodes):
+ return self.editor.ExtrusionSweepMakeGroups0D(IDsOfElements, StepVector, NbOfSteps)
+ else:
+ return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
+ if(IsNodes):
+ self.editor.ExtrusionSweep0D(IDsOfElements, StepVector, NbOfSteps)
+ else:
+ self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
return []
## Generates new elements by extrusion of the elements with given ids
# @param StepVector vector, defining the direction and value of extrusion for one step (the total extrusion length will be NbOfSteps * ||StepVector||)
# @param NbOfSteps the number of steps
# @param MakeGroups forces the generation of new groups from existing ones
+ # @param IsNodes is True if elements which belong to the object are nodes
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
# @ingroup l2_modif_extrurev
- def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
+ def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False, IsNodes=False):
if ( isinstance( theObject, Mesh )):
theObject = theObject.GetMesh()
if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
Parameters = StepVectorParameters + var_separator + Parameters
self.mesh.SetParameters(Parameters)
if MakeGroups:
- return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
- self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
+ if(IsNodes):
+ return self.editor.ExtrusionSweepObject0DMakeGroups(theObject, StepVector, NbOfSteps)
+ else:
+ return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
+ if(IsNodes):
+ self.editor.ExtrusionSweepObject0D(IDsOfElements, StepVector, NbOfSteps)
+ else:
+ self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
return []
## Generates new elements by extrusion of the elements which belong to the object