3 \page tui_filters_page Filters usage
5 Filters allow picking only the mesh elements satisfying to a
6 specific condition or a set of conditions. Filters can be used to create
7 or edit mesh groups, remove elements from the mesh object, control
8 mesh quality by different parameters, etc.
10 Several filters can be combined together by using logical operators \a
11 AND and \a OR. In addition, applied filter criterion can be reverted
12 using logical operator \a NOT.
14 Mesh filters use the functionality of mesh quality controls to filter
15 mesh nodes / elements by a specific characteristic (Area, Length, etc).
17 This page provides a short description of the existing mesh filters,
18 describes required parameters and gives simple examples of usage in
21 \sa \ref tui_quality_controls_page
23 \section filter_aspect_ratio Aspect ratio
25 Filter 2D mesh elements (faces) according to the aspect ratio value:
26 - element type should be \a smesh.FACE
27 - functor type should be \a smesh.FT_AspectRatio
28 - threshold is floating point value (aspect ratio)
32 from SMESH_mechanic import *
33 # get faces with aspect ratio > 6.5
34 filter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 6.5)
35 ids = mesh.GetIdsFromFilter(filter)
36 print "Number of faces with aspect ratio > 6.5:", len(ids)
39 \sa \ref tui_aspect_ratio
41 \section filter_aspect_ratio_3d Aspect ratio 3D
43 Filter 3D mesh elements (volumes) according to the aspect ratio value:
44 - element type is \a smesh.VOLUME
45 - functor type is \a smesh.FT_AspectRatio3D
46 - threshold is floating point value (aspect ratio)
49 # create mesh with volumes
50 from SMESH_mechanic import *
51 mesh.Tetrahedron( algo=smesh.NETGEN )
53 # get volumes with aspect ratio < 2.0
54 filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_LessThan, 2.0)
55 ids = mesh.GetIdsFromFilter(filter)
56 print "Number of volumes with aspect ratio < 2.0:", len(ids)
59 \sa \ref tui_aspect_ratio_3d
61 \section filter_warping_angle Warping angle
63 Filter 2D mesh elements (faces) according to the warping angle value:
64 - element type is \a smesh.FACE
65 - functor type is \a smesh.FT_Warping
66 - threshold is floating point value (warping angle)
70 from SMESH_mechanic import *
71 # get faces with warping angle = 2.0e-13 with tolerance 5.0e-14
72 criterion = smesh.GetCriterion(smesh.FACE, smesh.FT_Warping, smesh.FT_EqualTo, 2.0e-13)
73 criterion.Tolerance = 5.0e-14
74 filter = smesh.CreateFilterManager().CreateFilter()
75 filter.SetCriteria([criterion])
76 ids = mesh.GetIdsFromFilter(filter)
77 print "Number of faces with warping angle = 2.0e-13 (tolerance 5.0e-14):", len(ids)
82 \section filter_minimum_angle Minimum angle
84 Filter 2D mesh elements (faces) according to the minimum angle value:
85 - element type is \a smesh.FACE
86 - functor type is \a smesh.FT_MinimumAngle
87 - threshold is floating point value (minimum angle)
91 from SMESH_mechanic import *
92 # get faces with minimum angle > 75
93 filter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle,">", 75)
94 ids = mesh.GetIdsFromFilter(filter)
95 print "Number of faces with minimum angle > 75:", len(ids)
98 \sa \ref tui_minimum_angle
100 \section filter_taper Taper
102 Filter 2D mesh elements (faces) according to the taper value:
103 - element type is \a smesh.FACE
104 - functor type is \a smesh.FT_Taper
105 - threshold is floating point value (taper)
109 from SMESH_mechanic import *
110 # get faces with taper < 1.e-15
111 filter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_LessThan, 1.e-15)
112 ids = mesh.GetIdsFromFilter(filter)
113 print "Number of faces with taper < 1.e-15:", len(ids)
118 \section filter_skew Skew
120 Filter 2D mesh elements (faces) according to the skew value:
121 - element type is \a smesh.FACE
122 - functor type is \a smesh.FT_Skew
123 - threshold is floating point value (skew)
127 from SMESH_mechanic import *
128 # get faces with skew > 50
129 filter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 50)
130 ids = mesh.GetIdsFromFilter(filter)
131 print "Number of faces with skew > 50:", len(ids)
136 \section filter_area Area
138 Filter 2D mesh elements (faces) according to the area value:
139 - element type is \a smesh.FACE
140 - functor type is \a smesh.FT_Area
141 - threshold is floating point value (area)
145 from SMESH_mechanic import *
146 # get faces with area > 60 and < 90
147 criterion1 = smesh.GetCriterion(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 60,\
148 smesh.FT_Undefined, smesh.FT_LogicalAND)
149 criterion2 = smesh.GetCriterion(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 90)
150 filter = smesh.CreateFilterManager().CreateFilter()
151 filter.SetCriteria([criterion1,criterion2])
152 ids = mesh.GetIdsFromFilter(filter)
153 print "Number of faces with area in range (60,90):", len(ids)
158 \section filter_volume Volume
160 Filter 3D mesh elements (volumes) according to the volume value:
161 - element type is \a smesh.VOLUME
162 - functor type is \a smesh.FT_Volume3D
163 - threshold is floating point value (volume)
166 # create mesh with volumes
167 from SMESH_mechanic import *
168 mesh.Tetrahedron( algo=smesh.NETGEN )
170 # get volumes faces with volume > 100
171 filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_MoreThan, 100)
172 ids = mesh.GetIdsFromFilter(filter)
173 print "Number of volumes with volume > 100:", len(ids)
178 \section filter_free_borders Free borders
180 Filter 1D mesh elements (edges) which represent free borders of a mesh:
181 - element type is \a smesh.EDGE
182 - functor type is \a smesh.FT_FreeBorders
183 - threshold value is not required
187 import geompy, smesh, StdMeshers
188 face = geompy.MakeFaceHW(100, 100, 1)
189 geompy.addToStudy( face, "quadrangle" )
190 mesh = smesh.Mesh(face)
191 mesh.Segment().NumberOfSegments(10)
192 mesh.Triangle().MaxElementArea(25)
194 # get all free borders
195 filter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)
196 ids = mesh.GetIdsFromFilter(filter)
197 print "Number of edges on free borders:", len(ids)
200 \sa \ref tui_free_borders
202 \section filter_free_edges Free edges
204 Filter 2D mesh elements (faces) consisting of edges belonging to one
205 element of mesh only:
206 - element type is \a smesh.FACE
207 - functor type is \a smesh.FT_FreeEdges
208 - threshold value is not required
212 import geompy, smesh, StdMeshers
213 face = geompy.MakeFaceHW(100, 100, 1)
214 geompy.addToStudy( face, "quadrangle" )
215 mesh = smesh.Mesh(face)
216 mesh.Segment().NumberOfSegments(10)
217 mesh.Triangle().MaxElementArea(25)
219 # get all faces with free edges
220 filter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeEdges)
221 ids = mesh.GetIdsFromFilter(filter)
222 print "Number of faces with free edges:", len(ids)
225 \sa \ref tui_free_edges
227 \section filter_free_nodes Free nodes
230 - element type is \a smesh.NODE
231 - functor type is \a smesh.FT_FreeNodes
232 - threshold value is not required
236 from SMESH_mechanic import *
240 filter = smesh.GetFilter(smesh.NODE, smesh.FT_FreeNodes)
241 ids = mesh.GetIdsFromFilter(filter)
242 print "Number of free nodes:", len(ids)
245 \sa \ref tui_free_nodes
247 \section filter_free_faces Free faces
250 - element type is \a smesh.FACE
251 - functor type is \a smesh.FT_FreeFaces
252 - threshold value is not required
256 from SMESH_mechanic import *
258 filter = smesh.GetFilter(smesh.FACE, smesh.FT_FreeFaces)
259 ids = mesh.GetIdsFromFilter(filter)
260 print "Number of free faces:", len(ids)
263 \sa \ref tui_free_faces
265 \section filter_bare_border_faces Bare border faces
267 Filter faces with bare borders:
268 - element type is \a smesh.FACE
269 - functor type is \a smesh.FT_BareBorderFace
270 - threshold value is not required
274 from SMESH_mechanic import *
275 # remove some faces to have faces with bare borders
276 mesh.RemoveElements( mesh.GetElementsByType(FACE)[0:5] )
277 # get all faces bare borders
278 filter = smesh.GetFilter(smesh.FACE, smesh.FT_BareBorderFace)
279 ids = mesh.GetIdsFromFilter(filter)
280 print "Faces with bare borders:", ids
283 \sa \ref tui_bare_border_faces
285 \section filter_coplanar_faces Coplanar faces
287 Filter faces with bare borders:
288 - element type is \a smesh.FACE
289 - functor type is \a smesh.FT_CoplanarFaces
290 - threshold value is the face ID
291 - tolerance is in degrees
295 from SMESH_mechanic import *
296 faceID = mesh.GetElementsByType(FACE)[0]
297 # get all faces co-planar to the first face with tolerance 5 degrees
298 filter = smesh.GetFilter(smesh.FACE, smesh.FT_CoplanarFaces,faceID,Tolerance=5.0)
299 ids = mesh.GetIdsFromFilter(filter)
300 print "Number of faces coplanar with the first one:", len(ids)
303 \section filter_over_constrained_faces Over-constrained faces
305 Filter over-constrained faces:
306 - element type is \a smesh.FACE
307 - functor type is \a smesh.FT_OverConstrainedFace
308 - threshold value is not required
312 from SMESH_mechanic import *
313 # get all over-constrained faces
314 filter = smesh.GetFilter(smesh.FACE, smesh.FT_OverConstrainedFace)
315 ids = mesh.GetIdsFromFilter(filter)
316 print "Over-constrained faces:", ids
319 \sa \ref tui_over_constrained_faces
321 \section filter_borders_multiconnection Borders at multi-connection
323 Filter border 1D mesh elements (edges) according to the specified number of
324 connections (faces belonging the border edges)
325 - element type is \a smesh.EDGE
326 - functor type is \a smesh.FT_MultiConnection
327 - threshold is integer value (number of connections)
331 from SMESH_mechanic import *
332 # get border edges with number of connected faces = 5
333 filter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, 5)
334 ids = mesh.GetIdsFromFilter(filter)
335 print "Number of border edges with 5 faces connected:", len(ids)
338 \sa \ref tui_borders_at_multiconnection
340 \section filter_borders_multiconnection_2d Borders at multi-connection 2D
342 Filter 2D mesh elements (faces) which consist of edges belonging
343 to the specified number of mesh elements
344 - element type is \a smesh.FACE
345 - functor type is \a smesh.FT_MultiConnection2D
346 - threshold is integer value (number of connections)
350 from SMESH_mechanic import *
351 # get faces which consist of edges belonging to 2 mesh elements
352 filter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, 2)
353 ids = mesh.GetIdsFromFilter(filter)
354 print "Number of faces consisting of edges belonging to 2 faces:", len(ids)
357 \sa \ref tui_borders_at_multiconnection_2d
359 \section filter_length Length
361 Filter 1D mesh elements (edges) according to the edge length value:
362 - element type should be \a smesh.EDGE
363 - functor type should be \a smesh.FT_Length
364 - threshold is floating point value (length)
368 from SMESH_mechanic import *
369 # get edges with length > 14
370 filter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, 14)
371 ids = mesh.GetIdsFromFilter(filter)
372 print "Number of edges with length > 14:", len(ids)
375 \sa \ref tui_length_1d
377 \section filter_length_2d Length 2D
379 Filter 2D mesh elements (faces) corresponding to the maximum length.
381 - element type should be \a smesh.FACE
382 - functor type should be \a smesh.FT_Length2D
383 - threshold is floating point value (edge length)
387 from SMESH_mechanic import *
388 # get all faces that have edges with length > 14
389 filter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, 14)
390 ids = mesh.GetIdsFromFilter(filter)
391 print "Number of faces with maximum edge length > 14:", len(ids)
394 \sa \ref tui_length_2d
396 \section filter_max_element_length_2d Element Diameter 2D
398 Filter 2D mesh elements (faces) corresponding to the maximum length
399 value of its edges and diagonals:
400 - element type should be \a smesh.FACE
401 - functor type should be \a smesh.FT_MaxElementLength2D
402 - threshold is floating point value (edge/diagonal length)
406 from SMESH_mechanic import *
407 # get all faces that have elements with length > 10
408 filter = smesh.GetFilter(smesh.FACE, smesh.FT_MaxElementLength2D, smesh.FT_MoreThan, 10)
409 ids = mesh.GetIdsFromFilter(filter)
410 print "Number of faces with maximum element length > 10:", len(ids)
413 \sa \ref tui_max_element_length_2d
415 \section filter_max_element_length_3d Element Diameter 3D
417 Filter 3D mesh elements (volumes) corresponding to the maximum length
418 value of its edges and diagonals:
419 - element type should be \a smesh.VOLUME
420 - functor type should be \a smesh.FT_MaxElementLength3D
421 - threshold is floating point value (edge/diagonal length)
424 # create mesh with volumes
425 from SMESH_mechanic import *
426 mesh.Tetrahedron( algo=smesh.NETGEN )
428 # get all volumes that have elements with length > 10
429 filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_MaxElementLength3D, smesh.FT_MoreThan, 10)
430 ids = mesh.GetIdsFromFilter(filter)
431 print "Number of volumes with maximum element length > 10:", len(ids)
434 \sa \ref tui_max_element_length_3d
436 \section filter_bare_border_volumes Bare border volumes
438 Filter 3D mesh elements with bare borders:
439 - element type is \a smesh.VOLUME
440 - functor type is \a smesh.FT_BareBorderVolume
441 - threshold value is not required
445 from SMESH_mechanic import *
448 # remove some volumes to have volumes with bare borders
449 mesh.RemoveElements( mesh.GetElementsByType(VOLUME)[0:5] )
450 # get all volumes with bare borders
451 filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_BareBorderVolume)
452 ids = mesh.GetIdsFromFilter(filter)
453 print "Volumes with bare borders:", ids
456 \sa \ref tui_bare_border_volumes
458 \section filter_over_constrained_volumes Over-constrained volumes
460 Filter over-constrained volumes:
461 - element type is \a smesh.VOLUME
462 - functor type is \a smesh.FT_OverConstrainedVolume
463 - threshold value is not required
467 from SMESH_mechanic import *
470 # get all over-constrained volumes
471 filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_OverConstrainedVolume)
472 ids = mesh.GetIdsFromFilter(filter)
473 print "Over-constrained volumes:", ids
476 \sa \ref tui_over_constrained_faces
478 \section filter_belong_to_geom Belong to Geom
480 Filter mesh entities (nodes or elements) which all nodes lie on the
481 shape defined by threshold value:
482 - element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
483 - functor type should be \a smesh.FT_BelongToGeom
484 - threshold is geometrical object
488 from SMESH_mechanic import *
489 # get all faces which nodes lie on the face sub_face3
490 filter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToGeom, sub_face3)
491 ids = mesh.GetIdsFromFilter(filter)
492 print "Number of faces which nodes lie on sub_face3:", len(ids)
495 \section filter_lying_on_geom Lying on Geom
497 Filter mesh entities (nodes or elements) at least one node of which lies on the
498 shape defined by threshold value:
499 - element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
500 - functor type should be \a smesh.FT_LyingOnGeom
501 - threshold is geometrical object
505 from SMESH_mechanic import *
506 # get all faces at least one node of each lies on the face sub_face3
507 filter = smesh.GetFilter(smesh.FACE, smesh.FT_LyingOnGeom, sub_face3)
508 ids = mesh.GetIdsFromFilter(filter)
509 print "Number of faces at least one node of each lies on sub_face3:", len(ids)
512 \section filter_belong_to_plane Belong to Plane
514 Filter mesh entities (nodes or elements) which all nodes belong to the
515 plane defined by threshold value with the given tolerance:
516 - element type can be: \a smesh.NODE, \a smesh.EDGE, \a smesh.FACE
517 - functor type should be \a smesh.FT_BelongToPlane
518 - threshold is geometrical object (plane)
519 - default tolerance is 1.0e-7
523 from SMESH_mechanic import *
526 plane_1 = geompy.MakePlane(p3,seg1,2000)
527 geompy.addToStudy(plane_1, "plane_1")
528 # get all nodes which lie on the plane \a plane_1
529 filter = smesh.GetFilter(smesh.NODE, smesh.FT_BelongToPlane, plane_1)
530 ids = mesh.GetIdsFromFilter(filter)
531 print "Number of nodes which lie on the plane plane_1:", len(ids)
534 \section filter_belong_to_cylinder Belong to Cylinder
536 Filter mesh entities (nodes or elements) which all nodes belong to the
537 cylindrical face defined by threshold value with the given tolerance:
538 - element type can be: \a smesh.NODE, \a smesh.EDGE, \a smesh.FACE
539 - functor type should be \a smesh.FT_BelongToCylinder
540 - threshold is geometrical object (cylindrical face)
541 - default tolerance is 1.0e-7
545 from SMESH_mechanic import *
546 # get all faces which lie on the cylindrical face \a sub_face1
547 filter = smesh.GetFilter(smesh.FACE, smesh.FT_BelongToCylinder, sub_face1)
548 ids = mesh.GetIdsFromFilter(filter)
549 print "Number of faces which lie on the cylindrical surface sub_face1:", len(ids)
552 \section filter_belong_to_surface Belong to Surface
554 Filter mesh entities (nodes or elements) which all nodes belong to the
555 arbitrary surface defined by threshold value with the given tolerance:
556 - element type can be: \a smesh.NODE, \a smesh.EDGE, \a smesh.FACE
557 - functor type should be \a smesh.FT_BelongToGenSurface
558 - threshold is geometrical object (arbitrary surface)
559 - default tolerance is 1.0e-7
563 from SMESH_mechanic import *
565 spline_1 = geompy.MakeInterpol([p4,p6,p3,p1])
566 surface_1 = geompy.MakePrismVecH( spline_1, vz, 70.0 )
567 geompy.addToStudy(surface_1, "surface_1")
568 # get all nodes which lie on the surface \a surface_1
569 filter = smesh.GetFilter(smesh.NODE, smesh.FT_BelongToGenSurface, surface_1)
570 ids = mesh.GetIdsFromFilter(filter)
571 print "Number of nodes which lie on the surface surface_1:", len(ids)
574 \section filter_range_of_ids Range of IDs
576 Filter mesh entities elements (nodes or elements) according to the
577 specified identifiers range:
578 - element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
579 - functor type is \a smesh.FT_RangeOfIds
580 - threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78"
584 from SMESH_mechanic import *
585 # get nodes with identifiers [5-10] and [15-30]
586 criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="5-10",\
587 BinaryOp=smesh.FT_LogicalOR)
588 criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="15-30")
589 filter = smesh.CreateFilterManager().CreateFilter()
590 filter.SetCriteria([criterion1,criterion2])
591 ids = mesh.GetIdsFromFilter(filter)
592 print "Number of nodes in ranges [5-10] and [15-30]:", len(ids)
595 \section filter_bad_oriented_volume Badly oriented volume
597 Filter 3D mesh elements (volumes), which are incorrectly oriented from
598 the point of view of MED convention.
599 - element type should be \a smesh.VOLUME
600 - functor type is \a smesh.FT_BadOrientedVolume
601 - threshold is not required
604 # create mesh with volumes
605 from SMESH_mechanic import *
606 mesh.Tetrahedron( algo=smesh.NETGEN )
608 # get all badly oriented volumes
609 filter = smesh.GetFilter(smesh.VOLUME, smesh.FT_BadOrientedVolume)
610 ids = mesh.GetIdsFromFilter(filter)
611 print "Number of badly oriented volumes:", len(ids)
614 \section filter_linear_or_quadratic Linear / quadratic
616 Filter linear / quadratic mesh elements:
617 - element type should be any element type, e.g.: \a smesh.EDGE, \a smesh.FACE, \a smesh.VOLUME
618 - functor type is \a smesh.FT_LinearOrQuadratic
619 - threshold is not required
620 - if unary operator is set to smesh.FT_LogicalNOT, the quadratic
621 elements are selected, otherwise (by default) linear elements are selected
625 from SMESH_mechanic import *
626 # get number of linear and quadratic edges
627 filter_linear = smesh.GetFilter(smesh.EDGE, smesh.FT_LinearOrQuadratic)
628 filter_quadratic = smesh.GetFilter(smesh.EDGE, smesh.FT_LinearOrQuadratic, smesh.FT_LogicalNOT)
629 ids_linear = mesh.GetIdsFromFilter(filter_linear)
630 ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
631 print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
632 # convert mesh to quadratic
633 print "Convert to quadratic..."
634 mesh.ConvertToQuadratic(True)
635 # get number of linear and quadratic edges
636 ids_linear = mesh.GetIdsFromFilter(filter_linear)
637 ids_quadratic = mesh.GetIdsFromFilter(filter_quadratic)
638 print "Number of linear edges:", len(ids_linear), "; number of quadratic edges:", len(ids_quadratic)
641 \section filter_group_color Group color
643 Filter mesh entities, belonging to the group with the color defined by the threshold value.
644 - element type can be any entity type, from \a smesh.NODE to \a smesh.VOLUME
645 - functor type is \a smesh.FT_GroupColor
646 - threshold should be of SALOMEDS.Color type
650 from SMESH_mechanic import *
651 # create group of edges
652 all_edges = mesh.GetElementsByType(smesh.EDGE)
653 grp = mesh.MakeGroupByIds("edges group", smesh.EDGE, all_edges[:len(all_edges)/4])
655 c = SALOMEDS.Color(0.1, 0.5, 1.0)
657 # get number of the edges not belonging to the group with the given color
658 filter = smesh.GetFilter(smesh.EDGE, smesh.FT_GroupColor, c, smesh.FT_LogicalNOT)
659 ids = mesh.GetIdsFromFilter(filter)
660 print "Number of edges not beloging to the group with color (0.1, 0.5, 1.0):", len(ids)
663 \section filter_geom_type Geometry type
665 Filter mesh elements by the geometric type defined with the threshold
666 value. The list of available geometric types depends on the element
668 - element type should be any element type, e.g.: \a smesh.EDGE, \a smesh.FACE, \a smesh.VOLUME
669 - functor type should be \a smesh.FT_ElemGeomType
670 - threshold is of smesh.GeometryType value
673 # create mesh with volumes
674 from SMESH_mechanic import *
675 mesh.Tetrahedron( algo=smesh.NETGEN )
677 # get all triangles, quadrangles, tetrahedrons, pyramids
678 filter_tri = smesh.GetFilter(smesh.FACE, smesh.FT_ElemGeomType, smesh.Geom_TRIANGLE)
679 filter_qua = smesh.GetFilter(smesh.FACE, smesh.FT_ElemGeomType, smesh.Geom_QUADRANGLE)
680 filter_tet = smesh.GetFilter(smesh.VOLUME, smesh.FT_ElemGeomType, smesh.Geom_TETRA)
681 filter_pyr = smesh.GetFilter(smesh.VOLUME, smesh.FT_ElemGeomType, smesh.Geom_PYRAMID)
682 ids_tri = mesh.GetIdsFromFilter(filter_tri)
683 ids_qua = mesh.GetIdsFromFilter(filter_qua)
684 ids_tet = mesh.GetIdsFromFilter(filter_tet)
685 ids_pyr = mesh.GetIdsFromFilter(filter_pyr)
686 print "Number of triangles:", len(ids_tri)
687 print "Number of quadrangles:", len(ids_qua)
688 print "Number of tetrahedrons:", len(ids_tet)
689 print "Number of pyramids:", len(ids_pyr)