# Usage of Body Fitting algorithm
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create a sphere
sphere = geompy.MakeSphereR( 50 )
geompy.addToStudy( sphere, "sphere" )
# create a mesh and assign a "Body Fitting" algo
-mesh = Mesh( sphere )
+mesh = smesh.Mesh( sphere )
cartAlgo = mesh.BodyFitted()
# define a cartesian grid using Coordinates
# create mesh
from SMESH_mechanic import *
# get faces with aspect ratio > 6.5
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 6.5)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 6.5)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with aspect ratio > 6.5:", len(ids)
mesh.Tetrahedron()
mesh.Compute()
# get volumes with aspect ratio < 2.0
-filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_LessThan, 2.0)
+filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_AspectRatio3D, SMESH.FT_LessThan, 2.0)
ids = mesh.GetIdsFromFilter(filter)
print "Number of volumes with aspect ratio < 2.0:", len(ids)
# create mesh
from SMESH_mechanic import *
# get faces with warping angle = 2.0e-13 with tolerance 5.0e-14
-criterion = smesh.GetCriterion(smesh.FACE, smesh.FT_Warping, smesh.FT_EqualTo, 2.0e-13)
+criterion = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Warping, SMESH.FT_EqualTo, 2.0e-13)
criterion.Tolerance = 5.0e-14
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion])
# create mesh
from SMESH_mechanic import *
# get faces with minimum angle > 75
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle,">", 75)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MinimumAngle,">", 75)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with minimum angle > 75:", len(ids)
# create mesh
from SMESH_mechanic import *
# get faces with taper < 1.e-15
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_LessThan, 1.e-15)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Taper, SMESH.FT_LessThan, 1.e-15)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with taper < 1.e-15:", len(ids)
# create mesh
from SMESH_mechanic import *
# get faces with skew > 50
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 50)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Skew, SMESH.FT_MoreThan, 50)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with skew > 50:", len(ids)
# create mesh
from SMESH_mechanic import *
# get faces with area > 60 and < 90
-criterion1 = smesh.GetCriterion(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 60,\
- smesh.FT_Undefined, smesh.FT_LogicalAND)
-criterion2 = smesh.GetCriterion(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 90)
+criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 60,\
+ SMESH.FT_Undefined, SMESH.FT_LogicalAND)
+criterion2 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 90)
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion1,criterion2])
ids = mesh.GetIdsFromFilter(filter)
mesh.Tetrahedron()
mesh.Compute()
# get volumes faces with volume > 100
-filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_MoreThan, 100)
+filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_Volume3D, SMESH.FT_MoreThan, 100)
ids = mesh.GetIdsFromFilter(filter)
print "Number of volumes with volume > 100:", len(ids)
# Free borders
# create mesh
-import geompy, smesh, StdMeshers
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+
face = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( face, "quadrangle" )
mesh = smesh.Mesh(face)
mesh.Triangle().MaxElementArea(25)
mesh.Compute()
# get all free borders
-filter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)
+filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders)
ids = mesh.GetIdsFromFilter(filter)
print "Number of edges on free borders:", len(ids)
# Free edges
# create mesh
-import geompy, smesh, StdMeshers
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+
face = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( face, "quadrangle" )
mesh = smesh.Mesh(face)
mesh.Triangle().MaxElementArea(25)
mesh.Compute()
# get all faces with free edges
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeEdges)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeEdges)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with free edges:", len(ids)
# add node
mesh.AddNode(0,0,0)
# get all free nodes
-filter = smesh.GetFilter(smesh.NODE, smesh.FT_FreeNodes)
+filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_FreeNodes)
ids = mesh.GetIdsFromFilter(filter)
print "Number of free nodes:", len(ids)
# create mesh
from SMESH_mechanic import *
# get all free faces
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeFaces)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeFaces)
ids = mesh.GetIdsFromFilter(filter)
print "Number of free faces:", len(ids)
# create mesh
from SMESH_mechanic import *
# remove some faces to have faces with bare borders
-mesh.RemoveElements( mesh.GetElementsByType(smesh.FACE)[0:5] )
+mesh.RemoveElements( mesh.GetElementsByType(SMESH.FACE)[0:5] )
# get all faces bare borders
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_BareBorderFace)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BareBorderFace)
ids = mesh.GetIdsFromFilter(filter)
print "Faces with bare borders:", ids
# create mesh
from SMESH_mechanic import *
-faceID = mesh.GetElementsByType(smesh.FACE)[0]
+faceID = mesh.GetElementsByType(SMESH.FACE)[0]
# get all faces co-planar to the first face with tolerance 5 degrees
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_CoplanarFaces,faceID,Tolerance=5.0)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_CoplanarFaces,faceID,Tolerance=5.0)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces coplanar with the first one:", len(ids)
# create mesh
from SMESH_mechanic import *
# get all over-constrained faces
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_OverConstrainedFace)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_OverConstrainedFace)
ids = mesh.GetIdsFromFilter(filter)
print "Over-constrained faces:", ids
# Double edges, Double faces, Double volumes
-from smesh import *
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# make a mesh on a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
mesh = Mesh( box, "Box" )
mesh.TranslateObject( mesh, MakeDirStruct( 10,0,0), Copy=True )
mesh.MergeNodes( mesh.FindCoincidentNodes(1e-7) )
# create filters to find equal elements
-equalEdgesFilter = GetFilter(SMESH.EDGE, FT_EqualEdges)
-equalFacesFilter = GetFilter(SMESH.FACE, FT_EqualFaces)
-equalVolumesFilter = GetFilter(SMESH.VOLUME, FT_EqualVolumes)
+equalEdgesFilter = GetFilter(SMESH.EDGE, SMESH.FT_EqualEdges)
+equalFacesFilter = GetFilter(SMESH.FACE, SMESH.FT_EqualFaces)
+equalVolumesFilter = GetFilter(SMESH.VOLUME, SMESH.FT_EqualVolumes)
# get equal elements
print "Number of equal edges:", len( mesh.GetIdsFromFilter( equalEdgesFilter ))
print "Number of equal faces:", len( mesh.GetIdsFromFilter( equalFacesFilter ))
# Double nodes
-from smesh import *
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# make a mesh on a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
mesh = Mesh( box, "Box" )
# create mesh
from SMESH_mechanic import *
# get border edges with number of connected faces = 5
-filter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, 5)
+filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, 5)
ids = mesh.GetIdsFromFilter(filter)
print "Number of border edges with 5 faces connected:", len(ids)
# create mesh
from SMESH_mechanic import *
# get faces which consist of edges belonging to 2 mesh elements
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, 2)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MultiConnection2D, 2)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces consisting of edges belonging to 2 faces:", len(ids)
# create mesh
from SMESH_mechanic import *
# get edges with length > 14
-filter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, 14)
+filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_Length, SMESH.FT_MoreThan, 14)
ids = mesh.GetIdsFromFilter(filter)
print "Number of edges with length > 14:", len(ids)
# create mesh
from SMESH_mechanic import *
# get all faces that have edges with length > 14
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, 14)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Length2D, SMESH.FT_MoreThan, 14)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with maximum edge length > 14:", len(ids)
# create mesh
from SMESH_mechanic import *
# get all faces that have elements with length > 10
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, 10)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MaxElementLength2D, SMESH.FT_MoreThan, 10)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with maximum element length > 10:", len(ids)
mesh.Tetrahedron()
mesh.Compute()
# get all volumes that have elements with length > 10
-filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, 10)
+filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_MaxElementLength3D, SMESH.FT_MoreThan, 10)
ids = mesh.GetIdsFromFilter(filter)
print "Number of volumes with maximum element length > 10:", len(ids)
# remove some volumes to have volumes with bare borders
mesh.RemoveElements( mesh.GetElementsByType(VOLUME)[0:5] )
# get all volumes with bare borders
-filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_BareBorderVolume)
+filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_BareBorderVolume)
ids = mesh.GetIdsFromFilter(filter)
print "Volumes with bare borders:", ids
mesh.Tetrahedron()
mesh.Compute()
# get all over-constrained volumes
-filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_OverConstrainedVolume)
+filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_OverConstrainedVolume)
ids = mesh.GetIdsFromFilter(filter)
print "Over-constrained volumes:", ids
# create mesh
from SMESH_mechanic import *
# get all faces which nodes lie on the face sub_face3
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToGeom, sub_face3)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BelongToGeom, sub_face3)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces which nodes lie on sub_face3:", len(ids)
# create mesh
from SMESH_mechanic import *
# get all faces at least one node of each lies on the face sub_face3
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_LyingOnGeom, sub_face3)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_LyingOnGeom, sub_face3)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces at least one node of each lies on sub_face3:", len(ids)
# create mesh
from SMESH_mechanic import *
# create plane
-import geompy
plane_1 = geompy.MakePlane(p3,seg1,2000)
geompy.addToStudy(plane_1, "plane_1")
# get all nodes which lie on the plane \a plane_1
-filter = smesh.GetFilter(smesh.NODE, smesh.FT_BelongToPlane, plane_1)
+filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_BelongToPlane, plane_1)
ids = mesh.GetIdsFromFilter(filter)
print "Number of nodes which lie on the plane plane_1:", len(ids)
# create mesh
from SMESH_mechanic import *
# get all faces which lie on the cylindrical face \a sub_face1
-filter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToCylinder, sub_face1)
+filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BelongToCylinder, sub_face1)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces which lie on the cylindrical surface sub_face1:", len(ids)
surface_1 = geompy.MakePrismVecH( spline_1, vz, 70.0 )
geompy.addToStudy(surface_1, "surface_1")
# get all nodes which lie on the surface \a surface_1
-filter = smesh.GetFilter(smesh.NODE, smesh.FT_BelongToGenSurface, surface_1)
+filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_BelongToGenSurface, surface_1)
ids = mesh.GetIdsFromFilter(filter)
print "Number of nodes which lie on the surface surface_1:", len(ids)
# create mesh
from SMESH_mechanic import *
# get nodes with identifiers [5-10] and [15-30]
-criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="5-10",\
- BinaryOp=smesh.FT_LogicalOR)
-criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="15-30")
+criterion1 = smesh.GetCriterion(SMESH.NODE, SMESH.FT_RangeOfIds, Threshold="5-10",\
+ BinaryOp=SMESH.FT_LogicalOR)
+criterion2 = smesh.GetCriterion(SMESH.NODE, SMESH.FT_RangeOfIds, Threshold="15-30")
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion1,criterion2])
ids = mesh.GetIdsFromFilter(filter)
mesh.Tetrahedron()
mesh.Compute()
# get all badly oriented volumes
-filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_BadOrientedVolume)
+filter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_BadOrientedVolume)
ids = mesh.GetIdsFromFilter(filter)
print "Number of badly oriented volumes:", len(ids)
# create mesh
from SMESH_mechanic import *
# get number of linear and quadratic edges
-filter_linear = smesh.GetFilter(smesh.EDGE, smesh.FT_LinearOrQuadratic)
-filter_quadratic = smesh.GetFilter(smesh.EDGE, smesh.FT_LinearOrQuadratic, smesh.FT_LogicalNOT)
+filter_linear = smesh.GetFilter(SMESH.EDGE, SMESH.FT_LinearOrQuadratic)
+filter_quadratic = smesh.GetFilter(SMESH.EDGE, SMESH.FT_LinearOrQuadratic, SMESH.FT_LogicalNOT)
ids_linear = mesh.GetIdsFromFilter(filter_linear)
ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
# create mesh
from SMESH_mechanic import *
# create group of edges
-all_edges = mesh.GetElementsByType(smesh.EDGE)
-grp = mesh.MakeGroupByIds("edges group", smesh.EDGE, all_edges[:len(all_edges)/4])
+all_edges = mesh.GetElementsByType(SMESH.EDGE)
+grp = mesh.MakeGroupByIds("edges group", SMESH.EDGE, all_edges[:len(all_edges)/4])
import SALOMEDS
c = SALOMEDS.Color(0.1, 0.5, 1.0)
grp.SetColor(c)
# get number of the edges not belonging to the group with the given color
-filter = smesh.GetFilter(smesh.EDGE, smesh.FT_GroupColor, c, smesh.FT_LogicalNOT)
+filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_GroupColor, c, SMESH.FT_LogicalNOT)
ids = mesh.GetIdsFromFilter(filter)
print "Number of edges not beloging to the group with color (0.1, 0.5, 1.0):", len(ids)
mesh.Tetrahedron()
mesh.Compute()
# get all triangles, quadrangles, tetrahedrons, pyramids
-filter_tri = smesh.GetFilter(smesh.FACE, smesh.FT_ElemGeomType, smesh.Geom_TRIANGLE)
-filter_qua = smesh.GetFilter(smesh.FACE, smesh.FT_ElemGeomType, smesh.Geom_QUADRANGLE)
-filter_tet = smesh.GetFilter(smesh.VOLUME, smesh.FT_ElemGeomType, smesh.Geom_TETRA)
-filter_pyr = smesh.GetFilter(smesh.VOLUME, smesh.FT_ElemGeomType, smesh.Geom_PYRAMID)
+filter_tri = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_TRIANGLE)
+filter_qua = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_QUADRANGLE)
+filter_tet = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_TETRA)
+filter_pyr = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_PYRAMID)
ids_tri = mesh.GetIdsFromFilter(filter_tri)
ids_qua = mesh.GetIdsFromFilter(filter_qua)
ids_tet = mesh.GetIdsFromFilter(filter_tet)
# create mesh
from SMESH_mechanic import *
# get all the quadrangle faces ...
-criterion1 = smesh.GetCriterion(smesh.FACE, smesh.FT_ElemGeomType, smesh.Geom_QUADRANGLE, smesh.FT_LogicalAND)
+criterion1 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_QUADRANGLE, SMESH.FT_LogicalAND)
# ... AND do NOT get those from sub_face3
-criterion2 = smesh.GetCriterion(smesh.FACE, smesh.FT_BelongToGeom, sub_face3, smesh.FT_LogicalNOT)
+criterion2 = smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGeom, sub_face3, SMESH.FT_LogicalNOT)
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion1,criterion2])
ids = mesh.GetIdsFromFilter(filter)
-myGroup = mesh.MakeGroupByIds("Quads_on_cylindrical_faces",smesh.FACE,ids)
+myGroup = mesh.MakeGroupByIds("Quads_on_cylindrical_faces",SMESH.FACE,ids)
# This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder).
# The big cylinder is defined by two geometric volumes.
-import geompy
-import smesh
-import SMESH
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+
# geometry
Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_3)
Fuse_1 = geompy.MakeFuse(Cylinder_1, Cylinder_2)
Partition_1 = geompy.MakePartition([Fuse_1], [Cylinder_1, Box_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
-[Solid_1,Solid_2] = geompy.GetShapesOnShape(Cylinder_1, Partition_1, geompy.ShapeType["SOLID"], geompy.GEOM.ST_IN)
-[Solid_3,Solid_4] = geompy.GetShapesOnShape(Cylinder_2, Partition_1, geompy.ShapeType["SOLID"], geompy.GEOM.ST_IN)
+[Solid_1,Solid_2] = geompy.GetShapesOnShape(Cylinder_1, Partition_1, geompy.ShapeType["SOLID"], GEOM.ST_IN)
+[Solid_3,Solid_4] = geompy.GetShapesOnShape(Cylinder_2, Partition_1, geompy.ShapeType["SOLID"], GEOM.ST_IN)
Vertex_4 = geompy.MakeVertex(450, 0, 0)
Vertex_5 = geompy.MakeVertex(500, 0, 0)
Vertex_6 = geompy.MakeVertex(550, 0, 0)
vec1 = geompy.MakeVector(Vertex_4, Vertex_5)
vec2 = geompy.MakeVector(Vertex_5, Vertex_6)
-[Face_1] = geompy.GetShapesOnPlane(Partition_1, geompy.ShapeType["FACE"], vec1, geompy.GEOM.ST_ON)
-[Face_2] = geompy.GetShapesOnPlane(Partition_1, geompy.ShapeType["FACE"], vec2, geompy.GEOM.ST_ON)
+[Face_1] = geompy.GetShapesOnPlane(Partition_1, geompy.ShapeType["FACE"], vec1, GEOM.ST_ON)
+[Face_2] = geompy.GetShapesOnPlane(Partition_1, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
# meshing (we have linear tetrahedrons here, but other elements are OK)
Mesh_1 = smesh.Mesh(Partition_1)
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
-MEFISTO_2D = Mesh_1.Triangle(algo=smesh.MEFISTO)
+MEFISTO_2D = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO)
Length_From_Edges_2D = MEFISTO_2D.LengthFromEdges()
ALGO3D = Mesh_1.Tetrahedron()
isDone = Mesh_1.Compute()
salome = SMESH_mechanic.salome
# Get ids of all faces with area > 100
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
anIds = mesh.GetIdsFromFilter(aFilter)
# create a group consisting of faces with area > 100
-aGroup1 = mesh.MakeGroupByIds("Area > 100", smesh.FACE, anIds)
+aGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds)
# create a group that contains all nodes from the mesh
-aGroup2 = mesh.CreateEmptyGroup(smesh.NODE, "all nodes")
+aGroup2 = mesh.CreateEmptyGroup(SMESH.NODE, "all nodes")
aGroup2.AddFrom(mesh.mesh)
salome.sg.updateObjBrowser(1)
# Create a Group on Geometry
+
import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBox(0., 0., 0., 100., 100., 100.)
# Create a Group on Filter
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
box = geompy.MakeBoxDXDYDZ(10,10,10)
salome = SMESH_mechanic.salome
# Get ids of all faces with area > 35
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 35.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 35.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 35, Nb = ", len(anIds)
# create a group by adding elements with area > 35
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Area > 35")
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Area > 35")
aGroup.Add(anIds)
# Get ids of all faces with area > 40
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 40.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 40.)
anIds = mesh.GetIdsFromFilter(aFilter)
salome = SMESH_mechanic.salome
# Criterion : AREA > 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 20.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 20.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 20, Nb = ", len( anIds )
# create a group by adding elements with area > 20
-aGroup1 = mesh.CreateEmptyGroup(smesh.FACE, "Area > 20")
+aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, "Area > 20")
aGroup1.Add(anIds)
# Criterion : AREA = 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_EqualTo, 20.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_EqualTo, 20.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area = 20, Nb = ", len( anIds )
# create a group by adding elements with area = 20
-aGroup2 = mesh.CreateEmptyGroup( smesh.FACE, "Area = 20" )
+aGroup2 = mesh.CreateEmptyGroup( SMESH.FACE, "Area = 20" )
aGroup2.Add(anIds)
# Please note that also there is UnionGroups() method which works with two groups only
# Criterion : AREA < 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 20.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 20.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area < 20, Nb = ", len(anIds)
# 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)
# create union group : area >= 20 and area < 20
salome = SMESH_mechanic.salome
# Criterion : AREA > 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 20.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 20.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 20, Nb = ", len(anIds)
# create a group by adding elements with area > 20
-aGroup1 = mesh.CreateEmptyGroup(smesh.FACE, "Area > 20")
+aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, "Area > 20")
aGroup1.Add(anIds)
# Criterion : AREA < 60
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 60.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 60.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area < 60, Nb = ", len(anIds)
# create a group by adding elements with area < 60
-aGroup2 = mesh.CreateEmptyGroup(smesh.FACE, "Area < 60")
+aGroup2 = mesh.CreateEmptyGroup(SMESH.FACE, "Area < 60")
aGroup2.Add(anIds)
# create an intersection of groups : 20 < area < 60
salome = SMESH_mechanic.salome
# Criterion : AREA > 20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 20.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 20.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 20, Nb = ", len(anIds)
# create a group by adding elements with area > 20
-aGroupMain = mesh.MakeGroupByIds("Area > 20", smesh.FACE, anIds)
+aGroupMain = mesh.MakeGroupByIds("Area > 20", SMESH.FACE, anIds)
# Criterion : AREA < 60
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 60.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 60.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area < 60, Nb = ", len(anIds)
# create a group by adding elements with area < 60
-aGroupTool = mesh.MakeGroupByIds("Area < 60", smesh.FACE, anIds)
+aGroupTool = mesh.MakeGroupByIds("Area < 60", SMESH.FACE, anIds)
# create a cut of groups : area >= 60
aGroupRes = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")
salome = SMESH_mechanic.salome
# Criterion : AREA > 100
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area > 100, Nb = ", len(anIds)
# create a group by adding elements with area > 100
-aSrcGroup1 = mesh.MakeGroupByIds("Area > 100", smesh.FACE, anIds)
+aSrcGroup1 = mesh.MakeGroupByIds("Area > 100", SMESH.FACE, anIds)
# Criterion : AREA < 30
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 30.)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
anIds = mesh.GetIdsFromFilter(aFilter)
print "Criterion: Area < 30, Nb = ", len(anIds)
# create a group by adding elements with area < 30
-aSrcGroup2 = mesh.MakeGroupByIds("Area < 30", smesh.FACE, anIds)
+aSrcGroup2 = mesh.MakeGroupByIds("Area < 30", SMESH.FACE, anIds)
# Create group of edges using source groups of faces
-aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], smesh.EDGE, "Edges" )
+aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" )
# Create group of nodes using source groups of faces
-aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], smesh.NODE, "Nodes" )
+aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.NODE, "Nodes" )
salome.sg.updateObjBrowser(1)
# Minimum Distance
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
from SMESH_mechanic import mesh as mesh1
from SMESH_test1 import mesh as mesh2
# Bounding Box
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
from SMESH_mechanic import mesh as mesh1
from SMESH_test1 import mesh as mesh2
# Add Node
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
mesh = smesh.Mesh()
# Add 0D Element
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
mesh = smesh.Mesh()
# Add 0D Element on Element Nodes
-import smesh, SMESH, geompy
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create a geometry
box = geompy.MakeBoxDXDYDZ( 10, 10, 10 )
# Add Polygon
import math
+
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
-import smesh
# create an empty mesh structure
mesh = smesh.Mesh()
# Add Polyhedron
+
import salome
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
import math
# create an empty mesh structure
# Moving Nodes
-from geompy import *
-from smesh import *
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
box = MakeBoxDXDYDZ(200, 200, 200)
# Diagonal Inversion
+
import salome
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create an empty mesh structure
mesh = smesh.Mesh()
# Uniting two Triangles
+
import salome
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create an empty mesh structure
mesh = smesh.Mesh()
# Uniting a Set of Triangles
+
import salome
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create an empty mesh structure
mesh = smesh.Mesh()
# unite a set of triangles
print "\nUnite a set of triangles ... ",
-res = mesh.TriToQuad([ff[2], ff[3], ff[4], ff[5]], smesh.FT_MinimumAngle, 60.)
+res = mesh.TriToQuad([ff[2], ff[3], ff[4], ff[5]], SMESH.FT_MinimumAngle, 60.)
if not res: print "failed!"
else: print "done."
# Orientation
+
import salome
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create an empty mesh structure
mesh = smesh.Mesh()
mesh = SMESH_mechanic.mesh
# cut two quadrangles: 405 and 406
-mesh.QuadToTri([405, 406], smesh.FT_MinimumAngle)
+mesh.QuadToTri([405, 406], SMESH.FT_MinimumAngle)
# Smoothing
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
import SMESH_mechanic
-smesh = SMESH_mechanic.smesh
+#smesh = SMESH_mechanic.smesh
mesh = SMESH_mechanic.mesh
# select the top face
geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, face, "face planar with hole")
# create a group of faces to be smoothed
-GroupSmooth = mesh.GroupOnGeom(face, "Group of faces (smooth)", smesh.FACE)
+GroupSmooth = mesh.GroupOnGeom(face, "Group of faces (smooth)", SMESH.FACE)
# perform smoothing
# Extrusion
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
import SMESH_mechanic
-smesh = SMESH_mechanic.smesh
+#smesh = SMESH_mechanic.smesh
mesh = SMESH_mechanic.mesh
# select the top face
vector = smesh.DirStruct(point)
# create a group to be extruded
-GroupTri = mesh.GroupOnGeom(face, "Group of faces (extrusion)", smesh.FACE)
+GroupTri = mesh.GroupOnGeom(face, "Group of faces (extrusion)", SMESH.FACE)
# perform extrusion of the group
mesh.ExtrusionSweepObject(GroupTri, vector, 5)
# Extrusion along a Path
import math
+
import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-# Geometry
-import geompy
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# 1. Create points
points = [[0, 0], [50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]]
pass
# Mesh
-import smesh
# Mesh the given shape with the given 1d hypothesis
def Mesh1D(shape1d, nbSeg, name):
# Pattern Mapping
-import geompy
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# define the geometry
Box_1 = geompy.MakeBoxDXDYDZ(200., 200., 200.)
# Convert mesh to/from quadratic
-import geompy
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create sphere of radius 100
# Using SALOME NoteBook
-import geompy
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
import salome_notebook
# set variables
# Free Borders
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-import smesh
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
mesh.Compute()
# criterion : free borders
-aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)
+aFilter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders)
anIds = mesh.GetIdsFromFilter(aFilter)
# print the result
print ""
# create a group
-aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Free borders")
+aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Free borders")
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Borders at Multiconnection
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-import smesh
-import SMESH
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
# Criterion : Borders at multi-connection
nb_conn = 2
-aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, nb_conn)
+aFilter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, SMESH.FT_EqualTo, nb_conn)
anIds = mesh.GetIdsFromFilter(aFilter)
# print the result
print ""
# create a group
-aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Borders at multi-connections")
+aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Borders at multi-connections")
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Length 1D
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-import smesh
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
# Criterion : Length > 3.
length_margin = 3.
-aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)
+aFilter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_Length, SMESH.FT_MoreThan, length_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
# print the result
print ""
# create a group
-aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Edges with length > " + `length_margin`)
+aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : AREA > 95.
area_margin = 95.
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, area_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
aBorders = mesh.GetFreeBorders()
# create groups
-aGroupF = mesh.CreateEmptyGroup(smesh.FACE, "Faces with free edges")
-aGroupN = mesh.CreateEmptyGroup(smesh.NODE, "Nodes on free edges")
+aGroupF = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with free edges")
+aGroupN = mesh.CreateEmptyGroup(SMESH.NODE, "Nodes on free edges")
# fill groups with elements, corresponding to the criterion
print ""
# Free Nodes
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-import smesh
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create box
box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
# Criterion : AREA < 80.
area_margin = 80.
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, area_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, area_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
mesh.RemoveElements(anIds)
# criterion : free nodes
-aFilter = smesh.GetFilter(smesh.NODE, smesh.FT_FreeNodes)
+aFilter = smesh.GetFilter(SMESH.NODE, SMESH.FT_FreeNodes)
anNodeIds = mesh.GetIdsFromFilter(aFilter)
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.NODE, "Free_nodes")
+aGroup = mesh.CreateEmptyGroup(SMESH.NODE, "Free_nodes")
aGroup.Add(anNodeIds)
# print the result
# Free Faces
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
####### GEOM part ########
geompy.addToStudy( Plane_2, "Plane_2" )
###### SMESH part ######
-import smesh
-
-import StdMeshers
Mesh_1 = smesh.Mesh(Partition_1)
Regular_1D = Mesh_1.Segment()
isDone = Mesh_1.Compute()
# create a group of free faces
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeFaces )
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeFaces )
aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
-aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Free_faces")
+aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Free_faces")
aGroup.Add(aFaceIds)
# print the result
print ""
#filter faces from plane 2
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_2)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BelongToPlane, Plane_2)
aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
aGroup.Remove(aFaceIds)
# create a group of shared faces (located on partition boundary inside box)
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToPlane, Plane_1)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BelongToPlane, Plane_1)
aFaceIds = Mesh_1.GetIdsFromFilter(aFilter)
-aGroup = Mesh_1.CreateEmptyGroup(smesh.FACE, "Shared_faces")
+aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Shared_faces")
aGroup.Add(aFaceIds)
salome.sg.updateObjBrowser(1)
# Bare border faces
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
geompy.addToStudy( box, "box" )
# Bare border volumes
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
box = geompy.MakeBoxDXDYDZ(100, 30, 10)
# the smallest face of the box
# Over-constrained faces
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
mesh = Mesh()
faceFilter = GetFilter(FACE,FT_OverConstrainedFace)
# Over-constrained volumes
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
mesh = Mesh()
volumeFilter = GetFilter(VOLUME,FT_OverConstrainedVolume)
# Length 2D
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-import smesh
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
# Criterion : Length 2D > 5.7
length_margin = 5.7
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Length2D, SMESH.FT_MoreThan, length_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " + `length_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with length 2D > " + `length_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Borders at Multiconnection 2D
+
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-import smesh
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create a compound of two glued boxes
box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
# Criterion : MULTI-CONNECTION 2D = 3
nb_conn = 3
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, nb_conn)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MultiConnection2D, SMESH.FT_EqualTo, nb_conn)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection 2D = " + `nb_conn`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Borders at multi-connection 2D = " + `nb_conn`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : AREA > 100.
area_margin = 100.
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, area_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Area > " + `area_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Area > " + `area_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : Taper > 3e-20
taper_margin = 3e-20
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Taper, SMESH.FT_MoreThan, taper_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Taper > " + `taper_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : ASPECT RATIO > 1.8
ar_margin = 1.8
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, ar_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, ar_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Aspect Ratio > " + `ar_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : MINIMUM ANGLE < 35.
min_angle = 35.
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MinimumAngle, SMESH.FT_LessThan, min_angle)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + `min_angle`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Minimum Angle < " + `min_angle`)
aGroup.Add(anIds)
# Criterion : WARP ANGLE > 1e-15
wa_margin = 1e-15
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Warping, SMESH.FT_MoreThan, wa_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Warp > " + `wa_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Warp > " + `wa_margin`)
aGroup.Add(anIds)
# Criterion : Skew > 38.
skew_margin = 38.
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Skew, SMESH.FT_MoreThan, skew_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Skew > " + `skew_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : ELEMENT DIAMETER 2D > 10
mel_2d_margin = 10
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, mel_2d_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MaxElementLength2D, SMESH.FT_MoreThan, mel_2d_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Element Diameter 2D > " + `mel_2d_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 2D > " + `mel_2d_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Criterion : ASPECT RATIO 3D > 4.5
ar_margin = 4.5
-aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)
+aFilter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_AspectRatio3D, SMESH.FT_MoreThan, ar_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Aspect Ratio 3D > " + `ar_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Aspect Ratio 3D > " + `ar_margin`)
aGroup.Add(anIds)
# Criterion : VOLUME < 7.
volume_margin = 7.
-aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)
+aFilter = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_Volume3D, SMESH.FT_LessThan, volume_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Volume < " + `volume_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.VOLUME, "Volume < " + `volume_margin`)
aGroup.Add(anIds)
# Criterion : ELEMENT DIAMETER 3D > 10
mel_3d_margin = 10
-aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, mel_3d_margin)
+aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MaxElementLength3D, SMESH.FT_MoreThan, mel_3d_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
print ""
# create a group
-aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Element Diameter 3D > " + `mel_3d_margin`)
+aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 3D > " + `mel_3d_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
# Scale
-import geompy
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+
Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
f = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
-import smesh,SMESH
-import StdMeshers
Mesh1 = smesh.Mesh(f[0])
Regular_1D = Mesh1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(3)
# Merging Elements
+
import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create a face to be meshed
px = geompy.MakeVertex(100., 0. , 0. )
# Sew Meshes Border to Side
-import geompy
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create two faces of a box
box1 = geompy.MakeBox(0., 0., -10., 30., 20., 25.)
# Sew Conform Free Borders
-import geompy
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create two faces of the box
box1 = geompy.MakeBox(0., 0., -10., 20., 20., 15.)
# Sew Free Borders
-import geompy
-import smesh
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create two faces of the box
box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
# Sew Side Elements
-import geompy
-import smesh
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create two boxes
box1 = geompy.MakeBox(0., 0., 0., 10., 10., 10.)
# Duplicate nodes
+
import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# Create a box
# Without the duplication of border elements
# Nodes to duplicate
-nodes1 = mesh.CreateEmptyGroup( smesh.NODE, 'nodes1' )
+nodes1 = mesh.CreateEmptyGroup( SMESH.NODE, 'nodes1' )
nodes1.Add( [ 119, 125, 131, 137 ] )
# Group of faces to replace nodes with new ones
-faces1 = mesh.CreateEmptyGroup( smesh.FACE, 'faces1' )
+faces1 = mesh.CreateEmptyGroup( SMESH.FACE, 'faces1' )
faces1.Add( [ 144, 151, 158 ] )
# Duplicate nodes
# With the duplication of border elements
# Edges to duplicate
-edges = mesh.CreateEmptyGroup( smesh.EDGE, 'edges' )
+edges = mesh.CreateEmptyGroup( SMESH.EDGE, 'edges' )
edges.Add( [ 32, 33, 34 ] )
# Nodes not to duplicate
-nodes2 = mesh.CreateEmptyGroup( smesh.NODE, 'nodes2' )
+nodes2 = mesh.CreateEmptyGroup( SMESH.NODE, 'nodes2' )
nodes2.Add( [ 35, 38 ] )
# Group of faces to replace nodes with new ones
-faces2 = mesh.CreateEmptyGroup( smesh.FACE, 'faces2' )
+faces2 = mesh.CreateEmptyGroup( SMESH.FACE, 'faces2' )
faces2.Add( [ 141, 148, 155 ] )
# Duplicate nodes
# Create boundary elements
-from smesh import *
-SetCurrentStudy(salome.myStudy)
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
gFaces = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])
# Reorient faces by vector
-import smesh, geompy, SMESH
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
# create a geometry consisting of two faces
box = geompy.MakeBoxDXDYDZ( 10, 10, 10 )
# Use existing faces algorithm
-import smesh, geompy
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+import salome_notebook
+
import numpy as np
# define my 2D algorithm
# Viewing Mesh Infos
-import geompy
-import smesh
-import SMESH
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# create a box
box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
# Find Element by Point
-import geompy
-import smesh
-import SMESH
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
# Create a geometry to mesh
box = geompy.MakeBoxDXDYDZ(100,100,100)
\section filter_aspect_ratio Aspect ratio
Filter 2D mesh elements (faces) according to the aspect ratio value:
-- element type should be \a smesh.FACE
-- functor type should be \a smesh.FT_AspectRatio
+- element type should be \a SMESH.FACE
+- functor type should be \a SMESH.FT_AspectRatio
- threshold is floating point value (aspect ratio)
\tui_script{filters_ex01.py}
\section filter_aspect_ratio_3d Aspect ratio 3D
Filter 3D mesh elements (volumes) according to the aspect ratio value:
-- element type is \a smesh.VOLUME
-- functor type is \a smesh.FT_AspectRatio3D
+- element type is \a SMESH.VOLUME
+- functor type is \a SMESH.FT_AspectRatio3D
- threshold is floating point value (aspect ratio)
\tui_script{filters_ex02.py}
\section filter_warping_angle Warping angle
Filter 2D mesh elements (faces) according to the warping angle value:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_Warping
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_Warping
- threshold is floating point value (warping angle)
\tui_script{filters_ex03.py}
\section filter_minimum_angle Minimum angle
Filter 2D mesh elements (faces) according to the minimum angle value:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_MinimumAngle
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_MinimumAngle
- threshold is floating point value (minimum angle)
\tui_script{filters_ex04.py}
\section filter_taper Taper
Filter 2D mesh elements (faces) according to the taper value:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_Taper
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_Taper
- threshold is floating point value (taper)
\tui_script{filters_ex05.py}
\section filter_skew Skew
Filter 2D mesh elements (faces) according to the skew value:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_Skew
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_Skew
- threshold is floating point value (skew)
\tui_script{filters_ex06.py}
\section filter_area Area
Filter 2D mesh elements (faces) according to the area value:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_Area
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_Area
- threshold is floating point value (area)
\tui_script{filters_ex07.py}
\section filter_volume Volume
Filter 3D mesh elements (volumes) according to the volume value:
-- element type is \a smesh.VOLUME
-- functor type is \a smesh.FT_Volume3D
+- element type is \a SMESH.VOLUME
+- functor type is \a SMESH.FT_Volume3D
- threshold is floating point value (volume)
\tui_script{filters_ex08.py}
\section filter_free_borders Free borders
Filter 1D mesh elements (edges) which represent free borders of a mesh:
-- element type is \a smesh.EDGE
-- functor type is \a smesh.FT_FreeBorders
+- element type is \a SMESH.EDGE
+- functor type is \a SMESH.FT_FreeBorders
- threshold value is not required
\tui_script{filters_ex09.py}
Filter 2D mesh elements (faces) consisting of edges belonging to one
element of mesh only:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_FreeEdges
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_FreeEdges
- threshold value is not required
\tui_script{filters_ex10.py}
\section filter_free_nodes Free nodes
Filter free nodes:
-- element type is \a smesh.NODE
-- functor type is \a smesh.FT_FreeNodes
+- element type is \a SMESH.NODE
+- functor type is \a SMESH.FT_FreeNodes
- threshold value is not required
\tui_script{filters_ex11.py}
\section filter_free_faces Free faces
Filter free faces:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_FreeFaces
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_FreeFaces
- threshold value is not required
\tui_script{filters_ex12.py}
\section filter_bare_border_faces Bare border faces
Filter faces with bare borders:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_BareBorderFace
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_BareBorderFace
- threshold value is not required
\tui_script{filters_ex13.py}
\section filter_coplanar_faces Coplanar faces
Filter faces with bare borders:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_CoplanarFaces
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_CoplanarFaces
- threshold value is the face ID
- tolerance is in degrees
\section filter_over_constrained_faces Over-constrained faces
Filter over-constrained faces:
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_OverConstrainedFace
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_OverConstrainedFace
- threshold value is not required
\tui_script{filters_ex15.py}
\section filter_double_elements Double edges, Double faces, Double volumes
filter mesh elements basing on the same set of nodes:
-- element type is either \a smesh.EGDE, \a smesh.FACE or \a smesh.VOLUME
-- functor type is either \a smesh.FT_EqualEdges, \a
- smesh.FT_EqualFaces or \a smesh.FT_EqualVolumes,
+- element type is either \a smesh.EGDE, \a SMESH.FACE or \a SMESH.VOLUME
+- functor type is either \a SMESH.FT_EqualEdges, \a
+ SMESH.FT_EqualFaces or \a SMESH.FT_EqualVolumes,
- threshold value is not required
\tui_script{filters_ex16.py}
\section tui_double_nodes_control Double nodes
filters mesh nodes which are coincident with other nodes (within a given tolerance):
-- element type is \a smesh.NODE
-- functor type is \a smesh.FT_EqualNodes
+- element type is \a SMESH.NODE
+- functor type is \a SMESH.FT_EqualNodes
- threshold value is not required
- default tolerance is 1.0e-7
Filter border 1D mesh elements (edges) according to the specified number of
connections (faces belonging the border edges)
-- element type is \a smesh.EDGE
-- functor type is \a smesh.FT_MultiConnection
+- element type is \a SMESH.EDGE
+- functor type is \a SMESH.FT_MultiConnection
- threshold is integer value (number of connections)
\tui_script{filters_ex18.py}
Filter 2D mesh elements (faces) which consist of edges belonging
to the specified number of mesh elements
-- element type is \a smesh.FACE
-- functor type is \a smesh.FT_MultiConnection2D
+- element type is \a SMESH.FACE
+- functor type is \a SMESH.FT_MultiConnection2D
- threshold is integer value (number of connections)
\tui_script{filters_ex19.py}
\section filter_length Length
Filter 1D mesh elements (edges) according to the edge length value:
-- element type should be \a smesh.EDGE
-- functor type should be \a smesh.FT_Length
+- element type should be \a SMESH.EDGE
+- functor type should be \a SMESH.FT_Length
- threshold is floating point value (length)
\tui_script{filters_ex20.py}
Filter 2D mesh elements (faces) corresponding to the maximum length.
value of its edges:
-- element type should be \a smesh.FACE
-- functor type should be \a smesh.FT_Length2D
+- element type should be \a SMESH.FACE
+- functor type should be \a SMESH.FT_Length2D
- threshold is floating point value (edge length)
\tui_script{filters_ex21.py}
Filter 2D mesh elements (faces) corresponding to the maximum length
value of its edges and diagonals:
-- element type should be \a smesh.FACE
-- functor type should be \a smesh.FT_MaxElementLength2D
+- element type should be \a SMESH.FACE
+- functor type should be \a SMESH.FT_MaxElementLength2D
- threshold is floating point value (edge/diagonal length)
\tui_script{filters_ex22.py}
Filter 3D mesh elements (volumes) corresponding to the maximum length
value of its edges and diagonals:
-- element type should be \a smesh.VOLUME
-- functor type should be \a smesh.FT_MaxElementLength3D
+- element type should be \a SMESH.VOLUME
+- functor type should be \a SMESH.FT_MaxElementLength3D
- threshold is floating point value (edge/diagonal length)
\tui_script{filters_ex23.py}
\section filter_bare_border_volumes Bare border volumes
Filter 3D mesh elements with bare borders:
-- element type is \a smesh.VOLUME
-- functor type is \a smesh.FT_BareBorderVolume
+- element type is \a SMESH.VOLUME
+- functor type is \a SMESH.FT_BareBorderVolume
- threshold value is not required
\tui_script{filters_ex24.py}
\section filter_over_constrained_volumes Over-constrained volumes
Filter over-constrained volumes:
-- element type is \a smesh.VOLUME
-- functor type is \a smesh.FT_OverConstrainedVolume
+- element type is \a SMESH.VOLUME
+- functor type is \a SMESH.FT_OverConstrainedVolume
- threshold value is not required
\tui_script{filters_ex25.py}
Filter mesh entities (nodes or elements) which all nodes lie on the
shape defined by threshold value:
-- element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
-- functor type should be \a smesh.FT_BelongToGeom
+- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
+- functor type should be \a SMESH.FT_BelongToGeom
- threshold is geometrical object
\tui_script{filters_ex26.py}
Filter mesh entities (nodes or elements) at least one node of which lies on the
shape defined by threshold value:
-- element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
-- functor type should be \a smesh.FT_LyingOnGeom
+- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
+- functor type should be \a SMESH.FT_LyingOnGeom
- threshold is geometrical object
\tui_script{filters_ex27.py}
Filter mesh entities (nodes or elements) which all nodes belong to the
plane defined by threshold value with the given tolerance:
-- element type can be: \a smesh.NODE, \a smesh.EDGE, \a smesh.FACE
-- functor type should be \a smesh.FT_BelongToPlane
+- element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE
+- functor type should be \a SMESH.FT_BelongToPlane
- threshold is geometrical object (plane)
- default tolerance is 1.0e-7
Filter mesh entities (nodes or elements) which all nodes belong to the
cylindrical face defined by threshold value with the given tolerance:
-- element type can be: \a smesh.NODE, \a smesh.EDGE, \a smesh.FACE
-- functor type should be \a smesh.FT_BelongToCylinder
+- element type can be: \a , \a SMESH.EDGE, \a SMESH.FACE
+- functor type should be \a SMESH.FT_BelongToCylinder
- threshold is geometrical object (cylindrical face)
- default tolerance is 1.0e-7
Filter mesh entities (nodes or elements) which all nodes belong to the
arbitrary surface defined by threshold value with the given tolerance:
-- element type can be: \a smesh.NODE, \a smesh.EDGE, \a smesh.FACE
-- functor type should be \a smesh.FT_BelongToGenSurface
+- element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE
+- functor type should be \a SMESH.FT_BelongToGenSurface
- threshold is geometrical object (arbitrary surface)
- default tolerance is 1.0e-7
Filter mesh entities elements (nodes or elements) according to the
specified identifiers range:
-- element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
-- functor type is \a smesh.FT_RangeOfIds
+- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
+- functor type is \a SMESH.FT_RangeOfIds
- threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78"
\tui_script{filters_ex31.py}
Filter 3D mesh elements (volumes), which are incorrectly oriented from
the point of view of MED convention.
-- element type should be \a smesh.VOLUME
-- functor type is \a smesh.FT_BadOrientedVolume
+- element type should be \a SMESH.VOLUME
+- functor type is \a SMESH.FT_BadOrientedVolume
- threshold is not required
\tui_script{filters_ex32.py}
\section filter_linear_or_quadratic Linear / quadratic
Filter linear / quadratic mesh elements:
-- element type should be any element type, e.g.: \a smesh.EDGE, \a smesh.FACE, \a smesh.VOLUME
-- functor type is \a smesh.FT_LinearOrQuadratic
+- element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME
+- functor type is \a SMESH.FT_LinearOrQuadratic
- threshold is not required
-- if unary operator is set to smesh.FT_LogicalNOT, the quadratic
+- if unary operator is set to SMESH.FT_LogicalNOT, the quadratic
elements are selected, otherwise (by default) linear elements are selected
\tui_script{filters_ex33.py}
\section filter_group_color Group color
Filter mesh entities, belonging to the group with the color defined by the threshold value.
-- element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
-- functor type is \a smesh.FT_GroupColor
+- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
+- functor type is \a SMESH.FT_GroupColor
- threshold should be of SALOMEDS.Color type
\tui_script{filters_ex34.py}
Filter mesh elements by the geometric type defined with the threshold
value. The list of available geometric types depends on the element
entity type.
-- element type should be any element type, e.g.: \a smesh.EDGE, \a smesh.FACE, \a smesh.VOLUME
-- functor type should be \a smesh.FT_ElemGeomType
+- element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME
+- functor type should be \a SMESH.FT_ElemGeomType
- threshold is of smesh.GeometryType value
\tui_script{filters_ex35.py}