7 .. contents:: `Table of contents`
10 Filters allow picking only the mesh elements satisfying to a
11 specific condition or a set of conditions. Filters can be used to create
12 or edit mesh groups, remove elements from the mesh, control
13 mesh quality by different parameters, etc.
15 Several filtering criteria can be combined together by using logical
16 operators *AND* and *OR*. In addition, a filtering criterion can
17 be reverted using logical operator *NOT*.
19 Mesh filters can use the functionality of mesh quality controls to filter
20 mesh nodes / elements by a specific characteristic (Area, Length, etc).
22 This page provides a short description of the existing mesh filters,
23 describes required parameters and gives simple examples of usage in
26 **See also:** :ref:`tui_quality_controls_page`
28 .. _filter_aspect_ratio:
33 filters 2D mesh elements (faces) according to the aspect ratio value:
35 * element type should be *SMESH.FACE*
36 * functor type should be *SMESH.FT_AspectRatio*
37 * threshold is floating point value (aspect ratio)
43 .. literalinclude:: ../../../examples/filters_ex01.py
47 :download:`../../../examples/filters_ex01.py`
49 **See also:** :ref:`tui_aspect_ratio`
51 .. _filter_aspect_ratio_3d:
56 filters 3D mesh elements (volumes) according to the aspect ratio value:
58 * element type is *SMESH.VOLUME*
59 * functor type is *SMESH.FT_AspectRatio3D*
60 * threshold is floating point value (aspect ratio)
66 .. literalinclude:: ../../../examples/filters_ex02.py
70 :download:`../../../examples/filters_ex02.py`
72 **See also:** :ref:`tui_aspect_ratio_3d`
74 .. _filter_warping_angle:
79 filters 2D mesh elements (faces) according to the warping angle value:
81 * element type is *SMESH.FACE*
82 * functor type is *SMESH.FT_Warping*
83 * threshold is floating point value (warping angle)
89 .. literalinclude:: ../../../examples/filters_ex03.py
93 :download:`../../../examples/filters_ex03.py`
95 **See also:** :ref:`tui_warping`
97 .. _filter_minimum_angle:
102 filters 2D mesh elements (faces) according to the minimum angle value:
104 * element type is *SMESH.FACE*
105 * functor type is *SMESH.FT_MinimumAngle*
106 * threshold is floating point value (minimum angle)
112 .. literalinclude:: ../../../examples/filters_ex04.py
116 :download:`../../../examples/filters_ex04.py`
118 **See also:** :ref:`tui_minimum_angle`
125 filters 2D mesh elements (faces) according to the taper value:
127 * element type is *SMESH.FACE*
128 * functor type is *SMESH.FT_Taper*
129 * threshold is floating point value (taper)
135 .. literalinclude:: ../../../examples/filters_ex05.py
139 :download:`../../../examples/filters_ex05.py`
141 **See also:** :ref:`tui_taper`
148 filters 2D mesh elements (faces) according to the skew value:
150 * element type is *SMESH.FACE*
151 * functor type is *SMESH.FT_Skew*
152 * threshold is floating point value (skew)
158 .. literalinclude:: ../../../examples/filters_ex06.py
162 :download:`../../../examples/filters_ex06.py`
164 **See also:** :ref:`tui_skew`
171 filters 2D mesh elements (faces) according to the area value:
173 * element type is *SMESH.FACE*
174 * functor type is *SMESH.FT_Area*
175 * threshold is floating point value (area)
181 .. literalinclude:: ../../../examples/filters_ex07.py
185 :download:`../../../examples/filters_ex07.py`
187 **See also:** :ref:`tui_area`
194 filters 3D mesh elements (volumes) according to the volume value:
196 * element type is *SMESH.VOLUME*
197 * functor type is *SMESH.FT_Volume3D*
198 * threshold is floating point value (volume)
204 .. literalinclude:: ../../../examples/filters_ex08.py
208 :download:`../../../examples/filters_ex08.py`
210 **See also:** :ref:`tui_volume`
212 .. _filter_free_borders:
217 filters 1D mesh elements (edges) which represent free borders of a mesh:
219 * element type is *SMESH.EDGE*
220 * functor type is *SMESH.FT_FreeBorders*
221 * threshold value is not required
223 \tui_script{filters_ex09.py}
228 .. literalinclude:: ../../../examples/filters_ex09.py
232 :download:`../../../examples/filters_ex09.py`
234 **See also:** :ref:`tui_free_borders`
236 .. _filter_free_edges:
241 filters 2D mesh elements (faces) having edges (i.e. links between
242 nodes, not mesh segments) belonging to one face of mesh only:
244 * element type is *SMESH.FACE*
245 * functor type is *SMESH.FT_FreeEdges*
246 * threshold value is not required
252 .. literalinclude:: ../../../examples/filters_ex10.py
256 :download:`../../../examples/filters_ex10.py`
258 **See also:** :ref:`tui_free_edges`
260 .. _filter_free_nodes:
267 * element type is *SMESH.NODE*
268 * functor type is *SMESH.FT_FreeNodes*
269 * threshold value is not required
275 .. literalinclude:: ../../../examples/filters_ex11.py
279 :download:`../../../examples/filters_ex11.py`
281 **See also:** :ref:`tui_free_nodes`
283 .. _filter_free_faces:
290 * element type is *SMESH.FACE*
291 * functor type is *SMESH.FT_FreeFaces*
292 * threshold value is not required
298 .. literalinclude:: ../../../examples/filters_ex12.py
302 :download:`../../../examples/filters_ex12.py`
304 **See also:** :ref:`tui_free_faces`
306 .. _filter_bare_border_faces:
311 filters faces with bare borders:
313 * element type is *SMESH.FACE*
314 * functor type is *SMESH.FT_BareBorderFace*
315 * threshold value is not required
321 .. literalinclude:: ../../../examples/filters_ex13.py
325 :download:`../../../examples/filters_ex13.py`
327 **See also:** :ref:`tui_bare_border_faces`
329 .. _filter_coplanar_faces:
334 filters coplanar faces:
336 * element type is *SMESH.FACE*
337 * functor type is *SMESH.FT_CoplanarFaces*
338 * threshold value is the face ID
339 * tolerance is in degrees
345 .. literalinclude:: ../../../examples/filters_ex14.py
349 :download:`../../../examples/filters_ex14.py`
351 .. _filter_over_constrained_faces:
353 Over-constrained faces
354 ======================
356 filters over-constrained faces:
358 * element type is *SMESH.FACE*
359 * functor type is *SMESH.FT_OverConstrainedFace*
360 * threshold value is not required
366 .. literalinclude:: ../../../examples/filters_ex15.py
370 :download:`../../../examples/filters_ex15.py`
372 **See also:** :ref:`tui_over_constrained_faces`
374 .. _filter_double_elements:
376 Double edges, Double faces, Double volumes
377 ##########################################
379 filters mesh elements basing on the same set of nodes:
381 * element type is either *SMESH.EGDE*, *SMESH.FACE* or *SMESH.VOLUME*
382 * functor type is either *SMESH.FT_EqualEdges*, *SMESH.FT_EqualFaces* or *SMESH.FT_EqualVolumes*,
383 * threshold value is not required
389 .. literalinclude:: ../../../examples/filters_ex16.py
393 :download:`../../../examples/filters_ex16.py`
395 .. _tui_double_nodes_control:
400 filters mesh nodes which are coincident with other nodes (within a given tolerance):
402 * element type is *SMESH.NODE*
403 * functor type is *SMESH.FT_EqualNodes*
404 * threshold value is not required
405 * default tolerance is 1.0e-7
411 .. literalinclude:: ../../../examples/filters_ex17.py
415 :download:`../../../examples/filters_ex17.py`
417 .. _filter_node_nb_conn:
419 Node connectivity number
420 ========================
422 filters nodes according to a number of elements of highest dimension connected to a node:
424 * element type should be *SMESH.NODE*
425 * functor type should be *SMESH.FT_NodeConnectivityNumber*
426 * threshold is an integer value (number of elements)
428 .. _filters_node_nb_conn.py:
430 ``filters_node_nb_conn.py``
432 .. literalinclude:: ../../../examples/filters_node_nb_conn.py
436 :download:`../../../examples/filters_node_nb_conn.py`
438 .. _filter_borders_multiconnection:
440 Borders at multi-connection
441 ===========================
443 filters 1D mesh elements (segments) according to the specified number of
444 connections (faces and volumes on whose border the segment lies):
446 * element type is *SMESH.EDGE*
447 * functor type is *SMESH.FT_MultiConnection*
448 * threshold is integer value (number of connections)
454 .. literalinclude:: ../../../examples/filters_ex18.py
458 :download:`../../../examples/filters_ex18.py`
460 **See also:** :ref:`tui_borders_at_multiconnection`
462 .. _filter_borders_multiconnection_2d:
464 Borders at multi-connection 2D
465 ==============================
467 filters 2D mesh elements (faces) with the specified maximal number of
468 faces connected to a border (link between nodes, not mesh segment):
470 * element type is *SMESH.FACE*
471 * functor type is *SMESH.FT_MultiConnection2D*
472 * threshold is integer value (number of connections)
478 .. literalinclude:: ../../../examples/filters_ex19.py
482 :download:`../../../examples/filters_ex19.py`
484 **See also:** :ref:`tui_borders_at_multiconnection_2d`
491 filters 1D mesh elements (edges) according to the edge length value:
493 * element type should be *SMESH.EDGE*
494 * functor type should be *SMESH.FT_Length*
495 * threshold is floating point value (length)
501 .. literalinclude:: ../../../examples/filters_ex20.py
505 :download:`../../../examples/filters_ex20.py`
507 **See also:** :ref:`tui_length_1d`
509 .. _filter_length_2d:
514 filters 2D mesh elements (faces) according to the maximum length of its
515 edges (links between nodes):
517 * element type should be *SMESH.FACE*
518 * functor type should be *SMESH.FT_Length2D*
519 * threshold is floating point value (edge length)
525 .. literalinclude:: ../../../examples/filters_ex21.py
529 :download:`../../../examples/filters_ex21.py`
531 **See also:** :ref:`tui_length_2d`
533 .. _filter_max_element_length_2d:
538 filters 2D mesh elements (faces) according to the maximum length
539 of its edges and diagonals:
541 * element type should be *SMESH.FACE*
542 * functor type should be *SMESH.FT_MaxElementLength2D*
543 * threshold is floating point value (length)
549 .. literalinclude:: ../../../examples/filters_ex22.py
553 :download:`../../../examples/filters_ex22.py`
555 **See also:** :ref:`tui_max_element_length_2d`
557 .. _filter_max_element_length_3d:
562 filters 3D mesh elements (volumes) according to the maximum length
563 of its edges and diagonals:
565 * element type should be *SMESH.VOLUME*
566 * functor type should be *SMESH.FT_MaxElementLength3D*
567 * threshold is floating point value (edge/diagonal length)
573 .. literalinclude:: ../../../examples/filters_ex23.py
577 :download:`../../../examples/filters_ex23.py`
579 **See also:** :ref:`tui_max_element_length_3d`
581 .. _filter_bare_border_volumes:
586 filters 3D mesh elements with bare borders, i.e. having a facet not
587 shared with other volumes and without a face on it:
589 * element type is *SMESH.VOLUME*
590 * functor type is *SMESH.FT_BareBorderVolume*
591 * threshold value is not required
597 .. literalinclude:: ../../../examples/filters_ex24.py
601 :download:`../../../examples/filters_ex24.py`
603 **See also:** :ref:`tui_bare_border_volumes`
605 .. _filter_over_constrained_volumes:
607 Over-constrained volumes
608 ========================
610 filters over-constrained volumes, whose all nodes are on the mesh boundary:
612 * element type is *SMESH.VOLUME*
613 * functor type is *SMESH.FT_OverConstrainedVolume*
614 * threshold value is not required
620 .. literalinclude:: ../../../examples/filters_ex25.py
624 :download:`../../../examples/filters_ex25.py`
626 **See also:** :ref:`tui_over_constrained_faces`
628 .. _filter_belong_to_group:
633 filters mesh entities (nodes or elements) included in a mesh group
634 defined by threshold value:
636 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
637 * functor type should be *SMESH.FT_BelongToMeshGroup*
638 * threshold is mesh group object
640 .. _filters_belong2group.py:
642 ``filters_belong2group.py``
644 .. literalinclude:: ../../../examples/filters_belong2group.py
648 :download:`../../../examples/filters_belong2group.py`
650 .. _filter_belong_to_geom:
655 filters mesh entities (nodes or elements) which all nodes lie on the
656 shape defined by threshold value:
658 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
659 * functor type should be *SMESH.FT_BelongToGeom*
660 * threshold is geometrical object
661 * tolerance is a distance between a node and the geometrical object; it is used if an node is not associated to any geometry.
667 .. literalinclude:: ../../../examples/filters_ex26.py
671 :download:`../../../examples/filters_ex26.py`
673 .. _filter_lying_on_geom:
678 filters mesh entities (nodes or elements) at least one node of which lies on the
679 shape defined by threshold value:
681 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
682 * functor type should be *SMESH.FT_LyingOnGeom*
683 * threshold is geometrical object
684 * tolerance is a distance between a node and the geometrical object;
686 it is used if an node is not associated to any geometry.
692 .. literalinclude:: ../../../examples/filters_ex27.py
696 :download:`../../../examples/filters_ex27.py`
698 .. _filter_belong_to_plane:
703 filters mesh entities (nodes or elements) which all nodes belong to the
704 plane defined by threshold value with the given tolerance:
706 * element type can be any except *SMESH.VOLUME*
707 * functor type should be *SMESH.FT_BelongToPlane*
708 * threshold is geometrical object (plane)
709 * default tolerance is 1.0e-7
715 .. literalinclude:: ../../../examples/filters_ex28.py
719 :download:`../../../examples/filters_ex28.py`
721 .. _filter_belong_to_cylinder:
726 filters mesh entities (nodes or elements) which all nodes belong to the
727 cylindrical face defined by threshold value with the given tolerance:
729 * element type can be any except *SMESH.VOLUME*
730 * functor type should be *SMESH.FT_BelongToCylinder*
731 * threshold is geometrical object (cylindrical face)
732 * default tolerance is 1.0e-7
738 .. literalinclude:: ../../../examples/filters_ex29.py
742 :download:`../../../examples/filters_ex29.py`
744 .. _filter_belong_to_surface:
749 filters mesh entities (nodes or elements) which all nodes belong to the
750 arbitrary surface defined by threshold value with the given tolerance:
752 * element type can be any except *SMESH.VOLUME*
753 * functor type should be *SMESH.FT_BelongToGenSurface*
754 * threshold is geometrical object (arbitrary surface)
755 * default tolerance is 1.0e-7
761 .. literalinclude:: ../../../examples/filters_ex30.py
765 :download:`../../../examples/filters_ex30.py`
767 .. _filter_range_of_ids:
772 filters mesh entities elements (nodes or elements) according to the
773 specified identifiers range:
775 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
776 * functor type is *SMESH.FT_RangeOfIds*
777 * threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78"
783 .. literalinclude:: ../../../examples/filters_ex31.py
787 :download:`../../../examples/filters_ex31.py`
789 .. _filter_bad_oriented_volume:
791 Badly oriented volume
792 =====================
794 filters 3D mesh elements (volumes), which are incorrectly oriented from
795 the point of view of MED convention.
797 * element type should be *SMESH.VOLUME*
798 * functor type is *SMESH.FT_BadOrientedVolume*
799 * threshold is not required
805 .. literalinclude:: ../../../examples/filters_ex32.py
809 :download:`../../../examples/filters_ex32.py`
811 .. _filter_linear_or_quadratic:
816 filters linear / quadratic mesh elements:
818 * element type should be either *SMESH.EDGE*, *SMESH.FACE* or *SMESH.VOLUME*
819 * functor type is *SMESH.FT_LinearOrQuadratic*
820 * threshold is not required
821 * if unary operator is set to SMESH.FT_LogicalNOT, the quadratic elements are selected, otherwise (by default) linear elements are selected
827 .. literalinclude:: ../../../examples/filters_ex33.py
831 :download:`../../../examples/filters_ex33.py`
833 .. _filter_group_color:
838 filters mesh entities, belonging to the group with the color defined by the threshold value.
840 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
841 * functor type is *SMESH.FT_GroupColor*
842 * threshold should be of SALOMEDS.Color type
848 .. literalinclude:: ../../../examples/filters_ex34.py
852 :download:`../../../examples/filters_ex34.py`
854 .. _filter_geom_type:
859 filters mesh elements by the geometric type defined with the threshold
860 value. The list of available geometric types depends on the element
863 * element type can be any, e.g.: *SMESH.EDGE*, *SMESH.FACE*, *SMESH.VOLUME*, etc.
864 * functor type should be *SMESH.FT_ElemGeomType*
865 * threshold is either of smesh.GeometryType values. Type *SMESH.GeometryType._items* in the Python Console to see all geometric types.
871 .. literalinclude:: ../../../examples/filters_ex35.py
875 :download:`../../../examples/filters_ex35.py`
877 .. _filter_entity_type:
882 filters mesh elements by the geometric type and number of nodes.
884 * element type can be any, e.g.: *SMESH.EDGE*, *SMESH.FACE*, *SMESH.VOLUME*, etc.
885 * functor type should be *SMESH.FT_EntityType*
886 * threshold is either of SMESH.EntityType values. Type *SMESH.EntityType._items* in the Python Console to see all entity types.
892 .. literalinclude:: ../../../examples/filters_ex37.py
896 :download:`../../../examples/filters_ex37.py`
898 .. _filter_ball_diam:
903 filters ball elements by diameter.
905 * element type should be *SMESH.BALL*
906 * functor type should be *SMESH.FT_BallDiameter*
907 * threshold is floating point value (ball diameter)
913 .. literalinclude:: ../../../examples/filters_ex38.py
917 :download:`../../../examples/filters_ex38.py`
924 filters elements of a specified domain.
926 * element type can be any, e.g.: *SMESH.EDGE*, *SMESH.FACE*, *SMESH.VOLUME*, etc.
927 * functor type should be *SMESH.FT_ConnectedElements*
928 * threshold is either (1) node ID or (2) geometrical vertex or (3) 3 coordinates of a point.
934 .. literalinclude:: ../../../examples/filters_ex39.py
938 :download:`../../../examples/filters_ex39.py`
940 .. _combining_filters:
942 How to combine several criteria into a filter?
943 ==============================================
945 Several criteria can be combined into a filter.
953 .. literalinclude:: ../../../examples/filters_ex36.py
957 :download:`../../../examples/filters_ex36.py`