Update TUI doc on groups
+ Correct export of polyhedra in DAT format (to make them readable)
@ -69,13 +69,13 @@ Ginf2=Mesh_sup.Group(Finf2, "Inf")
|
|||||||
|
|
||||||
## create compounds
|
## create compounds
|
||||||
# create a compound of two meshes with renaming namesake groups and
|
# create a compound of two meshes with renaming namesake groups and
|
||||||
# merging of elements with the given tolerance
|
# merging elements with the given tolerance
|
||||||
Compound1 = smesh.Concatenate([Mesh_inf, Mesh_sup], 0, 1, 1e-05,
|
Compound1 = smesh.Concatenate([Mesh_inf, Mesh_sup], 0, 1, 1e-05,
|
||||||
name='Compound_with_RenamedGrps_and_MergeElems')
|
name='Compound with RenamedGrps and MergeElems')
|
||||||
# create a compound of two meshes with uniting namesake groups and
|
# create a compound of two meshes with uniting namesake groups and
|
||||||
# creating groups of all elements
|
# creating groups of all elements
|
||||||
Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True,
|
Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True,
|
||||||
name='Compound_with_UniteGrps_and_GrpsOfAllElems')
|
name='Compound with UniteGrps and GrpsOfAllElems')
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser(True)
|
||||||
|
@ -27,6 +27,7 @@ print "Criterion: Area > 40, Nb = ", len(anIds)
|
|||||||
|
|
||||||
# create a group of elements with area [35; 40] by removing elements with area > 40 from group aGroup
|
# create a group of elements with area [35; 40] by removing elements with area > 40 from group aGroup
|
||||||
aGroup.Remove(anIds)
|
aGroup.Remove(anIds)
|
||||||
|
aGroup.SetName("35 < Area < 40")
|
||||||
|
|
||||||
# print the result
|
# print the result
|
||||||
aGroupElemIDs = aGroup.GetListOfID()
|
aGroupElemIDs = aGroup.GetListOfID()
|
||||||
|
@ -32,6 +32,7 @@ aGroup2.Add(anIds)
|
|||||||
|
|
||||||
# create union group : area >= 20
|
# create union group : area >= 20
|
||||||
aGroup3 = mesh.UnionListOfGroups([aGroup1, aGroup2], "Area >= 20")
|
aGroup3 = mesh.UnionListOfGroups([aGroup1, aGroup2], "Area >= 20")
|
||||||
|
aGroup3.SetColor( SALOMEDS.Color(1.,1.,0.));
|
||||||
print "Criterion: Area >= 20, Nb = ", len(aGroup3.GetListOfID())
|
print "Criterion: Area >= 20, Nb = ", len(aGroup3.GetListOfID())
|
||||||
# Please note that also there is UnionGroups() method which works with two groups only
|
# Please note that also there is UnionGroups() method which works with two groups only
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ print "Criterion: Area < 20, Nb = ", len(anIds)
|
|||||||
# create a group by adding elements with area < 20
|
# create a group by adding elements with area < 20
|
||||||
aGroup4 = mesh.CreateEmptyGroup(SMESH.FACE, "Area < 20")
|
aGroup4 = mesh.CreateEmptyGroup(SMESH.FACE, "Area < 20")
|
||||||
aGroup4.Add(anIds)
|
aGroup4.Add(anIds)
|
||||||
|
aGroup4.SetColor( SALOMEDS.Color(1.,0.,0.));
|
||||||
|
|
||||||
# create union group : area >= 20 and area < 20
|
# create union group : area >= 20 and area < 20
|
||||||
aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")
|
aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")
|
||||||
|
@ -12,6 +12,7 @@ aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
|
|||||||
|
|
||||||
# create a group by adding elements with area > 100
|
# create a group by adding elements with area > 100
|
||||||
aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
|
aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
|
||||||
|
aSrcGroup1.SetColor( SALOMEDS.Color(1.,1.,0.))
|
||||||
print "Criterion: Area > 100, Nb = ", aSrcGroup1.Size()
|
print "Criterion: Area > 100, Nb = ", aSrcGroup1.Size()
|
||||||
|
|
||||||
# Criterion : AREA < 30
|
# Criterion : AREA < 30
|
||||||
@ -19,6 +20,7 @@ aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
|
|||||||
|
|
||||||
# create a group by adding elements with area < 30
|
# create a group by adding elements with area < 30
|
||||||
aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
|
aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
|
||||||
|
aSrcGroup2.SetColor( SALOMEDS.Color(1.,0.,0.))
|
||||||
print "Criterion: Area < 30, Nb = ", aSrcGroup2.Size()
|
print "Criterion: Area < 30, Nb = ", aSrcGroup2.Size()
|
||||||
|
|
||||||
|
|
||||||
|
BIN
doc/salome/gui/SMESH/images/create_group.png
Executable file → Normal file
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 5.3 KiB |
BIN
doc/salome/gui/SMESH/images/cut_groups1.png
Executable file → Normal file
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 8.5 KiB |
BIN
doc/salome/gui/SMESH/images/editing_groups1.png
Executable file → Normal file
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 45 KiB |
BIN
doc/salome/gui/SMESH/images/intersect_groups1.png
Executable file → Normal file
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 30 KiB |
BIN
doc/salome/gui/SMESH/images/union_groups1.png
Executable file → Normal file
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 33 KiB |
@ -24,7 +24,7 @@
|
|||||||
\tui_script{a3DmeshOnModified2Dmesh.py}
|
\tui_script{a3DmeshOnModified2Dmesh.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\section tui_editing_mesh Editing a mesh
|
\section tui_editing_mesh Editing a mesh (i.e. changing hypotheses)
|
||||||
\tui_script{creating_meshes_ex04.py}
|
\tui_script{creating_meshes_ex04.py}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
@ -24,47 +24,29 @@
|
|||||||
|
|
||||||
\image html editing_groups1.png
|
\image html editing_groups1.png
|
||||||
|
|
||||||
\image html editing_groups2.png
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\section tui_union_of_groups Union of groups
|
\section tui_union_of_groups Union of groups
|
||||||
\tui_script{grouping_elements_ex05.py}
|
\tui_script{grouping_elements_ex05.py}
|
||||||
|
|
||||||
\image html union_groups1.png
|
\image html union_groups1.png
|
||||||
|
|
||||||
\image html union_groups2.png
|
|
||||||
|
|
||||||
\image html union_groups3.png
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\section tui_intersection_of_groups Intersection of groups
|
\section tui_intersection_of_groups Intersection of groups
|
||||||
\tui_script{grouping_elements_ex06.py}
|
\tui_script{grouping_elements_ex06.py}
|
||||||
|
|
||||||
\image html intersect_groups1.png
|
\image html intersect_groups1.png
|
||||||
|
|
||||||
\image html intersect_groups2.png
|
|
||||||
|
|
||||||
\image html intersect_groups3.png
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\section tui_cut_of_groups Cut of groups
|
\section tui_cut_of_groups Cut of groups
|
||||||
\tui_script{grouping_elements_ex07.py}
|
\tui_script{grouping_elements_ex07.py}
|
||||||
|
|
||||||
\image html cut_groups1.png
|
\image html cut_groups1.png
|
||||||
|
|
||||||
\image html cut_groups2.png
|
|
||||||
|
|
||||||
\image html cut_groups3.png
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\section tui_create_dim_group Creating groups of entities from existing groups of superior dimensions
|
\section tui_create_dim_group Creating groups of entities basing on nodes of other groups
|
||||||
\tui_script{grouping_elements_ex08.py}
|
\tui_script{grouping_elements_ex08.py}
|
||||||
|
|
||||||
\image html dimgroup_tui1.png
|
\image html dimgroup_tui1.png
|
||||||
<center>Source groups of faces</center>
|
|
||||||
|
|
||||||
\image html dimgroup_tui2.png
|
|
||||||
<center>Result groups of edges and nodes</center>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
|
|||||||
|
|
||||||
char *file2Read = (char *)myFile.c_str();
|
char *file2Read = (char *)myFile.c_str();
|
||||||
FILE* aFileId = fopen(file2Read, "w+");
|
FILE* aFileId = fopen(file2Read, "w+");
|
||||||
if ( !aFileId ) {
|
if ( !aFileId )
|
||||||
|
{
|
||||||
fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read);
|
fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read);
|
||||||
return DRS_FAIL;
|
return DRS_FAIL;
|
||||||
}
|
}
|
||||||
@ -71,7 +72,8 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
|
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
|
||||||
while(itNodes->more()){
|
while(itNodes->more())
|
||||||
|
{
|
||||||
const SMDS_MeshNode * node = itNodes->next();
|
const SMDS_MeshNode * node = itNodes->next();
|
||||||
fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z());
|
fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z());
|
||||||
}
|
}
|
||||||
@ -82,9 +84,11 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
|
|||||||
/* Ecriture des connectivites, noms, numeros des mailles */
|
/* Ecriture des connectivites, noms, numeros des mailles */
|
||||||
|
|
||||||
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
|
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
|
||||||
while(itEdges->more()){
|
while(itEdges->more())
|
||||||
|
{
|
||||||
const SMDS_MeshElement * elem = itEdges->next();
|
const SMDS_MeshElement * elem = itEdges->next();
|
||||||
switch (elem->NbNodes()) {
|
switch (elem->NbNodes())
|
||||||
|
{
|
||||||
case 2:
|
case 2:
|
||||||
fprintf(aFileId, "%d %d ", elem->GetID(), 102);
|
fprintf(aFileId, "%d %d ", elem->GetID(), 102);
|
||||||
break;
|
break;
|
||||||
@ -99,7 +103,8 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
|
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
|
||||||
while(itFaces->more()){
|
while(itFaces->more())
|
||||||
|
{
|
||||||
const SMDS_MeshElement * elem = itFaces->next();
|
const SMDS_MeshElement * elem = itFaces->next();
|
||||||
if ( elem->IsPoly() )
|
if ( elem->IsPoly() )
|
||||||
fprintf(aFileId, "%d %d ", elem->GetID(), 400+elem->NbNodes());
|
fprintf(aFileId, "%d %d ", elem->GetID(), 400+elem->NbNodes());
|
||||||
@ -112,12 +117,29 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
|
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
|
||||||
while(itVolumes->more()){
|
const SMDS_VtkVolume* v;
|
||||||
|
while(itVolumes->more())
|
||||||
|
{
|
||||||
const SMDS_MeshElement * elem = itVolumes->next();
|
const SMDS_MeshElement * elem = itVolumes->next();
|
||||||
if ( elem->IsPoly() )
|
if ( elem->IsPoly() )
|
||||||
|
{
|
||||||
fprintf(aFileId, "%d %d ", elem->GetID(), 500+elem->NbNodes());
|
fprintf(aFileId, "%d %d ", elem->GetID(), 500+elem->NbNodes());
|
||||||
|
|
||||||
|
if (( v = dynamic_cast< const SMDS_VtkVolume*>( elem )))
|
||||||
|
{
|
||||||
|
std::vector<int> quant = v->GetQuantities();
|
||||||
|
if ( !quant.empty() )
|
||||||
|
{
|
||||||
|
fprintf(aFileId, "%d %d ", quant.size(), quant[0]);
|
||||||
|
for ( size_t i = 1; i < quant.size(); ++i )
|
||||||
|
fprintf(aFileId, "%d ", quant[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
fprintf(aFileId, "%d %d ", elem->GetID(), 300+elem->NbNodes());
|
fprintf(aFileId, "%d %d ", elem->GetID(), 300+elem->NbNodes());
|
||||||
|
}
|
||||||
SMDS_ElemIteratorPtr it=elem->nodesIterator();
|
SMDS_ElemIteratorPtr it=elem->nodesIterator();
|
||||||
while(it->more())
|
while(it->more())
|
||||||
fprintf(aFileId, "%d ", it->next()->GetID());
|
fprintf(aFileId, "%d ", it->next()->GetID());
|
||||||
|
@ -329,7 +329,7 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons
|
|||||||
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
|
||||||
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
||||||
fHelper.SetSubShape( myFace );
|
fHelper.SetSubShape( myFace );
|
||||||
bool paramOK;
|
bool paramOK = true;
|
||||||
double eps = 1e-100;
|
double eps = 1e-100;
|
||||||
|
|
||||||
// sort nodes of all edges by putting them into a map
|
// sort nodes of all edges by putting them into a map
|
||||||
|