mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-15 19:31:27 +05:00
0021108: EDF 1668 SMESH: ExtrusionAlongPathX on a Mesh group.
This commit is contained in:
parent
04dc57ed8f
commit
a541693f06
@ -1129,7 +1129,8 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
||||
"ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
|
||||
"RotationSweep","RotationSweepObject","RotationSweepObject1D","RotationSweepObject2D",
|
||||
"ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
|
||||
"ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
||||
"ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathX",
|
||||
"ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
||||
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
||||
"FindCoincidentNodes",/*"FindCoincidentNodesOnPart",*/"MergeNodes","FindEqualElements",
|
||||
"MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
|
||||
@ -1177,6 +1178,13 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
||||
}
|
||||
}
|
||||
|
||||
// set "ExtrusionAlongPathX()" instead of "ExtrusionAlongPathObjX()"
|
||||
if ( !isPyMeshMethod && method == "ExtrusionAlongPathObjX")
|
||||
{
|
||||
isPyMeshMethod=true;
|
||||
theCommand->SetMethod("ExtrusionAlongPathX");
|
||||
}
|
||||
|
||||
// set "FindCoincidentNodesOnPart()" instead of "FindCoincidentNodesOnPartBut()"
|
||||
if ( !isPyMeshMethod && method == "FindCoincidentNodesOnPartBut")
|
||||
{
|
||||
|
@ -2685,6 +2685,8 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
||||
SMESH::ElementType ElemType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||
{
|
||||
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
|
||||
|
||||
SMESH::long_array_var anElementsId = Object->GetIDs();
|
||||
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
|
||||
Path,
|
||||
@ -2700,12 +2702,8 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
||||
|
||||
if (!myPreviewMode) {
|
||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||
TPythonDump aPythonDump;
|
||||
if(isDumpGroups) {
|
||||
aPythonDump << "("<<aGroups;
|
||||
}
|
||||
if (isDumpGroups)
|
||||
aPythonDump << ", error)";
|
||||
aPythonDump << "(" << *aGroups << ", error)";
|
||||
else
|
||||
aPythonDump << "error";
|
||||
|
||||
@ -2745,6 +2743,8 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
||||
SMESH::ElementType ElemType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||
{
|
||||
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
|
||||
|
||||
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
|
||||
Path,
|
||||
NodeStart,
|
||||
@ -2759,12 +2759,8 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
||||
|
||||
if (!myPreviewMode) {
|
||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||
TPythonDump aPythonDump;
|
||||
if(isDumpGroups) {
|
||||
aPythonDump << "("<<aGroups;
|
||||
}
|
||||
if (isDumpGroups)
|
||||
aPythonDump << ", error)";
|
||||
aPythonDump << "(" << *aGroups << ", error)";
|
||||
else
|
||||
aPythonDump <<"error";
|
||||
|
||||
@ -2780,6 +2776,7 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
||||
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", "
|
||||
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", "
|
||||
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
|
||||
<< MakeGroups << ", "
|
||||
<< ElemType << " )";
|
||||
}
|
||||
return aGroups;
|
||||
|
@ -17,11 +17,10 @@
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
|
||||
# File : smesh.py
|
||||
# Author : Francis KLOSS, OCC
|
||||
# Module : SMESH
|
||||
#
|
||||
|
||||
"""
|
||||
\namespace smesh
|
||||
\brief Module smesh
|
||||
@ -3380,6 +3379,9 @@ class Mesh:
|
||||
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||
self.mesh.SetParameters(Parameters)
|
||||
|
||||
if (isinstance(Path, Mesh)):
|
||||
Path = Path.GetMesh()
|
||||
|
||||
if isinstance(Base, list):
|
||||
IDsOfElements = []
|
||||
if Base == []: IDsOfElements = self.GetElementsId()
|
||||
@ -3388,7 +3390,8 @@ class Mesh:
|
||||
HasAngles, Angles, LinearVariation,
|
||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
||||
else:
|
||||
if isinstance(Base,Mesh):
|
||||
if isinstance(Base, Mesh): Base = Base.GetMesh()
|
||||
if isinstance(Base, SMESH._objref_SMESH_Mesh) or isinstance(Base, SMESH._objref_SMESH_Group) or isinstance(Base, SMESH._objref_SMESH_subMesh):
|
||||
return self.editor.ExtrusionAlongPathObjX(Base, Path, NodeStart,
|
||||
HasAngles, Angles, LinearVariation,
|
||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user