Salome HOME
Precise doc on sub-mesh priority
[modules/smesh.git] / doc / salome / gui / SMESH / input / tui_filters.rst
1 .. _tui_filters_page:
2
3 *************
4 Filters usage
5 *************
6
7 Filters allow picking only the mesh elements satisfying to a
8 specific condition or a set of conditions. Filters can be used to create
9 or edit mesh groups, remove elements from the mesh, control
10 mesh quality by different parameters, etc.
11
12 Several filtering criteria can be combined together by using logical
13 operators *AND* and *OR*. In addition, a filtering criterion can
14 be reverted using logical operator *NOT*.
15
16 Mesh filters can use the functionality of mesh quality controls to filter
17 mesh nodes / elements by a specific characteristic (Area, Length, etc).
18
19 This page provides a short description of the existing mesh filters,
20 describes required parameters and gives simple examples of usage in
21 Python scripts.
22
23 **See also:** :ref:`tui_quality_controls_page`
24
25 .. contents:: `Table of contents`
26
27
28 .. _filter_aspect_ratio:
29
30 Aspect ratio
31 ============
32
33 filters 2D mesh elements (faces) according to the aspect ratio value:
34
35 * element type should be *SMESH.FACE*
36 * functor type should be *SMESH.FT_AspectRatio*
37 * threshold is floating point value (aspect ratio)
38
39 .. literalinclude:: ../../../examples/filters_ex01.py
40     :language: python
41
42 :download:`Download this script <../../../examples/filters_ex01.py>`
43
44 **See also:** :ref:`tui_aspect_ratio`
45
46 .. _filter_aspect_ratio_3d:
47
48 Aspect ratio 3D
49 ===============
50
51 filters 3D mesh elements (volumes) according to the aspect ratio value:
52
53 * element type is *SMESH.VOLUME*
54 * functor type is *SMESH.FT_AspectRatio3D*
55 * threshold is floating point value (aspect ratio)
56
57 .. literalinclude:: ../../../examples/filters_ex02.py
58     :language: python
59
60 :download:`Download this script <../../../examples/filters_ex02.py>`
61
62 **See also:** :ref:`tui_aspect_ratio_3d`
63
64 .. _filter_warping_angle:
65
66 Warping angle
67 =============
68
69 filters 2D mesh elements (faces) according to the warping angle value:
70
71 * element type is *SMESH.FACE*
72 * functor type is *SMESH.FT_Warping*
73 * threshold is floating point value (warping angle)
74
75 .. literalinclude:: ../../../examples/filters_ex03.py
76     :language: python
77
78 :download:`Download this script <../../../examples/filters_ex03.py>`
79
80 **See also:** :ref:`tui_warping`
81
82 .. _filter_minimum_angle:
83
84 Minimum angle
85 =============
86
87 filters 2D mesh elements (faces) according to the minimum angle value:
88
89 * element type is *SMESH.FACE*
90 * functor type is *SMESH.FT_MinimumAngle*
91 * threshold is floating point value (minimum angle)
92
93 .. literalinclude:: ../../../examples/filters_ex04.py
94     :language: python
95
96 :download:`Download this script <../../../examples/filters_ex04.py>`
97
98 **See also:** :ref:`tui_minimum_angle`
99
100 .. _filter_taper: 
101
102 Taper
103 =====
104
105 filters 2D mesh elements (faces) according to the taper value:
106
107 * element type is *SMESH.FACE*
108 * functor type is *SMESH.FT_Taper*
109 * threshold is floating point value (taper)
110
111 .. literalinclude:: ../../../examples/filters_ex05.py
112     :language: python
113
114 :download:`Download this script <../../../examples/filters_ex05.py>`
115
116 **See also:** :ref:`tui_taper`
117
118 .. _filter_skew: 
119
120 Skew
121 ====
122
123 filters 2D mesh elements (faces) according to the skew value:
124
125 * element type is *SMESH.FACE*
126 * functor type is *SMESH.FT_Skew*
127 * threshold is floating point value (skew)
128
129 .. literalinclude:: ../../../examples/filters_ex06.py
130     :language: python
131
132 :download:`Download this script <../../../examples/filters_ex06.py>`
133
134 **See also:** :ref:`tui_skew`
135
136 .. _filter_area: 
137
138 Area
139 ====
140
141 filters 2D mesh elements (faces) according to the area value:
142
143 * element type is *SMESH.FACE*
144 * functor type is *SMESH.FT_Area*
145 * threshold is floating point value (area)
146
147 .. literalinclude:: ../../../examples/filters_ex07.py
148     :language: python
149
150 :download:`Download this script <../../../examples/filters_ex07.py>`
151
152 **See also:** :ref:`tui_area`
153
154 .. _filter_volume: 
155
156 Volume
157 ======
158
159 filters 3D mesh elements (volumes) according to the volume value:
160
161 * element type is *SMESH.VOLUME*
162 * functor type is *SMESH.FT_Volume3D*
163 * threshold is floating point value (volume)
164
165 .. literalinclude:: ../../../examples/filters_ex08.py
166     :language: python
167
168 :download:`Download this script <../../../examples/filters_ex08.py>`
169
170 **See also:** :ref:`tui_volume`
171
172 .. _filter_free_borders:
173
174 Free borders
175 ============
176
177 filters 1D mesh elements (edges) which represent free borders of a mesh:
178
179 * element type is *SMESH.EDGE*
180 * functor type is *SMESH.FT_FreeBorders*
181 * threshold value is not required
182
183 .. literalinclude:: ../../../examples/filters_ex09.py
184     :language: python
185
186 :download:`Download this script <../../../examples/filters_ex09.py>`
187
188 **See also:** :ref:`tui_free_borders`
189
190 .. _filter_free_edges:
191
192 Free edges
193 ==========
194
195 filters 2D mesh elements (faces) having edges (i.e. links between
196 nodes, not mesh segments) belonging to one face of mesh only:
197
198 * element type is *SMESH.FACE*
199 * functor type is *SMESH.FT_FreeEdges*
200 * threshold value is not required
201
202 .. literalinclude:: ../../../examples/filters_ex10.py
203     :language: python
204
205 :download:`Download this script <../../../examples/filters_ex10.py>`
206
207 **See also:** :ref:`tui_free_edges`
208
209 .. _filter_free_nodes:
210
211 Free nodes
212 ==========
213
214 filters free nodes:
215
216 * element type is *SMESH.NODE*
217 * functor type is *SMESH.FT_FreeNodes*
218 * threshold value is not required
219
220 .. literalinclude:: ../../../examples/filters_ex11.py
221     :language: python
222
223 :download:`Download this script <../../../examples/filters_ex11.py>`
224
225 **See also:** :ref:`tui_free_nodes`
226
227 .. _filter_free_faces: 
228
229 Free faces
230 ==========
231
232 filters free faces:
233
234 * element type is *SMESH.FACE*
235 * functor type is *SMESH.FT_FreeFaces*
236 * threshold value is not required
237
238 .. literalinclude:: ../../../examples/filters_ex12.py
239     :language: python
240
241 :download:`Download this script <../../../examples/filters_ex12.py>`
242
243 **See also:** :ref:`tui_free_faces`
244
245 .. _filter_bare_border_faces: 
246
247 Bare border faces
248 =================
249
250 filters faces with bare borders:
251
252 * element type is *SMESH.FACE*
253 * functor type is *SMESH.FT_BareBorderFace*
254 * threshold value is not required
255
256 .. literalinclude:: ../../../examples/filters_ex13.py
257     :language: python
258
259 :download:`Download this script <../../../examples/filters_ex13.py>`
260
261 **See also:** :ref:`tui_bare_border_faces`
262
263 .. _filter_coplanar_faces:
264
265 Coplanar faces
266 ==============
267
268 filters coplanar faces:
269
270 * element type is *SMESH.FACE*
271 * functor type is *SMESH.FT_CoplanarFaces*
272 * threshold value is the face ID
273 * tolerance is in degrees
274
275 .. literalinclude:: ../../../examples/filters_ex14.py
276     :language: python
277
278 :download:`Download this script <../../../examples/filters_ex14.py>`
279
280 .. _filter_over_constrained_faces: 
281
282 Over-constrained faces
283 ======================
284
285 filters over-constrained faces:
286
287 * element type is *SMESH.FACE*
288 * functor type is *SMESH.FT_OverConstrainedFace*
289 * threshold value is not required
290
291 .. literalinclude:: ../../../examples/filters_ex15.py
292     :language: python
293
294 :download:`Download this script <../../../examples/filters_ex15.py>`
295
296 **See also:** :ref:`tui_over_constrained_faces`
297
298 .. _filter_double_elements: 
299
300 Double edges, Double faces, Double volumes
301 ##########################################
302
303 filters mesh elements basing on the same set of nodes:
304
305 * element type is either *SMESH.EDGE*, *SMESH.FACE* or *SMESH.VOLUME*
306 * functor type is either *SMESH.FT_EqualEdges*, *SMESH.FT_EqualFaces* or *SMESH.FT_EqualVolumes*,
307 * threshold value is not required
308
309 .. literalinclude:: ../../../examples/filters_ex16.py
310     :language: python
311
312 :download:`Download this script <../../../examples/filters_ex16.py>`
313
314 .. _tui_double_nodes_control: 
315
316 Double nodes
317 ============
318
319 filters mesh nodes which are coincident with other nodes (within a given tolerance):
320
321 * element type is *SMESH.NODE*
322 * functor type is *SMESH.FT_EqualNodes*
323 * threshold value is not required
324 * default tolerance is 1.0e-7
325
326 .. literalinclude:: ../../../examples/filters_ex17.py
327     :language: python
328
329 :download:`Download this script <../../../examples/filters_ex17.py>`
330
331 .. _filter_node_nb_conn:
332
333 Node connectivity number
334 ========================
335
336 filters nodes according to a number of elements of highest dimension connected to a node:
337
338 * element type should be *SMESH.NODE*
339 * functor type should be *SMESH.FT_NodeConnectivityNumber*
340 * threshold is an integer value (number of elements)
341
342 .. literalinclude:: ../../../examples/filters_node_nb_conn.py
343     :language: python
344
345 :download:`Download this script <../../../examples/filters_node_nb_conn.py>`
346
347 .. _filter_borders_multiconnection: 
348
349 Borders at multi-connection
350 ===========================
351
352 filters 1D mesh elements (segments) according to the specified number of
353 connections (faces and volumes on whose border the segment lies):
354
355 * element type is *SMESH.EDGE*
356 * functor type is *SMESH.FT_MultiConnection*
357 * threshold is integer value (number of connections)
358
359 .. literalinclude:: ../../../examples/filters_ex18.py
360     :language: python
361
362 :download:`Download this script <../../../examples/filters_ex18.py>`
363
364 **See also:** :ref:`tui_borders_at_multiconnection`
365
366 .. _filter_borders_multiconnection_2d: 
367
368 Borders at multi-connection 2D
369 ==============================
370
371 filters 2D mesh elements (faces) with the specified maximal number of
372 faces connected to a border (link between nodes, not mesh segment):
373
374 * element type is *SMESH.FACE*
375 * functor type is *SMESH.FT_MultiConnection2D*
376 * threshold is integer value (number of connections)
377
378 .. literalinclude:: ../../../examples/filters_ex19.py
379     :language: python
380
381 :download:`Download this script <../../../examples/filters_ex19.py>`
382
383 **See also:** :ref:`tui_borders_at_multiconnection_2d`
384
385 .. _filter_length: 
386
387 Length
388 ======
389
390 filters 1D mesh elements (edges) according to the edge length value:
391
392 * element type should be *SMESH.EDGE*
393 * functor type should be *SMESH.FT_Length*
394 * threshold is floating point value (length)
395
396 .. literalinclude:: ../../../examples/filters_ex20.py
397     :language: python
398
399 :download:`Download this script <../../../examples/filters_ex20.py>`
400
401 **See also:** :ref:`tui_length_1d`
402
403 .. _filter_length_2d: 
404
405 Length 2D
406 =========
407
408 filters 2D mesh elements (faces) according to the maximum length of its
409 edges (links between nodes):
410
411 * element type should be *SMESH.FACE*
412 * functor type should be *SMESH.FT_Length2D*
413 * threshold is floating point value (edge length)
414
415 .. literalinclude:: ../../../examples/filters_ex21.py
416     :language: python
417
418 :download:`Download this script <../../../examples/filters_ex21.py>`
419
420 **See also:** :ref:`tui_length_2d`
421
422 .. _filter_max_element_length_2d: 
423
424 Element Diameter 2D
425 ===================
426
427 filters 2D mesh elements (faces) according to the maximum length
428 of its edges and diagonals:
429
430 * element type should be *SMESH.FACE*
431 * functor type should be *SMESH.FT_MaxElementLength2D*
432 * threshold is floating point value (length)
433
434 .. literalinclude:: ../../../examples/filters_ex22.py
435     :language: python
436
437 :download:`Download this script <../../../examples/filters_ex22.py>`
438
439 **See also:** :ref:`tui_max_element_length_2d`
440
441 .. _filter_max_element_length_3d: 
442
443 Element Diameter 3D
444 ===================
445
446 filters 3D mesh elements (volumes) according to the maximum length
447 of its edges and diagonals:
448
449 * element type should be *SMESH.VOLUME*
450 * functor type should be *SMESH.FT_MaxElementLength3D*
451 * threshold is floating point value (edge/diagonal length)
452
453 .. literalinclude:: ../../../examples/filters_ex23.py
454     :language: python
455
456 :download:`Download this script <../../../examples/filters_ex23.py>`
457
458 **See also:** :ref:`tui_max_element_length_3d`
459
460 .. _filter_bare_border_volumes: 
461
462 Bare border volumes
463 ===================
464
465 filters 3D mesh elements with bare borders, i.e. having a facet not
466 shared with other volumes and without a face on it:
467
468 * element type is *SMESH.VOLUME*
469 * functor type is *SMESH.FT_BareBorderVolume*
470 * threshold value is not required
471
472 .. literalinclude:: ../../../examples/filters_ex24.py
473     :language: python
474
475 :download:`Download this script <../../../examples/filters_ex24.py>`
476
477 **See also:** :ref:`tui_bare_border_volumes`
478
479 .. _filter_over_constrained_volumes: 
480
481 Over-constrained volumes
482 ========================
483
484 filters over-constrained volumes, whose all nodes are on the mesh boundary:
485
486 * element type is *SMESH.VOLUME*
487 * functor type is *SMESH.FT_OverConstrainedVolume*
488 * threshold value is not required
489
490 .. literalinclude:: ../../../examples/filters_ex25.py
491     :language: python
492
493 :download:`Download this script <../../../examples/filters_ex25.py>`
494
495 **See also:** :ref:`tui_over_constrained_faces`
496
497 .. _filter_belong_to_group: 
498
499 Belong to Mesh Group
500 ====================
501
502 filters mesh entities (nodes or elements) included in a mesh group
503 defined by threshold value:
504
505 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
506 * functor type should be *SMESH.FT_BelongToMeshGroup*
507 * threshold is mesh group object
508
509 .. literalinclude:: ../../../examples/filters_belong2group.py
510     :language: python
511
512 :download:`Download this script <../../../examples/filters_belong2group.py>`
513
514 .. _filter_belong_to_geom: 
515
516 Belong to Geom
517 ==============
518
519 filters mesh entities (nodes or elements) which all nodes lie on the
520 shape defined by threshold value:
521
522 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
523 * functor type should be *SMESH.FT_BelongToGeom*
524 * threshold is geometrical object
525 * tolerance is a distance between a node and the geometrical object; it is used if an node is not associated to any geometry.
526
527 .. literalinclude:: ../../../examples/filters_ex26.py
528     :language: python
529
530 :download:`Download this script <../../../examples/filters_ex26.py>`
531
532 .. _filter_lying_on_geom:
533
534 Lying on Geom
535 =============
536
537 filters mesh entities (nodes or elements) at least one node of which lies on the
538 shape defined by threshold value:
539
540 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
541 * functor type should be *SMESH.FT_LyingOnGeom*
542 * threshold is geometrical object
543 * tolerance is a distance between a node and the geometrical object;
544
545 it is used if an node is not associated to any geometry.
546
547 .. literalinclude:: ../../../examples/filters_ex27.py
548     :language: python
549
550 :download:`Download this script <../../../examples/filters_ex27.py>`
551
552 .. _filter_belong_to_plane: 
553
554 Belong to Plane
555 ===============
556
557 filters mesh entities (nodes or elements) which all nodes belong to the
558 plane defined by threshold value with the given tolerance:
559
560 * element type can be any except *SMESH.VOLUME*
561 * functor type should be *SMESH.FT_BelongToPlane*
562 * threshold is geometrical object (plane)
563 * default tolerance is 1.0e-7
564
565 .. literalinclude:: ../../../examples/filters_ex28.py
566     :language: python
567
568 :download:`Download this script <../../../examples/filters_ex28.py>`
569
570 .. _filter_belong_to_cylinder: 
571
572 Belong to Cylinder
573 ==================
574
575 filters mesh entities (nodes or elements) which all nodes belong to the
576 cylindrical face defined by threshold value with the given tolerance:
577
578 * element type can be any except *SMESH.VOLUME*
579 * functor type should be *SMESH.FT_BelongToCylinder*
580 * threshold is geometrical object (cylindrical face)
581 * default tolerance is 1.0e-7
582
583 .. literalinclude:: ../../../examples/filters_ex29.py
584     :language: python
585
586 :download:`Download this script <../../../examples/filters_ex29.py>`
587
588 .. _filter_belong_to_surface: 
589
590 Belong to Surface
591 =================
592
593 filters mesh entities (nodes or elements) which all nodes belong to the
594 arbitrary surface defined by threshold value with the given tolerance:
595
596 * element type can be any except *SMESH.VOLUME*
597 * functor type should be *SMESH.FT_BelongToGenSurface*
598 * threshold is geometrical object (arbitrary surface)
599 * default tolerance is 1.0e-7
600
601 .. literalinclude:: ../../../examples/filters_ex30.py
602     :language: python
603
604 :download:`Download this script <../../../examples/filters_ex30.py>`
605
606 .. _filter_range_of_ids: 
607
608 Range of IDs
609 ============
610
611 filters mesh entities elements (nodes or elements) according to the
612 specified identifiers range:
613
614 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
615 * functor type is *SMESH.FT_RangeOfIds*
616 * threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78"
617
618 .. literalinclude:: ../../../examples/filters_ex31.py
619     :language: python
620
621 :download:`Download this script <../../../examples/filters_ex31.py>`
622
623 .. _filter_bad_oriented_volume:
624
625 Badly oriented volume
626 =====================
627
628 filters 3D mesh elements (volumes), which are incorrectly oriented from
629 the point of view of MED convention. 
630
631 * element type should be *SMESH.VOLUME*
632 * functor type is *SMESH.FT_BadOrientedVolume*
633 * threshold is not required
634
635 .. literalinclude:: ../../../examples/filters_ex32.py
636     :language: python
637
638 :download:`Download this script <../../../examples/filters_ex32.py>`
639
640 .. _filter_linear_or_quadratic: 
641
642 Linear / quadratic
643 ==================
644
645 filters linear / quadratic mesh elements:
646
647 * element type should be either *SMESH.EDGE*, *SMESH.FACE* or *SMESH.VOLUME*
648 * functor type is *SMESH.FT_LinearOrQuadratic*
649 * threshold is not required
650 * if unary operator is set to SMESH.FT_LogicalNOT, the quadratic elements are selected, otherwise (by default) linear elements are selected
651
652 .. literalinclude:: ../../../examples/filters_ex33.py
653     :language: python
654
655 :download:`Download this script <../../../examples/filters_ex33.py>`
656
657 .. _filter_group_color: 
658
659 Group color
660 ===========
661
662 filters mesh entities, belonging to the group with the color defined by the threshold value.
663
664 * element type can be any, from *SMESH.NODE* to *SMESH.BALL*
665 * functor type is *SMESH.FT_GroupColor*
666 * threshold should be of SALOMEDS.Color type
667
668 .. literalinclude:: ../../../examples/filters_ex34.py
669     :language: python
670
671 :download:`Download this script <../../../examples/filters_ex34.py>`
672
673 .. _filter_geom_type: 
674
675 Geometry type
676 =============
677
678 filters mesh elements by the geometric type defined with the threshold
679 value. The list of available geometric types depends on the element
680 entity type.
681
682 * element type can be any, e.g.: *SMESH.EDGE*, *SMESH.FACE*, *SMESH.VOLUME*, etc.
683 * functor type should be *SMESH.FT_ElemGeomType*
684 * threshold is either of smesh.GeometryType values. Type *SMESH.GeometryType._items* in the Python Console to see all geometric types.
685
686 .. literalinclude:: ../../../examples/filters_ex35.py
687     :language: python
688
689 :download:`Download this script <../../../examples/filters_ex35.py>`
690
691 .. _filter_entity_type: 
692
693 Entity type
694 ===========
695
696 filters mesh elements by the geometric type and number of nodes. 
697
698 * element type can be any, e.g.: *SMESH.EDGE*, *SMESH.FACE*, *SMESH.VOLUME*, etc.
699 * functor type should be *SMESH.FT_EntityType*
700 * threshold is either of SMESH.EntityType values. Type *SMESH.EntityType._items* in the Python Console to see all entity types.
701
702 .. literalinclude:: ../../../examples/filters_ex37.py
703     :language: python
704
705 :download:`Download this script <../../../examples/filters_ex37.py>`
706
707 .. _filter_ball_diam: 
708
709 Ball diameter
710 =============
711
712 filters ball elements by diameter. 
713
714 * element type should be *SMESH.BALL*
715 * functor type should be *SMESH.FT_BallDiameter*
716 * threshold is floating point value (ball diameter)
717
718 .. literalinclude:: ../../../examples/filters_ex38.py
719     :language: python
720
721 :download:`Download this script <../../../examples/filters_ex38.py>`
722
723 .. _filter_domain: 
724
725 Elements of a domain
726 ====================
727
728 filters elements of a specified domain. 
729
730 * element type can be any, e.g.: *SMESH.EDGE*, *SMESH.FACE*, *SMESH.VOLUME*, etc.
731 * functor type should be *SMESH.FT_ConnectedElements*
732 * threshold is either (1) node ID or (2)  geometrical vertex or (3) 3 coordinates of a point.
733
734 .. literalinclude:: ../../../examples/filters_ex39.py
735     :language: python
736
737 :download:`Download this script <../../../examples/filters_ex39.py>`
738
739 .. _combining_filters: 
740
741 How to combine several criteria into a filter?
742 ==============================================
743
744 Several criteria can be combined into a filter.
745
746 .. literalinclude:: ../../../examples/filters_ex36.py
747     :language: python
748
749 :download:`Download this script <../../../examples/filters_ex36.py>`