mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-16 01:41: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",
|
"ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
|
||||||
"RotationSweep","RotationSweepObject","RotationSweepObject1D","RotationSweepObject2D",
|
"RotationSweep","RotationSweepObject","RotationSweepObject1D","RotationSweepObject2D",
|
||||||
"ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
|
"ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
|
||||||
"ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
"ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathX",
|
||||||
|
"ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
||||||
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
||||||
"FindCoincidentNodes",/*"FindCoincidentNodesOnPart",*/"MergeNodes","FindEqualElements",
|
"FindCoincidentNodes",/*"FindCoincidentNodesOnPart",*/"MergeNodes","FindEqualElements",
|
||||||
"MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
|
"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()"
|
// set "FindCoincidentNodesOnPart()" instead of "FindCoincidentNodesOnPartBut()"
|
||||||
if ( !isPyMeshMethod && method == "FindCoincidentNodesOnPartBut")
|
if ( !isPyMeshMethod && method == "FindCoincidentNodesOnPartBut")
|
||||||
{
|
{
|
||||||
|
@ -2685,6 +2685,8 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
|||||||
SMESH::ElementType ElemType,
|
SMESH::ElementType ElemType,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||||
{
|
{
|
||||||
|
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
|
||||||
|
|
||||||
SMESH::long_array_var anElementsId = Object->GetIDs();
|
SMESH::long_array_var anElementsId = Object->GetIDs();
|
||||||
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
|
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
|
||||||
Path,
|
Path,
|
||||||
@ -2698,16 +2700,12 @@ ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
|||||||
(SMDSAbs_ElementType)ElemType,
|
(SMDSAbs_ElementType)ElemType,
|
||||||
Error);
|
Error);
|
||||||
|
|
||||||
if ( !myPreviewMode ) {
|
if (!myPreviewMode) {
|
||||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||||
TPythonDump aPythonDump;
|
if (isDumpGroups)
|
||||||
if(isDumpGroups) {
|
aPythonDump << "(" << *aGroups << ", error)";
|
||||||
aPythonDump << "("<<aGroups;
|
|
||||||
}
|
|
||||||
if(isDumpGroups)
|
|
||||||
aPythonDump << ", error)";
|
|
||||||
else
|
else
|
||||||
aPythonDump <<"error";
|
aPythonDump << "error";
|
||||||
|
|
||||||
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
|
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
|
||||||
<< Object << ", "
|
<< Object << ", "
|
||||||
@ -2745,6 +2743,8 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
|||||||
SMESH::ElementType ElemType,
|
SMESH::ElementType ElemType,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||||
{
|
{
|
||||||
|
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
|
||||||
|
|
||||||
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
|
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
|
||||||
Path,
|
Path,
|
||||||
NodeStart,
|
NodeStart,
|
||||||
@ -2757,14 +2757,10 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
|||||||
(SMDSAbs_ElementType)ElemType,
|
(SMDSAbs_ElementType)ElemType,
|
||||||
Error);
|
Error);
|
||||||
|
|
||||||
if ( !myPreviewMode ) {
|
if (!myPreviewMode) {
|
||||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||||
TPythonDump aPythonDump;
|
if (isDumpGroups)
|
||||||
if(isDumpGroups) {
|
aPythonDump << "(" << *aGroups << ", error)";
|
||||||
aPythonDump << "("<<aGroups;
|
|
||||||
}
|
|
||||||
if(isDumpGroups)
|
|
||||||
aPythonDump << ", error)";
|
|
||||||
else
|
else
|
||||||
aPythonDump <<"error";
|
aPythonDump <<"error";
|
||||||
|
|
||||||
@ -2780,6 +2776,7 @@ ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
|||||||
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", "
|
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", "
|
||||||
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", "
|
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", "
|
||||||
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
|
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
|
||||||
|
<< MakeGroups << ", "
|
||||||
<< ElemType << " )";
|
<< ElemType << " )";
|
||||||
}
|
}
|
||||||
return aGroups;
|
return aGroups;
|
||||||
|
@ -17,11 +17,10 @@
|
|||||||
#
|
#
|
||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
# File : smesh.py
|
# File : smesh.py
|
||||||
# Author : Francis KLOSS, OCC
|
# Author : Francis KLOSS, OCC
|
||||||
# Module : SMESH
|
# Module : SMESH
|
||||||
#
|
|
||||||
"""
|
"""
|
||||||
\namespace smesh
|
\namespace smesh
|
||||||
\brief Module smesh
|
\brief Module smesh
|
||||||
@ -3380,7 +3379,10 @@ class Mesh:
|
|||||||
Parameters = AnglesParameters + var_separator + RefPointParameters
|
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
|
|
||||||
if isinstance(Base,list):
|
if (isinstance(Path, Mesh)):
|
||||||
|
Path = Path.GetMesh()
|
||||||
|
|
||||||
|
if isinstance(Base, list):
|
||||||
IDsOfElements = []
|
IDsOfElements = []
|
||||||
if Base == []: IDsOfElements = self.GetElementsId()
|
if Base == []: IDsOfElements = self.GetElementsId()
|
||||||
else: IDsOfElements = Base
|
else: IDsOfElements = Base
|
||||||
@ -3388,7 +3390,8 @@ class Mesh:
|
|||||||
HasAngles, Angles, LinearVariation,
|
HasAngles, Angles, LinearVariation,
|
||||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
||||||
else:
|
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,
|
return self.editor.ExtrusionAlongPathObjX(Base, Path, NodeStart,
|
||||||
HasAngles, Angles, LinearVariation,
|
HasAngles, Angles, LinearVariation,
|
||||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user