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