mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
Implementation of new version ExtrusionAlongPath (20003 from Mantis).
This commit is contained in:
parent
6a528ce128
commit
34fb01e7b5
BIN
doc/salome/gui/SMESH/images/extr_along_wire_after.png
Normal file
BIN
doc/salome/gui/SMESH/images/extr_along_wire_after.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
BIN
doc/salome/gui/SMESH/images/extr_along_wire_before.png
Normal file
BIN
doc/salome/gui/SMESH/images/extr_along_wire_before.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 37 KiB |
@ -4,13 +4,14 @@
|
||||
|
||||
\n In principle, <b>Extrusion along a path</b> works in the same way
|
||||
as \b Extrusion, the main difference is that we define not a vector,
|
||||
but a path of extrusion which must be a meshed edge. To get an idea of
|
||||
how this algorithm works, examine several examples, starting from the
|
||||
most simple case of extrusion along a straight edge. In all examples
|
||||
the same mesh will be extruded along different paths and with
|
||||
different parameters. This sample 2D mesh has two quadrangle faces and
|
||||
seven edges. Look at the picture, where white digits are the node
|
||||
numbers and green are the element numbers:
|
||||
but a path of extrusion which must be a 1D mesh or 1D sub-mesh. To
|
||||
get an idea of how this algorithm works, examine several examples,
|
||||
starting from the most simple case of extrusion along a straight edge.
|
||||
In following examples the meshes will be extruded along different
|
||||
paths and with different parameters.
|
||||
This sample 2D mesh has two quadrangle faces and seven edges. Look
|
||||
at the picture, where white digits are the node numbers and green
|
||||
are the element numbers:
|
||||
|
||||
\image html mesh_for_extr_along_path.png
|
||||
|
||||
@ -40,29 +41,15 @@ been selected as <b>Start node</b>.</center>
|
||||
\image html curvi_angles_after.png
|
||||
<center>The same, but using angles {45, 45, 45, 0, -45, -45, -45}</center>
|
||||
|
||||
<br><center><h2>Extrusion along a sub-mesh</h2></center>
|
||||
<br><center><h2>Extrusion of 2d face along a mesh builds on wire</h2></center>
|
||||
|
||||
In this example the path mesh has been built on a wire (polyline with
|
||||
six edges). The first edge of the wire was used as <b>Shape (edge)</b>, node
|
||||
#1 as <b>Start node</b>. The angles have been defined as {10, 10, 10}. The
|
||||
middle edge (#4) of the initial mesh has been extruded.
|
||||
In this example the path mesh has been built on a wire contains 3
|
||||
edges. Node #1 is used as start node. Linear angle variation by 180
|
||||
degree is applied.
|
||||
|
||||
\image html edge_wire_before.png
|
||||
\image html extr_along_wire_before.png
|
||||
|
||||
\image html edge_wire_after.png
|
||||
|
||||
<br><center><h2>Extrusion of 2d elements along a sub-mesh</h2></center>
|
||||
|
||||
This extrusion bases on the same path mesh as in the previous example
|
||||
but the third edge of the wire was set as <b>Shape (edge)</b> and node
|
||||
#4 as <b>Start node</b>. Please note, that the extrusion has been done
|
||||
in direction from node #4 to node #3, i.e. against the wire
|
||||
direction. In this example both faces of the initial mesh have been
|
||||
extruded.
|
||||
|
||||
\image html edge_wire_3d_before.png
|
||||
|
||||
\image html edge_wire_3d_after.png
|
||||
\image html extr_along_wire_after.png
|
||||
|
||||
<br><center><h2>Extrusion of 2d elements along a closed path</h2></center>
|
||||
|
||||
@ -113,9 +100,8 @@ about filters in the \ref selection_filter_library_page "Selection filter librar
|
||||
<li>define the Path along which the elements will be extruded,
|
||||
\n Path definition consists of several elements:
|
||||
<ul>
|
||||
<li>\b Mesh - containing a 1D sub-mesh on the edge, along which proceeds the extrusion</li>
|
||||
<li><b>Shape (edge)</b> - as the mesh can be complex, the edge is used to define the sub-mesh for the path</li>
|
||||
<li><b>Start node</b> - the first or the last node on the edge. It is used to define the direction of extrusion </li>
|
||||
<li><b>Mesh or submesh</b> - 1D mesh or 1D sub-mesh, along which proceeds the extrusion</li>
|
||||
<li><b>Start node</b> - the start node. It is used to define the direction of extrusion </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>activate <b>Generate Groups</b> checkbox if it is necessary to copy the groups of
|
||||
|
@ -392,6 +392,30 @@ module SMESH
|
||||
EXTR_CANT_GET_TANGENT
|
||||
};
|
||||
|
||||
ListOfGroups ExtrusionAlongPathX(in long_array IDsOfElements,
|
||||
in SMESH_IDSource Path,
|
||||
in long NodeStart,
|
||||
in boolean HasAngles,
|
||||
in double_array Angles,
|
||||
in boolean LinearVariation,
|
||||
in boolean HasRefPoint,
|
||||
in PointStruct RefPoint,
|
||||
in boolean MakeGroups,
|
||||
in ElementType ElemType,
|
||||
out Extrusion_Error Error);
|
||||
|
||||
ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource theObject,
|
||||
in SMESH_IDSource Path,
|
||||
in long NodeStart,
|
||||
in boolean HasAngles,
|
||||
in double_array Angles,
|
||||
in boolean LinearVariation,
|
||||
in boolean HasRefPoint,
|
||||
in PointStruct RefPoint,
|
||||
in boolean MakeGroups,
|
||||
in ElementType ElemType,
|
||||
out Extrusion_Error Error);
|
||||
|
||||
Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
|
||||
in SMESH_Mesh PathMesh,
|
||||
in GEOM::GEOM_Object PathShape,
|
||||
|
@ -59,6 +59,7 @@
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <gp.hxx>
|
||||
@ -3732,7 +3733,7 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
||||
return newGroupIDs;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
//=======================================================================
|
||||
//class : SMESH_MeshEditor_PathPoint
|
||||
//purpose : auxiliary class
|
||||
@ -3776,6 +3777,7 @@ protected:
|
||||
double myAngle;
|
||||
double myPrm;
|
||||
};
|
||||
*/
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtrusionAlongTrack
|
||||
@ -3787,6 +3789,7 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
const SMDS_MeshNode* theN1,
|
||||
const bool theHasAngles,
|
||||
list<double>& theAngles,
|
||||
const bool theLinearVariation,
|
||||
const bool theHasRefPoint,
|
||||
const gp_Pnt& theRefPoint,
|
||||
const bool theMakeGroups)
|
||||
@ -3794,20 +3797,11 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
myLastCreatedElems.Clear();
|
||||
myLastCreatedNodes.Clear();
|
||||
|
||||
// source elements for each generated one
|
||||
SMESH_SequenceOfElemPtr srcElems, srcNodes;
|
||||
|
||||
int j, aNbTP, aNbE, aNb;
|
||||
double aT1, aT2, aT, aAngle, aX, aY, aZ;
|
||||
int aNbE;
|
||||
std::list<double> aPrms;
|
||||
std::list<double>::iterator aItD;
|
||||
TIDSortedElemSet::iterator itElem;
|
||||
|
||||
Standard_Real aTx1, aTx2, aL2, aTolVec, aTolVec2;
|
||||
gp_Pnt aP3D, aV0;
|
||||
gp_Vec aVec;
|
||||
gp_XYZ aGC;
|
||||
Handle(Geom_Curve) aC3D;
|
||||
TopoDS_Edge aTrackEdge;
|
||||
TopoDS_Vertex aV1, aV2;
|
||||
|
||||
@ -3816,11 +3810,6 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
SMDSAbs_ElementType aTypeE;
|
||||
|
||||
TNodeOfNodeListMap mapNewNodes;
|
||||
TElemOfVecOfNnlmiMap mapElemNewNodes;
|
||||
TElemOfElemListMap newElemsMap;
|
||||
|
||||
aTolVec=1.e-7;
|
||||
aTolVec2=aTolVec*aTolVec;
|
||||
|
||||
// 1. Check data
|
||||
aNbE = theElements.size();
|
||||
@ -3842,63 +3831,325 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
return EXTR_PATH_NOT_EDGE;
|
||||
}
|
||||
|
||||
const TopoDS_Shape& aS = theTrack->GetSubShape();
|
||||
// Sub shape for the Pattern must be an Edge
|
||||
if ( aS.ShapeType() != TopAbs_EDGE )
|
||||
return EXTR_BAD_PATH_SHAPE;
|
||||
list<SMESH_MeshEditor_PathPoint> fullList;
|
||||
|
||||
const TopoDS_Shape& aS = theTrack->GetSubShape();
|
||||
// Sub shape for the Pattern must be an Edge or Wire
|
||||
if( aS.ShapeType() == TopAbs_EDGE ) {
|
||||
aTrackEdge = TopoDS::Edge( aS );
|
||||
// the Edge must not be degenerated
|
||||
if ( BRep_Tool::Degenerated( aTrackEdge ) )
|
||||
return EXTR_BAD_PATH_SHAPE;
|
||||
|
||||
TopExp::Vertices( aTrackEdge, aV1, aV2 );
|
||||
aT1=BRep_Tool::Parameter( aV1, aTrackEdge );
|
||||
aT2=BRep_Tool::Parameter( aV2, aTrackEdge );
|
||||
|
||||
aItN = theTrack->GetFather()->GetSubMesh( aV1 )->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN1 = aItN->next();
|
||||
|
||||
aItN = theTrack->GetFather()->GetSubMesh( aV2 )->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN2 = aItN->next();
|
||||
|
||||
// starting node must be aN1 or aN2
|
||||
if ( !( aN1 == theN1 || aN2 == theN1 ) )
|
||||
return EXTR_BAD_STARTING_NODE;
|
||||
|
||||
aNbTP = pSubMeshDS->NbNodes() + 2;
|
||||
|
||||
// 1.2. Angles
|
||||
vector<double> aAngles( aNbTP );
|
||||
|
||||
for ( j=0; j < aNbTP; ++j ) {
|
||||
aAngles[j] = 0.;
|
||||
}
|
||||
|
||||
if ( theHasAngles ) {
|
||||
aItD = theAngles.begin();
|
||||
for ( j=1; (aItD != theAngles.end()) && (j<aNbTP); ++aItD, ++j ) {
|
||||
aAngle = *aItD;
|
||||
aAngles[j] = aAngle;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Collect parameters on the track edge
|
||||
aPrms.push_back( aT1 );
|
||||
aPrms.push_back( aT2 );
|
||||
|
||||
aItN = pSubMeshDS->GetNodes();
|
||||
while ( aItN->more() ) {
|
||||
const SMDS_MeshNode* pNode = aItN->next();
|
||||
const SMDS_EdgePosition* pEPos =
|
||||
static_cast<const SMDS_EdgePosition*>( pNode->GetPosition().get() );
|
||||
aT = pEPos->GetUParameter();
|
||||
double aT = pEPos->GetUParameter();
|
||||
aPrms.push_back( aT );
|
||||
}
|
||||
Extrusion_Error err = MakeEdgePathPoints(aPrms, aTrackEdge, (aN1==theN1), fullList);
|
||||
}
|
||||
else if( aS.ShapeType() == TopAbs_WIRE ) {
|
||||
list< SMESH_subMesh* > LSM;
|
||||
TopTools_SequenceOfShape Edges;
|
||||
SMESH_subMeshIteratorPtr itSM = theTrack->getDependsOnIterator(false,true);
|
||||
while(itSM->more()) {
|
||||
SMESH_subMesh* SM = itSM->next();
|
||||
LSM.push_back(SM);
|
||||
const TopoDS_Shape& aS = SM->GetSubShape();
|
||||
Edges.Append(aS);
|
||||
}
|
||||
list< list<SMESH_MeshEditor_PathPoint> > LLPPs;
|
||||
int startNid = theN1->GetID();
|
||||
TColStd_MapOfInteger UsedNums;
|
||||
int NbEdges = Edges.Length();
|
||||
int i = 1;
|
||||
for(; i<=NbEdges; i++) {
|
||||
int k = 0;
|
||||
list< SMESH_subMesh* >::iterator itLSM = LSM.begin();
|
||||
for(; itLSM!=LSM.end(); itLSM++) {
|
||||
k++;
|
||||
if(UsedNums.Contains(k)) continue;
|
||||
aTrackEdge = TopoDS::Edge( Edges.Value(k) );
|
||||
SMESH_subMesh* locTrack = *itLSM;
|
||||
SMESHDS_SubMesh* locMeshDS = locTrack->GetSubMeshDS();
|
||||
TopExp::Vertices( aTrackEdge, aV1, aV2 );
|
||||
aItN = locTrack->GetFather()->GetSubMesh(aV1)->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN1 = aItN->next();
|
||||
aItN = locTrack->GetFather()->GetSubMesh(aV2)->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN2 = aItN->next();
|
||||
// starting node must be aN1 or aN2
|
||||
if ( !( aN1->GetID() == startNid || aN2->GetID() == startNid ) ) continue;
|
||||
// 2. Collect parameters on the track edge
|
||||
aPrms.clear();
|
||||
aItN = locMeshDS->GetNodes();
|
||||
while ( aItN->more() ) {
|
||||
const SMDS_MeshNode* pNode = aItN->next();
|
||||
const SMDS_EdgePosition* pEPos =
|
||||
static_cast<const SMDS_EdgePosition*>( pNode->GetPosition().get() );
|
||||
double aT = pEPos->GetUParameter();
|
||||
aPrms.push_back( aT );
|
||||
}
|
||||
list<SMESH_MeshEditor_PathPoint> LPP;
|
||||
Extrusion_Error err = MakeEdgePathPoints(aPrms, aTrackEdge,
|
||||
(aN1->GetID()==startNid), LPP);
|
||||
LLPPs.push_back(LPP);
|
||||
UsedNums.Add(k);
|
||||
// update startN for search following egde
|
||||
if( aN1->GetID() == startNid ) startNid = aN2->GetID();
|
||||
else startNid = aN1->GetID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
list< list<SMESH_MeshEditor_PathPoint> >::iterator itLLPP = LLPPs.begin();
|
||||
list<SMESH_MeshEditor_PathPoint> firstList = *itLLPP;
|
||||
list<SMESH_MeshEditor_PathPoint>::iterator itPP = firstList.begin();
|
||||
for(; itPP!=firstList.end(); itPP++) {
|
||||
fullList.push_back( *itPP );
|
||||
}
|
||||
SMESH_MeshEditor_PathPoint PP1 = fullList.back();
|
||||
fullList.pop_back();
|
||||
itLLPP++;
|
||||
for(; itLLPP!=LLPPs.end(); itLLPP++) {
|
||||
list<SMESH_MeshEditor_PathPoint> currList = *itLLPP;
|
||||
itPP = currList.begin();
|
||||
SMESH_MeshEditor_PathPoint PP2 = currList.front();
|
||||
gp_Dir D1 = PP1.Tangent();
|
||||
gp_Dir D2 = PP2.Tangent();
|
||||
gp_Dir Dnew( gp_Vec( (D1.X()+D2.X())/2, (D1.Y()+D2.Y())/2,
|
||||
(D1.Z()+D2.Z())/2 ) );
|
||||
PP1.SetTangent(Dnew);
|
||||
fullList.push_back(PP1);
|
||||
itPP++;
|
||||
for(; itPP!=firstList.end(); itPP++) {
|
||||
fullList.push_back( *itPP );
|
||||
}
|
||||
PP1 = fullList.back();
|
||||
fullList.pop_back();
|
||||
}
|
||||
// if wire not closed
|
||||
fullList.push_back(PP1);
|
||||
// else ???
|
||||
}
|
||||
else {
|
||||
return EXTR_BAD_PATH_SHAPE;
|
||||
}
|
||||
|
||||
return MakeExtrElements(theElements, fullList, theHasAngles, theAngles, theLinearVariation,
|
||||
theHasRefPoint, theRefPoint, theMakeGroups);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtrusionAlongTrack
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
SMESH_MeshEditor::Extrusion_Error
|
||||
SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
||||
SMESH_Mesh* theTrack,
|
||||
const SMDS_MeshNode* theN1,
|
||||
const bool theHasAngles,
|
||||
list<double>& theAngles,
|
||||
const bool theLinearVariation,
|
||||
const bool theHasRefPoint,
|
||||
const gp_Pnt& theRefPoint,
|
||||
const bool theMakeGroups)
|
||||
{
|
||||
myLastCreatedElems.Clear();
|
||||
myLastCreatedNodes.Clear();
|
||||
|
||||
int aNbE;
|
||||
std::list<double> aPrms;
|
||||
TIDSortedElemSet::iterator itElem;
|
||||
|
||||
gp_XYZ aGC;
|
||||
TopoDS_Edge aTrackEdge;
|
||||
TopoDS_Vertex aV1, aV2;
|
||||
|
||||
SMDS_ElemIteratorPtr aItE;
|
||||
SMDS_NodeIteratorPtr aItN;
|
||||
SMDSAbs_ElementType aTypeE;
|
||||
|
||||
TNodeOfNodeListMap mapNewNodes;
|
||||
|
||||
// 1. Check data
|
||||
aNbE = theElements.size();
|
||||
// nothing to do
|
||||
if ( !aNbE )
|
||||
return EXTR_NO_ELEMENTS;
|
||||
|
||||
// 1.1 Track Pattern
|
||||
ASSERT( theTrack );
|
||||
|
||||
SMESHDS_Mesh* pMeshDS = theTrack->GetMeshDS();
|
||||
|
||||
aItE = pMeshDS->elementsIterator();
|
||||
while ( aItE->more() ) {
|
||||
const SMDS_MeshElement* pE = aItE->next();
|
||||
aTypeE = pE->GetType();
|
||||
// Pattern must contain links only
|
||||
if ( aTypeE != SMDSAbs_Edge )
|
||||
return EXTR_PATH_NOT_EDGE;
|
||||
}
|
||||
|
||||
list<SMESH_MeshEditor_PathPoint> fullList;
|
||||
|
||||
const TopoDS_Shape& aS = theTrack->GetShapeToMesh();
|
||||
// Sub shape for the Pattern must be an Edge or Wire
|
||||
if( aS.ShapeType() == TopAbs_EDGE ) {
|
||||
aTrackEdge = TopoDS::Edge( aS );
|
||||
// the Edge must not be degenerated
|
||||
if ( BRep_Tool::Degenerated( aTrackEdge ) )
|
||||
return EXTR_BAD_PATH_SHAPE;
|
||||
TopExp::Vertices( aTrackEdge, aV1, aV2 );
|
||||
aItN = theTrack->GetSubMesh( aV1 )->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN1 = aItN->next();
|
||||
aItN = theTrack->GetSubMesh( aV2 )->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN2 = aItN->next();
|
||||
// starting node must be aN1 or aN2
|
||||
if ( !( aN1 == theN1 || aN2 == theN1 ) )
|
||||
return EXTR_BAD_STARTING_NODE;
|
||||
aItN = pMeshDS->nodesIterator();
|
||||
while ( aItN->more() ) {
|
||||
const SMDS_MeshNode* pNode = aItN->next();
|
||||
if( pNode==aN1 || pNode==aN2 ) continue;
|
||||
const SMDS_EdgePosition* pEPos =
|
||||
static_cast<const SMDS_EdgePosition*>( pNode->GetPosition().get() );
|
||||
double aT = pEPos->GetUParameter();
|
||||
aPrms.push_back( aT );
|
||||
}
|
||||
Extrusion_Error err = MakeEdgePathPoints(aPrms, aTrackEdge, (aN1==theN1), fullList);
|
||||
}
|
||||
else if( aS.ShapeType() == TopAbs_WIRE ) {
|
||||
list< SMESH_subMesh* > LSM;
|
||||
TopTools_SequenceOfShape Edges;
|
||||
TopExp_Explorer eExp(aS, TopAbs_EDGE);
|
||||
for(; eExp.More(); eExp.Next()) {
|
||||
TopoDS_Edge E = TopoDS::Edge( eExp.Current() );
|
||||
if( BRep_Tool::Degenerated(E) ) continue;
|
||||
SMESH_subMesh* SM = theTrack->GetSubMesh(E);
|
||||
if(SM) {
|
||||
LSM.push_back(SM);
|
||||
Edges.Append(E);
|
||||
}
|
||||
}
|
||||
list< list<SMESH_MeshEditor_PathPoint> > LLPPs;
|
||||
int startNid = theN1->GetID();
|
||||
TColStd_MapOfInteger UsedNums;
|
||||
int NbEdges = Edges.Length();
|
||||
int i = 1;
|
||||
for(; i<=NbEdges; i++) {
|
||||
int k = 0;
|
||||
list< SMESH_subMesh* >::iterator itLSM = LSM.begin();
|
||||
for(; itLSM!=LSM.end(); itLSM++) {
|
||||
k++;
|
||||
if(UsedNums.Contains(k)) continue;
|
||||
aTrackEdge = TopoDS::Edge( Edges.Value(k) );
|
||||
SMESH_subMesh* locTrack = *itLSM;
|
||||
SMESHDS_SubMesh* locMeshDS = locTrack->GetSubMeshDS();
|
||||
TopExp::Vertices( aTrackEdge, aV1, aV2 );
|
||||
aItN = locTrack->GetFather()->GetSubMesh(aV1)->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN1 = aItN->next();
|
||||
aItN = locTrack->GetFather()->GetSubMesh(aV2)->GetSubMeshDS()->GetNodes();
|
||||
const SMDS_MeshNode* aN2 = aItN->next();
|
||||
// starting node must be aN1 or aN2
|
||||
if ( !( aN1->GetID() == startNid || aN2->GetID() == startNid ) ) continue;
|
||||
// 2. Collect parameters on the track edge
|
||||
aPrms.clear();
|
||||
aItN = locMeshDS->GetNodes();
|
||||
while ( aItN->more() ) {
|
||||
const SMDS_MeshNode* pNode = aItN->next();
|
||||
const SMDS_EdgePosition* pEPos =
|
||||
static_cast<const SMDS_EdgePosition*>( pNode->GetPosition().get() );
|
||||
double aT = pEPos->GetUParameter();
|
||||
aPrms.push_back( aT );
|
||||
}
|
||||
list<SMESH_MeshEditor_PathPoint> LPP;
|
||||
Extrusion_Error err = MakeEdgePathPoints(aPrms, aTrackEdge,
|
||||
(aN1->GetID()==startNid), LPP);
|
||||
LLPPs.push_back(LPP);
|
||||
UsedNums.Add(k);
|
||||
// update startN for search following egde
|
||||
if( aN1->GetID() == startNid ) startNid = aN2->GetID();
|
||||
else startNid = aN1->GetID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
list< list<SMESH_MeshEditor_PathPoint> >::iterator itLLPP = LLPPs.begin();
|
||||
list<SMESH_MeshEditor_PathPoint> firstList = *itLLPP;
|
||||
list<SMESH_MeshEditor_PathPoint>::iterator itPP = firstList.begin();
|
||||
for(; itPP!=firstList.end(); itPP++) {
|
||||
fullList.push_back( *itPP );
|
||||
}
|
||||
SMESH_MeshEditor_PathPoint PP1 = fullList.back();
|
||||
fullList.pop_back();
|
||||
itLLPP++;
|
||||
for(; itLLPP!=LLPPs.end(); itLLPP++) {
|
||||
list<SMESH_MeshEditor_PathPoint> currList = *itLLPP;
|
||||
itPP = currList.begin();
|
||||
SMESH_MeshEditor_PathPoint PP2 = currList.front();
|
||||
gp_Pnt P1 = PP1.Pnt();
|
||||
//cout<<" PP1: Pnt("<<P1.X()<<","<<P1.Y()<<","<<P1.Z()<<")"<<endl;
|
||||
gp_Pnt P2 = PP2.Pnt();
|
||||
gp_Dir D1 = PP1.Tangent();
|
||||
gp_Dir D2 = PP2.Tangent();
|
||||
gp_Dir Dnew( gp_Vec( (D1.X()+D2.X())/2, (D1.Y()+D2.Y())/2,
|
||||
(D1.Z()+D2.Z())/2 ) );
|
||||
PP1.SetTangent(Dnew);
|
||||
fullList.push_back(PP1);
|
||||
itPP++;
|
||||
for(; itPP!=currList.end(); itPP++) {
|
||||
fullList.push_back( *itPP );
|
||||
}
|
||||
PP1 = fullList.back();
|
||||
fullList.pop_back();
|
||||
}
|
||||
// if wire not closed
|
||||
fullList.push_back(PP1);
|
||||
// else ???
|
||||
}
|
||||
else {
|
||||
return EXTR_BAD_PATH_SHAPE;
|
||||
}
|
||||
|
||||
return MakeExtrElements(theElements, fullList, theHasAngles, theAngles, theLinearVariation,
|
||||
theHasRefPoint, theRefPoint, theMakeGroups);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeEdgePathPoints
|
||||
//purpose : auxilary for ExtrusionAlongTrack
|
||||
//=======================================================================
|
||||
SMESH_MeshEditor::Extrusion_Error
|
||||
SMESH_MeshEditor::MakeEdgePathPoints(std::list<double>& aPrms,
|
||||
const TopoDS_Edge& aTrackEdge,
|
||||
bool FirstIsStart,
|
||||
list<SMESH_MeshEditor_PathPoint>& LPP)
|
||||
{
|
||||
Standard_Real aTx1, aTx2, aL2, aTolVec, aTolVec2;
|
||||
aTolVec=1.e-7;
|
||||
aTolVec2=aTolVec*aTolVec;
|
||||
double aT1, aT2;
|
||||
TopoDS_Vertex aV1, aV2;
|
||||
TopExp::Vertices( aTrackEdge, aV1, aV2 );
|
||||
aT1=BRep_Tool::Parameter( aV1, aTrackEdge );
|
||||
aT2=BRep_Tool::Parameter( aV2, aTrackEdge );
|
||||
// 2. Collect parameters on the track edge
|
||||
aPrms.push_front( aT1 );
|
||||
aPrms.push_back( aT2 );
|
||||
// sort parameters
|
||||
aPrms.sort();
|
||||
if ( aN1 == theN1 ) {
|
||||
if( FirstIsStart ) {
|
||||
if ( aT1 > aT2 ) {
|
||||
aPrms.reverse();
|
||||
}
|
||||
@ -3908,33 +4159,85 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
aPrms.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Path Points
|
||||
SMESH_MeshEditor_PathPoint aPP;
|
||||
vector<SMESH_MeshEditor_PathPoint> aPPs( aNbTP );
|
||||
//
|
||||
aC3D = BRep_Tool::Curve( aTrackEdge, aTx1, aTx2 );
|
||||
//
|
||||
aItD = aPrms.begin();
|
||||
for ( j=0; aItD != aPrms.end(); ++aItD, ++j ) {
|
||||
aT = *aItD;
|
||||
Handle(Geom_Curve) aC3D = BRep_Tool::Curve( aTrackEdge, aTx1, aTx2 );
|
||||
std::list<double>::iterator aItD = aPrms.begin();
|
||||
for(; aItD != aPrms.end(); ++aItD) {
|
||||
double aT = *aItD;
|
||||
gp_Pnt aP3D;
|
||||
gp_Vec aVec;
|
||||
aC3D->D1( aT, aP3D, aVec );
|
||||
aL2 = aVec.SquareMagnitude();
|
||||
if ( aL2 < aTolVec2 )
|
||||
return EXTR_CANT_GET_TANGENT;
|
||||
|
||||
gp_Dir aTgt( aVec );
|
||||
aAngle = aAngles[j];
|
||||
|
||||
aPP.SetPnt( aP3D );
|
||||
aPP.SetTangent( aTgt );
|
||||
aPP.SetAngle( aAngle );
|
||||
aPP.SetParameter( aT );
|
||||
aPPs[j]=aPP;
|
||||
LPP.push_back(aPP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeExtrElements
|
||||
//purpose : auxilary for ExtrusionAlongTrack
|
||||
//=======================================================================
|
||||
SMESH_MeshEditor::Extrusion_Error
|
||||
SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements,
|
||||
list<SMESH_MeshEditor_PathPoint>& fullList,
|
||||
const bool theHasAngles,
|
||||
list<double>& theAngles,
|
||||
const bool theLinearVariation,
|
||||
const bool theHasRefPoint,
|
||||
const gp_Pnt& theRefPoint,
|
||||
const bool theMakeGroups)
|
||||
{
|
||||
//cout<<"MakeExtrElements fullList.size() = "<<fullList.size()<<endl;
|
||||
int aNbTP = fullList.size();
|
||||
vector<SMESH_MeshEditor_PathPoint> aPPs(aNbTP);
|
||||
// Angles
|
||||
if( theHasAngles && theAngles.size()>0 && theLinearVariation ) {
|
||||
LinearAngleVariation(aNbTP-1, theAngles);
|
||||
}
|
||||
vector<double> aAngles( aNbTP );
|
||||
int j = 0;
|
||||
for(; j<aNbTP; ++j) {
|
||||
aAngles[j] = 0.;
|
||||
}
|
||||
if ( theHasAngles ) {
|
||||
double anAngle;;
|
||||
std::list<double>::iterator aItD = theAngles.begin();
|
||||
for ( j=1; (aItD != theAngles.end()) && (j<aNbTP); ++aItD, ++j ) {
|
||||
anAngle = *aItD;
|
||||
aAngles[j] = anAngle;
|
||||
}
|
||||
}
|
||||
// fill vector of path points with angles
|
||||
//aPPs.resize(fullList.size());
|
||||
j = -1;
|
||||
list<SMESH_MeshEditor_PathPoint>::iterator itPP = fullList.begin();
|
||||
for(; itPP!=fullList.end(); itPP++) {
|
||||
j++;
|
||||
SMESH_MeshEditor_PathPoint PP = *itPP;
|
||||
PP.SetAngle(aAngles[j]);
|
||||
aPPs[j] = PP;
|
||||
}
|
||||
|
||||
TNodeOfNodeListMap mapNewNodes;
|
||||
TElemOfVecOfNnlmiMap mapElemNewNodes;
|
||||
TElemOfElemListMap newElemsMap;
|
||||
TIDSortedElemSet::iterator itElem;
|
||||
double aX, aY, aZ;
|
||||
int aNb;
|
||||
SMDSAbs_ElementType aTypeE;
|
||||
// source elements for each generated one
|
||||
SMESH_SequenceOfElemPtr srcElems, srcNodes;
|
||||
|
||||
// 3. Center of rotation aV0
|
||||
aV0 = theRefPoint;
|
||||
gp_Pnt aV0 = theRefPoint;
|
||||
gp_XYZ aGC;
|
||||
if ( !theHasRefPoint ) {
|
||||
aNb = 0;
|
||||
aGC.SetCoord( 0.,0.,0. );
|
||||
@ -4008,6 +4311,7 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
const SMESH_MeshEditor_PathPoint& aPP0 = aPPs[0];
|
||||
aP0x = aPP0.Pnt();
|
||||
aDT0x= aPP0.Tangent();
|
||||
//cout<<"j = 0 PP: Pnt("<<aP0x.X()<<","<<aP0x.Y()<<","<<aP0x.Z()<<")"<<endl;
|
||||
|
||||
for ( j = 1; j < aNbTP; ++j ) {
|
||||
const SMESH_MeshEditor_PathPoint& aPP1 = aPPs[j];
|
||||
@ -4116,6 +4420,56 @@ SMESH_MeshEditor::Extrusion_Error
|
||||
return EXTR_OK;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LinearAngleVariation
|
||||
//purpose : auxilary for ExtrusionAlongTrack
|
||||
//=======================================================================
|
||||
void SMESH_MeshEditor::LinearAngleVariation(const int nbSteps,
|
||||
list<double>& Angles)
|
||||
{
|
||||
int nbAngles = Angles.size();
|
||||
if( nbSteps > nbAngles ) {
|
||||
vector<double> theAngles(nbAngles);
|
||||
list<double>::iterator it = Angles.begin();
|
||||
int i = -1;
|
||||
for(; it!=Angles.end(); it++) {
|
||||
i++;
|
||||
theAngles[i] = (*it);
|
||||
}
|
||||
list<double> res;
|
||||
double rAn2St = double( nbAngles ) / double( nbSteps );
|
||||
double angPrev = 0, angle;
|
||||
for ( int iSt = 0; iSt < nbSteps; ++iSt ) {
|
||||
double angCur = rAn2St * ( iSt+1 );
|
||||
double angCurFloor = floor( angCur );
|
||||
double angPrevFloor = floor( angPrev );
|
||||
if ( angPrevFloor == angCurFloor )
|
||||
angle = rAn2St * theAngles[ int( angCurFloor ) ];
|
||||
else {
|
||||
int iP = int( angPrevFloor );
|
||||
double angPrevCeil = ceil(angPrev);
|
||||
angle = ( angPrevCeil - angPrev ) * theAngles[ iP ];
|
||||
|
||||
int iC = int( angCurFloor );
|
||||
if ( iC < nbAngles )
|
||||
angle += ( angCur - angCurFloor ) * theAngles[ iC ];
|
||||
|
||||
iP = int( angPrevCeil );
|
||||
while ( iC-- > iP )
|
||||
angle += theAngles[ iC ];
|
||||
}
|
||||
res.push_back(angle);
|
||||
angPrev = angCur;
|
||||
}
|
||||
Angles.clear();
|
||||
it = res.begin();
|
||||
for(; it!=res.end(); it++)
|
||||
Angles.push_back( *it );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Transform
|
||||
//purpose :
|
||||
|
@ -85,6 +85,53 @@ struct SMESH_NodeSearcher
|
||||
virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//=======================================================================
|
||||
/*!
|
||||
* auxiliary class
|
||||
*/
|
||||
//=======================================================================
|
||||
class SMESH_MeshEditor_PathPoint {
|
||||
public:
|
||||
SMESH_MeshEditor_PathPoint() {
|
||||
myPnt.SetCoord(99., 99., 99.);
|
||||
myTgt.SetCoord(1.,0.,0.);
|
||||
myAngle=0.;
|
||||
myPrm=0.;
|
||||
}
|
||||
void SetPnt(const gp_Pnt& aP3D){
|
||||
myPnt=aP3D;
|
||||
}
|
||||
void SetTangent(const gp_Dir& aTgt){
|
||||
myTgt=aTgt;
|
||||
}
|
||||
void SetAngle(const double& aBeta){
|
||||
myAngle=aBeta;
|
||||
}
|
||||
void SetParameter(const double& aPrm){
|
||||
myPrm=aPrm;
|
||||
}
|
||||
const gp_Pnt& Pnt()const{
|
||||
return myPnt;
|
||||
}
|
||||
const gp_Dir& Tangent()const{
|
||||
return myTgt;
|
||||
}
|
||||
double Angle()const{
|
||||
return myAngle;
|
||||
}
|
||||
double Parameter()const{
|
||||
return myPrm;
|
||||
}
|
||||
|
||||
protected:
|
||||
gp_Pnt myPnt;
|
||||
gp_Dir myTgt;
|
||||
double myAngle;
|
||||
double myPrm;
|
||||
};
|
||||
|
||||
|
||||
// ============================================================
|
||||
/*!
|
||||
* \brief Editor of a mesh
|
||||
@ -292,6 +339,16 @@ public:
|
||||
const SMDS_MeshNode* theNodeStart,
|
||||
const bool theHasAngles,
|
||||
std::list<double>& theAngles,
|
||||
const bool theLinearVariation,
|
||||
const bool theHasRefPoint,
|
||||
const gp_Pnt& theRefPoint,
|
||||
const bool theMakeGroups);
|
||||
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
||||
SMESH_Mesh* theTrackPattern,
|
||||
const SMDS_MeshNode* theNodeStart,
|
||||
const bool theHasAngles,
|
||||
std::list<double>& theAngles,
|
||||
const bool theLinearVariation,
|
||||
const bool theHasRefPoint,
|
||||
const gp_Pnt& theRefPoint,
|
||||
const bool theMakeGroups);
|
||||
@ -583,6 +640,25 @@ private:
|
||||
TIDSortedElemSet& elemSet,
|
||||
const int nbSteps,
|
||||
SMESH_SequenceOfElemPtr& srcElements);
|
||||
|
||||
/*!
|
||||
* auxilary for ExtrusionAlongTrack
|
||||
*/
|
||||
Extrusion_Error MakeEdgePathPoints(std::list<double>& aPrms,
|
||||
const TopoDS_Edge& aTrackEdge,
|
||||
bool FirstIsStart,
|
||||
list<SMESH_MeshEditor_PathPoint>& LPP);
|
||||
Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
|
||||
list<SMESH_MeshEditor_PathPoint>& fullList,
|
||||
const bool theHasAngles,
|
||||
list<double>& theAngles,
|
||||
const bool theLinearVariation,
|
||||
const bool theHasRefPoint,
|
||||
const gp_Pnt& theRefPoint,
|
||||
const bool theMakeGroups);
|
||||
void LinearAngleVariation(const int NbSteps,
|
||||
list<double>& theAngles);
|
||||
|
||||
private:
|
||||
|
||||
SMESH_Mesh * myMesh;
|
||||
|
@ -186,15 +186,6 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
||||
PathMeshLineEdit = new QLineEdit(PathGrp);
|
||||
PathMeshLineEdit->setReadOnly(true);
|
||||
|
||||
// Controls for path shape selection
|
||||
QLabel* PathShapeLab = new QLabel(tr("SMESH_PATH_SHAPE"), PathGrp);
|
||||
|
||||
SelectPathShapeButton = new QToolButton(PathGrp);
|
||||
SelectPathShapeButton->setIcon(selectImage);
|
||||
|
||||
PathShapeLineEdit = new QLineEdit(PathGrp);
|
||||
PathShapeLineEdit->setReadOnly(true);
|
||||
|
||||
// Controls for path starting point selection
|
||||
QLabel* StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
|
||||
|
||||
@ -208,12 +199,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
||||
PathGrpLayout->addWidget(PathMeshLab, 0, 0);
|
||||
PathGrpLayout->addWidget(SelectPathMeshButton, 0, 1);
|
||||
PathGrpLayout->addWidget(PathMeshLineEdit, 0, 2);
|
||||
PathGrpLayout->addWidget(PathShapeLab, 1, 0);
|
||||
PathGrpLayout->addWidget(SelectPathShapeButton, 1, 1);
|
||||
PathGrpLayout->addWidget(PathShapeLineEdit, 1, 2);
|
||||
PathGrpLayout->addWidget(StartPointLab, 2, 0);
|
||||
PathGrpLayout->addWidget(SelectStartPointButton, 2, 1);
|
||||
PathGrpLayout->addWidget(StartPointLineEdit, 2, 2);
|
||||
PathGrpLayout->addWidget(StartPointLab, 1, 0);
|
||||
PathGrpLayout->addWidget(SelectStartPointButton, 1, 1);
|
||||
PathGrpLayout->addWidget(StartPointLineEdit, 1, 2);
|
||||
|
||||
BasePointGrp = new QGroupBox(tr("SMESH_BASE_POINT"), GroupArguments);
|
||||
BasePointGrp->setCheckable(true);
|
||||
@ -337,7 +325,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
||||
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
|
||||
|
||||
myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
|
||||
myPathMeshFilter = new SMESH_TypeFilter (MESH);
|
||||
//myPathMeshFilter = new SMESH_TypeFilter (MESH);
|
||||
myPathMeshFilter = new SMESH_TypeFilter(MESHorSUBMESH);
|
||||
|
||||
myHelpFileName = "extrusion_along_path_page.html";
|
||||
|
||||
@ -357,7 +346,6 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
||||
|
||||
connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(SelectPathShapeButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(SelectStartPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(SelectBasePointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
@ -405,12 +393,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
|
||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
||||
myIDSource = SMESH::SMESH_IDSource::_nil();
|
||||
myMeshActor = 0;
|
||||
myPathMesh = SMESH::SMESH_Mesh::_nil();
|
||||
myPathShape = GEOM::GEOM_Object::_nil();
|
||||
myPath = SMESH::SMESH_IDSource::_nil();
|
||||
|
||||
ElementsLineEdit->clear();
|
||||
PathMeshLineEdit->clear();
|
||||
PathShapeLineEdit->clear();
|
||||
StartPointLineEdit->clear();
|
||||
|
||||
if (ResetControls) {
|
||||
@ -483,8 +469,10 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
||||
if (mySMESHGUI->isActiveStudyLocked())
|
||||
return false;
|
||||
|
||||
//if (myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
|
||||
// !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
|
||||
if ( myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
|
||||
!myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
|
||||
!myMeshActor || myPath->_is_nil() )
|
||||
return false;
|
||||
|
||||
if (!isValid())
|
||||
@ -563,10 +551,12 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
||||
try {
|
||||
SUIT_OverrideCursor wc;
|
||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||
if ( LinearAnglesCheck->isChecked() )
|
||||
anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
|
||||
//if ( LinearAnglesCheck->isChecked() ) {
|
||||
// anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
|
||||
//}
|
||||
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||
/*
|
||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||
if( MeshCheck->isChecked() ) {
|
||||
if( GetConstructorId() == 0 )
|
||||
@ -608,6 +598,27 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
||||
AnglesGrp->isChecked(), anAngles,
|
||||
BasePointGrp->isChecked(), aBasePoint);
|
||||
}
|
||||
*/
|
||||
|
||||
bool NeedGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||
SMESH::ElementType ElemType = SMESH::FACE;
|
||||
if( GetConstructorId() == 0 )
|
||||
ElemType = SMESH::EDGE;
|
||||
if( !MeshCheck->isChecked() ) {
|
||||
SMESH::ListOfGroups_var groups =
|
||||
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
||||
anAngles, LinearAnglesCheck->isChecked(),
|
||||
BasePointGrp->isChecked(), aBasePoint,
|
||||
NeedGroups, ElemType, retVal);
|
||||
}
|
||||
else {
|
||||
SMESH::ListOfGroups_var groups =
|
||||
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
||||
anAngles, LinearAnglesCheck->isChecked(),
|
||||
BasePointGrp->isChecked(), aBasePoint,
|
||||
NeedGroups, ElemType, retVal);
|
||||
}
|
||||
|
||||
|
||||
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
||||
myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
|
||||
@ -767,10 +778,11 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||
aViewWindow->highlight( anIO, true, true );
|
||||
}
|
||||
} else if (send == StartPointLineEdit &&
|
||||
}
|
||||
else if (send == StartPointLineEdit &&
|
||||
myEditCurrentArgument == StartPointLineEdit) {
|
||||
if (!myPathMesh->_is_nil()) {
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
|
||||
if (!myPath->_is_nil()) {
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||
SMDS_Mesh* aMesh = 0;
|
||||
if (aPathActor)
|
||||
aMesh = aPathActor->GetObject()->GetMesh();
|
||||
@ -862,57 +874,37 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
||||
SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
||||
ElementsLineEdit->setText(aString);
|
||||
}
|
||||
} else if (myEditCurrentArgument == PathMeshLineEdit) {
|
||||
}
|
||||
else if (myEditCurrentArgument == PathMeshLineEdit) {
|
||||
// we are now selecting path mesh
|
||||
// reset
|
||||
PathMeshLineEdit->clear();
|
||||
myPathMesh = SMESH::SMESH_Mesh::_nil();
|
||||
PathShapeLineEdit->clear();
|
||||
myPathShape = GEOM::GEOM_Object::_nil();
|
||||
myPath = SMESH::SMESH_IDSource::_nil();
|
||||
StartPointLineEdit->clear();
|
||||
|
||||
// try to get mesh from selection
|
||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||
myPathMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
||||
if(myPathMesh->_is_nil())
|
||||
myPath = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
||||
if( myPath->_is_nil() )
|
||||
return;
|
||||
|
||||
QString aString;
|
||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||
PathMeshLineEdit->setText(aString);
|
||||
} else if (myEditCurrentArgument == PathShapeLineEdit) {
|
||||
// we are now selecting path mesh
|
||||
// reset
|
||||
PathShapeLineEdit->clear();
|
||||
myPathShape = GEOM::GEOM_Object::_nil();
|
||||
StartPointLineEdit->clear();
|
||||
|
||||
// return if path mesh is not yet selected
|
||||
if (myPathMesh->_is_nil())
|
||||
return;
|
||||
|
||||
// try to get shape from selection
|
||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||
myPathShape = SMESH::IObjectToInterface<GEOM::GEOM_Object>(IO);
|
||||
if (myPathShape->_is_nil())
|
||||
return;
|
||||
|
||||
QString aString;
|
||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||
PathShapeLineEdit->setText(aString);
|
||||
} else if (myEditCurrentArgument == StartPointLineEdit) {
|
||||
}
|
||||
else if (myEditCurrentArgument == StartPointLineEdit) {
|
||||
// we are now selecting start point of path
|
||||
// reset
|
||||
StartPointLineEdit->clear();
|
||||
|
||||
// return if path mesh or path shape is not yet selected
|
||||
if (myPathMesh->_is_nil() || myPathShape->_is_nil())
|
||||
if( myPath->_is_nil() )
|
||||
return;
|
||||
|
||||
// try to get shape from selection
|
||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||
if ( !aPathActor )
|
||||
return;
|
||||
|
||||
@ -983,7 +975,6 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
|
||||
QToolButton* send = (QToolButton*)sender();
|
||||
if (send != SelectElementsButton &&
|
||||
send != SelectPathMeshButton &&
|
||||
send != SelectPathShapeButton &&
|
||||
send != SelectStartPointButton &&
|
||||
send != SelectBasePointButton)
|
||||
return;
|
||||
@ -1027,26 +1018,11 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
|
||||
aViewWindow->SetSelectionMode(ActorSelection);
|
||||
mySelectionMgr->installFilter(myPathMeshFilter);
|
||||
}
|
||||
else if (button == SelectPathShapeButton) {
|
||||
myEditCurrentArgument = PathShapeLineEdit;
|
||||
SMESH::SetPointRepresentation(false);
|
||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||
aViewWindow->SetSelectionMode(ActorSelection);
|
||||
|
||||
if (!myPathMesh->_is_nil()) {
|
||||
GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
|
||||
|
||||
if (!aMainShape->_is_nil() && aPathActor)
|
||||
mySelectionMgr->installFilter(new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE, -1,
|
||||
TopAbs_EDGE, aMainShape));
|
||||
//SMESH::SetPickable(aPathActor);
|
||||
}
|
||||
}
|
||||
else if (button == SelectStartPointButton) {
|
||||
myEditCurrentArgument = StartPointLineEdit;
|
||||
if (!myPathMesh->_is_nil()) {
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
|
||||
//if (!myPathMesh->_is_nil()) {
|
||||
if (!myPath->_is_nil()) {
|
||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||
if (aPathActor) {
|
||||
SMESH::SetPointRepresentation(true);
|
||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||
|
@ -94,8 +94,9 @@ private:
|
||||
SMESH::SMESH_Mesh_var myMesh;
|
||||
SMESH_Actor* myMeshActor;
|
||||
SMESH::SMESH_IDSource_var myIDSource;
|
||||
SMESH::SMESH_Mesh_var myPathMesh;
|
||||
GEOM::GEOM_Object_var myPathShape;
|
||||
//SMESH::SMESH_Mesh_var myPathMesh;
|
||||
SMESH::SMESH_IDSource_var myPath;
|
||||
//GEOM::GEOM_Object_var myPathShape;
|
||||
SUIT_SelectionFilter* myElementsFilter;
|
||||
SUIT_SelectionFilter* myPathMeshFilter;
|
||||
int myType;
|
||||
@ -115,8 +116,8 @@ private:
|
||||
QGroupBox* PathGrp;
|
||||
QToolButton* SelectPathMeshButton;
|
||||
QLineEdit* PathMeshLineEdit;
|
||||
QToolButton* SelectPathShapeButton;
|
||||
QLineEdit* PathShapeLineEdit;
|
||||
//QToolButton* SelectPathShapeButton;
|
||||
//QLineEdit* PathShapeLineEdit;
|
||||
QToolButton* SelectStartPointButton;
|
||||
QLineEdit* StartPointLineEdit;
|
||||
QCheckBox* LinearAnglesCheck;
|
||||
|
@ -3497,7 +3497,7 @@ Please select a groups and try again</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_PATH_MESH</source>
|
||||
<translation>Mesh</translation>
|
||||
<translation>Mesh or submesh</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_PATH_SHAPE</source>
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "SMESH_subMeshEventListener.hxx"
|
||||
#include "SMESH_Gen_i.hxx"
|
||||
#include "SMESH_Filter_i.hxx"
|
||||
#include "SMESH_subMesh_i.hxx"
|
||||
#include "SMESH_Group_i.hxx"
|
||||
#include "SMESH_PythonDump.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
@ -1996,7 +1998,7 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array & theIDsOfEleme
|
||||
::SMESH_MeshEditor anEditor( myMesh );
|
||||
::SMESH_MeshEditor::Extrusion_Error error =
|
||||
anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart,
|
||||
theHasAngles, angles,
|
||||
theHasAngles, angles, false,
|
||||
theHasRefPoint, refPnt, theMakeGroups );
|
||||
storeResult(anEditor);
|
||||
theError = convExtrError( error );
|
||||
@ -2011,6 +2013,105 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array & theIDsOfEleme
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : extrusionAlongPathX
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMESH::ListOfGroups*
|
||||
SMESH_MeshEditor_i::extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
|
||||
SMESH::SMESH_IDSource_ptr Path,
|
||||
CORBA::Long NodeStart,
|
||||
CORBA::Boolean HasAngles,
|
||||
const SMESH::double_array& Angles,
|
||||
CORBA::Boolean LinearVariation,
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
const bool MakeGroups,
|
||||
const SMDSAbs_ElementType ElementType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error & Error)
|
||||
{
|
||||
SMESH::ListOfGroups* EmptyGr = new SMESH::ListOfGroups;
|
||||
|
||||
initData();
|
||||
|
||||
list<double> angles;
|
||||
for (int i = 0; i < Angles.length(); i++) {
|
||||
angles.push_back( Angles[i] );
|
||||
}
|
||||
gp_Pnt refPnt( RefPoint.x, RefPoint.y, RefPoint.z );
|
||||
int nbOldGroups = myMesh->NbGroup();
|
||||
|
||||
if ( Path->_is_nil() ) {
|
||||
Error = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
|
||||
return EmptyGr;
|
||||
}
|
||||
|
||||
TIDSortedElemSet elements;
|
||||
arrayToSet(IDsOfElements, GetMeshDS(), elements, ElementType);
|
||||
|
||||
::SMESH_MeshEditor anEditor( myMesh );
|
||||
::SMESH_MeshEditor::Extrusion_Error error;
|
||||
|
||||
SMESH_Mesh_i* aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( Path );
|
||||
if(aMeshImp) {
|
||||
// path as mesh
|
||||
SMDS_MeshNode* aNodeStart =
|
||||
(SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
|
||||
if ( !aNodeStart ) {
|
||||
Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
|
||||
return EmptyGr;
|
||||
}
|
||||
error = anEditor.ExtrusionAlongTrack( elements, &(aMeshImp->GetImpl()), aNodeStart,
|
||||
HasAngles, angles, LinearVariation,
|
||||
HasRefPoint, refPnt, MakeGroups );
|
||||
}
|
||||
else {
|
||||
SMESH_subMesh_i* aSubMeshImp = SMESH::DownCast<SMESH_subMesh_i*>( Path );
|
||||
if(aSubMeshImp) {
|
||||
// path as submesh
|
||||
SMESH::SMESH_Mesh_ptr aPathMesh = aSubMeshImp->GetFather();
|
||||
aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( aPathMesh );
|
||||
SMDS_MeshNode* aNodeStart =
|
||||
(SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(NodeStart);
|
||||
if ( !aNodeStart ) {
|
||||
Error = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
|
||||
return EmptyGr;
|
||||
}
|
||||
SMESH_subMesh* aSubMesh =
|
||||
aMeshImp->GetImpl().GetSubMeshContaining(aSubMeshImp->GetId());
|
||||
error = anEditor.ExtrusionAlongTrack( elements, aSubMesh, aNodeStart,
|
||||
HasAngles, angles, LinearVariation,
|
||||
HasRefPoint, refPnt, MakeGroups );
|
||||
}
|
||||
else {
|
||||
SMESH_Group_i* aGroupImp = SMESH::DownCast<SMESH_Group_i*>( Path );
|
||||
if(aGroupImp) {
|
||||
// path as group of 1D elements
|
||||
}
|
||||
else {
|
||||
// invalid path
|
||||
Error = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
|
||||
return EmptyGr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
storeResult(anEditor);
|
||||
Error = convExtrError( error );
|
||||
|
||||
if ( MakeGroups ) {
|
||||
list<int> groupIDs = myMesh->GetGroupIds();
|
||||
list<int>::iterator newBegin = groupIDs.begin();
|
||||
std::advance( newBegin, nbOldGroups ); // skip old groups
|
||||
groupIDs.erase( groupIDs.begin(), newBegin );
|
||||
return getGroups( & groupIDs );
|
||||
}
|
||||
return EmptyGr;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtrusionAlongPath
|
||||
//purpose :
|
||||
@ -2409,6 +2510,124 @@ ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
|
||||
return aGroups;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtrusionAlongPathObjX
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
SMESH::ListOfGroups* SMESH_MeshEditor_i::
|
||||
ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
||||
SMESH::SMESH_IDSource_ptr Path,
|
||||
CORBA::Long NodeStart,
|
||||
CORBA::Boolean HasAngles,
|
||||
const SMESH::double_array& Angles,
|
||||
CORBA::Boolean LinearVariation,
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
CORBA::Boolean MakeGroups,
|
||||
SMESH::ElementType ElemType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||
{
|
||||
SMESH::long_array_var anElementsId = Object->GetIDs();
|
||||
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(anElementsId,
|
||||
Path,
|
||||
NodeStart,
|
||||
HasAngles,
|
||||
Angles,
|
||||
LinearVariation,
|
||||
HasRefPoint,
|
||||
RefPoint,
|
||||
MakeGroups,
|
||||
(SMDSAbs_ElementType)ElemType,
|
||||
Error);
|
||||
|
||||
if ( !myPreviewMode ) {
|
||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||
TPythonDump aPythonDump;
|
||||
if(isDumpGroups) {
|
||||
aPythonDump << "("<<aGroups;
|
||||
}
|
||||
if(isDumpGroups)
|
||||
aPythonDump << ", error)";
|
||||
else
|
||||
aPythonDump <<"error";
|
||||
|
||||
aPythonDump << " = " << this << ".ExtrusionAlongPathObjX( "
|
||||
<< Object << ", "
|
||||
<< Path << ", "
|
||||
<< NodeStart << ", "
|
||||
<< HasAngles << ", "
|
||||
<< Angles << ", "
|
||||
<< LinearVariation << ", "
|
||||
<< HasRefPoint << ", "
|
||||
<< "SMESH.PointStruct( "
|
||||
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", "
|
||||
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", "
|
||||
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
|
||||
<< ElemType << " )";
|
||||
}
|
||||
return aGroups;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtrusionAlongPathX
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
SMESH::ListOfGroups* SMESH_MeshEditor_i::
|
||||
ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
||||
SMESH::SMESH_IDSource_ptr Path,
|
||||
CORBA::Long NodeStart,
|
||||
CORBA::Boolean HasAngles,
|
||||
const SMESH::double_array& Angles,
|
||||
CORBA::Boolean LinearVariation,
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
CORBA::Boolean MakeGroups,
|
||||
SMESH::ElementType ElemType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||
{
|
||||
SMESH::ListOfGroups * aGroups = extrusionAlongPathX(IDsOfElements,
|
||||
Path,
|
||||
NodeStart,
|
||||
HasAngles,
|
||||
Angles,
|
||||
LinearVariation,
|
||||
HasRefPoint,
|
||||
RefPoint,
|
||||
MakeGroups,
|
||||
(SMDSAbs_ElementType)ElemType,
|
||||
Error);
|
||||
|
||||
if ( !myPreviewMode ) {
|
||||
bool isDumpGroups = aGroups && aGroups->length() > 0;
|
||||
TPythonDump aPythonDump;
|
||||
if(isDumpGroups) {
|
||||
aPythonDump << "("<<aGroups;
|
||||
}
|
||||
if(isDumpGroups)
|
||||
aPythonDump << ", error)";
|
||||
else
|
||||
aPythonDump <<"error";
|
||||
|
||||
aPythonDump << " = " << this << ".ExtrusionAlongPathX( "
|
||||
<< IDsOfElements << ", "
|
||||
<< Path << ", "
|
||||
<< NodeStart << ", "
|
||||
<< HasAngles << ", "
|
||||
<< Angles << ", "
|
||||
<< LinearVariation << ", "
|
||||
<< HasRefPoint << ", "
|
||||
<< "SMESH.PointStruct( "
|
||||
<< ( HasRefPoint ? RefPoint.x : 0 ) << ", "
|
||||
<< ( HasRefPoint ? RefPoint.y : 0 ) << ", "
|
||||
<< ( HasRefPoint ? RefPoint.z : 0 ) << " ), "
|
||||
<< ElemType << " )";
|
||||
}
|
||||
return aGroups;
|
||||
}
|
||||
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Compute rotation angles for ExtrusionAlongPath as linear variation
|
||||
|
@ -348,6 +348,31 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
||||
|
||||
// skl 04.06.2009
|
||||
SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
||||
SMESH::SMESH_IDSource_ptr Path,
|
||||
CORBA::Long NodeStart,
|
||||
CORBA::Boolean HasAngles,
|
||||
const SMESH::double_array& Angles,
|
||||
CORBA::Boolean LinearVariation,
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
CORBA::Boolean MakeGroups,
|
||||
SMESH::ElementType ElemType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
||||
SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
||||
SMESH::SMESH_IDSource_ptr Path,
|
||||
CORBA::Long NodeStart,
|
||||
CORBA::Boolean HasAngles,
|
||||
const SMESH::double_array& Angles,
|
||||
CORBA::Boolean LinearVariation,
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
CORBA::Boolean MakeGroups,
|
||||
SMESH::ElementType ElemType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
|
||||
|
||||
SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
|
||||
const SMESH::AxisStruct& Mirror,
|
||||
SMESH::SMESH_MeshEditor::MirrorType MirrorType);
|
||||
@ -534,6 +559,17 @@ private: //!< private methods
|
||||
const bool MakeGroups,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
|
||||
const SMDSAbs_ElementType ElementType=SMDSAbs_All);
|
||||
SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
|
||||
SMESH::SMESH_IDSource_ptr Path,
|
||||
CORBA::Long NodeStart,
|
||||
CORBA::Boolean HasAngles,
|
||||
const SMESH::double_array& Angles,
|
||||
CORBA::Boolean LinearVariation,
|
||||
CORBA::Boolean HasRefPoint,
|
||||
const SMESH::PointStruct& RefPoint,
|
||||
const bool MakeGroups,
|
||||
const SMDSAbs_ElementType ElementType,
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
|
||||
SMESH::ListOfGroups* mirror(const SMESH::long_array & IDsOfElements,
|
||||
const SMESH::AxisStruct & Axis,
|
||||
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
|
||||
|
@ -2733,6 +2733,53 @@ class Mesh:
|
||||
self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
## Generates new elements by extrusion of the given elements
|
||||
# The path of extrusion must be a meshed edge.
|
||||
# @param Base mesh or list of ids of elements for extrusion
|
||||
# @param Path - 1D mesh or 1D sub-mesh, along which proceeds the extrusion
|
||||
# @param NodeStart the start node from Path. Defines the direction of extrusion
|
||||
# @param HasAngles allows the shape to be rotated around the path
|
||||
# to get the resulting mesh in a helical fashion
|
||||
# @param Angles list of angles in radians
|
||||
# @param LinearVariation forces the computation of rotation angles as linear
|
||||
# variation of the given Angles along path steps
|
||||
# @param HasRefPoint allows using the reference point
|
||||
# @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
|
||||
# The User can specify any point as the Reference Point.
|
||||
# @param MakeGroups forces the generation of new groups from existing ones
|
||||
# @param ElemType type of elements for extrusion (if param Base is a mesh)
|
||||
# @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True,
|
||||
# only SMESH::Extrusion_Error otherwise
|
||||
# @ingroup l2_modif_extrurev
|
||||
def ExtrusionAlongPathX(self, Base, Path, NodeStart,
|
||||
HasAngles, Angles, LinearVariation,
|
||||
HasRefPoint, RefPoint, MakeGroups, ElemType):
|
||||
Angles,AnglesParameters = ParseAngles(Angles)
|
||||
RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
|
||||
if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
|
||||
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||
pass
|
||||
Parameters = AnglesParameters + var_separator + RefPointParameters
|
||||
self.mesh.SetParameters(Parameters)
|
||||
|
||||
if isinstance(Base,list):
|
||||
IDsOfElements = []
|
||||
if Base == []: IDsOfElements = self.GetElementsId()
|
||||
else: IDsOfElements = Base
|
||||
return self.editor.ExtrusionAlongPathX(IDsOfElements, Path, NodeStart,
|
||||
HasAngles, Angles, LinearVariation,
|
||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
||||
else:
|
||||
if isinstance(Base,Mesh):
|
||||
return self.editor.ExtrusionAlongPathObjX(Base.GetMesh(), Path, NodeStart,
|
||||
HasAngles, Angles, LinearVariation,
|
||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
||||
else:
|
||||
raise RuntimeError, "Invalid Base for ExtrusionAlongPathX"
|
||||
|
||||
|
||||
## Generates new elements by extrusion of the given elements
|
||||
# The path of extrusion must be a meshed edge.
|
||||
# @param IDsOfElements ids of elements
|
||||
@ -2741,7 +2788,7 @@ class Mesh:
|
||||
# @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
|
||||
# @param HasAngles allows the shape to be rotated around the path
|
||||
# to get the resulting mesh in a helical fashion
|
||||
# @param Angles list of angles
|
||||
# @param Angles list of angles in radians
|
||||
# @param HasRefPoint allows using the reference point
|
||||
# @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
|
||||
# The User can specify any point as the Reference Point.
|
||||
|
Loading…
Reference in New Issue
Block a user