3 \page tui_quality_controls_page Quality Controls
6 \anchor tui_free_borders
15 # create open shell: a box without one plane
16 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
17 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
18 FaceList.remove(FaceList[5])
19 box = geompy.MakeShell(FaceList)
20 idbox = geompy.addToStudy(box, "box")
23 mesh = smesh.Mesh(box, "Mesh_free_borders")
25 algo.NumberOfSegments(5)
26 algo = mesh.Triangle()
27 algo.MaxElementArea(20.)
30 # criterion : free borders
31 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)
32 anIds = mesh.GetIdsFromFilter(aFilter)
35 print "Criterion: Free borders Nb = ", len(anIds)
37 for i in range(len(anIds)):
38 if j > 20: j = 1; print ""
45 aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders")
48 salome.sg.updateObjBrowser(1)
52 \anchor tui_borders_at_multiconnection
53 <h2>Borders at Multiconnection</h2>
62 # create open shell: a box without one plane
63 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
64 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
65 FaceList.remove(FaceList[5])
66 box = geompy.MakeShell(FaceList)
67 idbox = geompy.addToStudy(box, "box")
70 mesh = smesh.Mesh(box, "Mesh_borders_at_multi-connections")
72 algo.NumberOfSegments(5)
73 algo = mesh.Triangle()
74 algo.MaxElementArea(20.)
77 # Criterion : Borders at multi-connection
80 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, nb_conn)
81 anIds = mesh.GetIdsFromFilter(aFilter)
84 print "Criterion: Borders at multi-connections Nb = ", len(anIds)
86 for i in range(len(anIds)):
87 if j > 20: j = 1; print ""
94 aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections")
97 salome.sg.updateObjBrowser(1)
101 \anchor tui_length_1d
110 # create open shell: a box without one plane
111 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
112 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
113 FaceList.remove(FaceList[5])
114 box = geompy.MakeShell(FaceList)
115 idbox = geompy.addToStudy(box, "box")
118 mesh = smesh.Mesh(box, "Mesh_Length_1D")
119 algo = mesh.Segment()
120 algo.NumberOfSegments(5)
121 algo = mesh.Triangle()
122 algo.MaxElementArea(20.)
125 # Criterion : Length > 3.
128 aFilter = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)
129 anIds = mesh.GetIdsFromFilter(aFilter)
132 print "Criterion: Edges length > ", length_margin, " Nb = ", len(anIds)
134 for i in range(len(anIds)):
135 if j > 20: j = 1; print ""
142 aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
145 salome.sg.updateObjBrowser(1)
149 \anchor tui_free_edges
153 import SMESH_mechanic
155 smesh = SMESH_mechanic.smesh
156 mesh = SMESH_mechanic.mesh
157 salome = SMESH_mechanic.salome
159 aFilterMgr = smesh.CreateFilterManager()
161 # Remove some elements to obtain free edges
162 # Criterion : AREA > 95.
165 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
167 anIds = mesh.GetIdsFromFilter(aFilter)
169 mesh.RemoveElements(anIds)
171 # Criterion : Free Edges
172 aBorders = mesh.GetFreeBorders()
175 aGroupF = mesh.CreateGroup(SMESH.FACE, "Faces with free edges")
176 aGroupN = mesh.CreateGroup(SMESH.NODE, "Nodes on free edges")
178 # fill groups with elements, corresponding to the criterion
180 print "Criterion: Free edges Nb = ", len(aBorders)
181 for i in range(len(aBorders)):
182 aBorder = aBorders[i]
183 print "Face # ", aBorder.myElemId, " : Edge between nodes (",
184 print aBorder.myPnt1, ", ", aBorder.myPnt2, ")"
186 aGroupF.Add([aBorder.myElemId])
187 aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2])
189 salome.sg.updateObjBrowser(1)
193 \anchor tui_length_2d
202 # create open shell: a box without one plane
203 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
204 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
205 FaceList.remove(FaceList[5])
206 box = geompy.MakeShell(FaceList)
207 idbox = geompy.addToStudy(box, "box")
210 mesh = smesh.Mesh(box, "Mesh_Length_2D")
211 algo = mesh.Segment()
212 algo.NumberOfSegments(5)
213 algo = mesh.Triangle()
214 algo.MaxElementArea(20.)
217 # Criterion : Length 2D > 5.7
220 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)
222 anIds = mesh.GetIdsFromFilter(aFilter)
225 print "Criterion: Edges length 2D > ", length_margin, " Nb = ", len(anIds)
227 for i in range(len(anIds)):
228 if j > 20: j = 1; print ""
235 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " + `length_margin`)
238 salome.sg.updateObjBrowser(1)
242 \anchor tui_borders_at_multiconnection_2d
243 <h2>Borders at Multiconnection 2D</h2>
251 # create a compound of two glued boxes
252 box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
253 box2 = geompy.MakeTranslation(box1, 0., 20., 0)
254 comp = geompy.MakeCompound([box1, box2])
255 box = geompy.MakeGlueFaces(comp, 0.000001)
256 idbox = geompy.addToStudy(box, "box")
259 mesh = smesh.Mesh(box, "Box compound : 2D triangle mesh")
260 algo = mesh.Segment()
261 algo.NumberOfSegments(5)
262 algo = mesh.Triangle()
263 algo.MaxElementArea(20.)
266 # Criterion : MULTI-CONNECTION 2D = 3
269 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, nb_conn)
271 anIds = mesh.GetIdsFromFilter(aFilter)
274 print "Criterion: Borders at multi-connection 2D = ", nb_conn, " Nb = ", len(anIds)
276 for i in range(len(anIds)):
277 if j > 20: j = 1; print ""
284 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection 2D = " + `nb_conn`)
287 salome.sg.updateObjBrowser(1)
295 import SMESH_mechanic
297 smesh = SMESH_mechanic.smesh
298 mesh = SMESH_mechanic.mesh
299 salome = SMESH_mechanic.salome
301 # Criterion : AREA > 100.
304 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)
306 anIds = mesh.GetIdsFromFilter(aFilter)
309 print "Criterion: Area > ", area_margin, " Nb = ", len(anIds)
311 for i in range(len(anIds)):
312 if j > 20: j = 1; print ""
319 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Area > " + `area_margin`)
322 salome.sg.updateObjBrowser(1)
330 import SMESH_mechanic
332 smesh = SMESH_mechanic.smesh
333 mesh = SMESH_mechanic.mesh
334 salome = SMESH_mechanic.salome
336 # Criterion : Taper > 3e-20
339 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)
341 anIds = mesh.GetIdsFromFilter(aFilter)
344 print "Criterion: Taper > ", taper_margin, " Nb = ", len(anIds)
346 for i in range(len(anIds)):
347 if j > 20: j = 1; print ""
354 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`)
357 salome.sg.updateObjBrowser(1)
361 \anchor tui_aspect_ratio
362 <h2>Aspect Ratio</h2>
365 import SMESH_mechanic
367 smesh = SMESH_mechanic.smesh
368 mesh = SMESH_mechanic.mesh
369 salome = SMESH_mechanic.salome
371 # Criterion : ASPECT RATIO > 1.8
374 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, ar_margin)
376 anIds = mesh.GetIdsFromFilter(aFilter)
379 print "Criterion: Aspect Ratio > ", ar_margin, " Nb = ", len(anIds)
381 for i in range(len(anIds)):
382 if j > 20: j = 1; print ""
389 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`)
392 salome.sg.updateObjBrowser(1)
396 \anchor tui_minimum_angle
397 <h2>Minimum Angle</h2>
400 import SMESH_mechanic
402 smesh = SMESH_mechanic.smesh
403 mesh = SMESH_mechanic.mesh
404 salome = SMESH_mechanic.salome
406 # Criterion : MINIMUM ANGLE < 35.
409 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)
411 anIds = mesh.GetIdsFromFilter(aFilter)
414 print "Criterion: Minimum Angle < ", min_angle, " Nb = ", len(anIds)
416 for i in range(len(anIds)):
417 if j > 20: j = 1; print ""
424 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + `min_angle`)
428 salome.sg.updateObjBrowser(1)
436 import SMESH_mechanic
438 smesh = SMESH_mechanic.smesh
439 mesh = SMESH_mechanic.mesh
440 salome = SMESH_mechanic.salome
442 # Criterion : WARP ANGLE > 1e-15
445 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)
447 anIds = mesh.GetIdsFromFilter(aFilter)
450 print "Criterion: Warp > ", wa_margin, " Nb = ", len(anIds)
452 for i in range(len(anIds)):
453 if j > 20: j = 1; print ""
460 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Warp > " + `wa_margin`)
464 salome.sg.updateObjBrowser(1)
472 import SMESH_mechanic
474 smesh = SMESH_mechanic.smesh
475 mesh = SMESH_mechanic.mesh
476 salome = SMESH_mechanic.salome
478 # Criterion : Skew > 38.
481 aFilter = smesh.GetFilter(smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)
483 anIds = mesh.GetIdsFromFilter(aFilter)
486 print "Criterion: Skew > ", skew_margin, " Nb = ", len(anIds)
488 for i in range(len(anIds)):
489 if j > 20: j = 1; print ""
496 aGroup = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`)
499 salome.sg.updateObjBrowser(1)
503 \anchor tui_aspect_ratio_3d
504 <h2>Aspect Ratio 3D</h2>
507 import SMESH_mechanic_tetra
509 smesh = SMESH_mechanic_tetra.smesh
510 mesh = SMESH_mechanic_tetra.mesh
511 salome = SMESH_mechanic_tetra.salome
513 # Criterion : ASPECT RATIO 3D > 4.5
516 aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)
518 anIds = mesh.GetIdsFromFilter(aFilter)
521 print "Criterion: Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds)
523 for i in range(len(anIds)):
524 if j > 20: j = 1; print ""
531 aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Aspect Ratio 3D > " + `ar_margin`)
535 salome.sg.updateObjBrowser(1)
543 import SMESH_mechanic_tetra
545 smesh = SMESH_mechanic_tetra.smesh
546 mesh = SMESH_mechanic_tetra.mesh
547 salome = SMESH_mechanic_tetra.salome
549 # Criterion : VOLUME < 7.
552 aFilter = smesh.GetFilter(smesh.VOLUME, smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)
554 anIds = mesh.GetIdsFromFilter(aFilter)
558 print "Criterion: Volume < ", volume_margin, " Nb = ", len(anIds)
560 for i in range(len(anIds)):
561 if j > 20: j = 1; print ""
568 aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, "Volume < " + `volume_margin`)
572 salome.sg.updateObjBrowser(1)