Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Precise doc on sub-mesh priority
[modules/smesh.git]
/
doc
/
salome
/
examples
/
quality_controls_ex03.py
diff --git
a/doc/salome/examples/quality_controls_ex03.py
b/doc/salome/examples/quality_controls_ex03.py
index eaa607b94aa671a29703c07d6dd888ca45f78958..fca52fddf3a1b9ad5e7472efdff5aa66b9f8c056 100644
(file)
--- a/
doc/salome/examples/quality_controls_ex03.py
+++ b/
doc/salome/examples/quality_controls_ex03.py
@@
-1,9
+1,15
@@
# Length 1D
# Length 1D
+
import salome
import salome
-import geompy
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
-import smesh
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New()
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
@@
-23,21
+29,21
@@
mesh.Compute()
# Criterion : Length > 3.
length_margin = 3.
# Criterion : Length > 3.
length_margin = 3.
-aFilter = smesh.GetFilter(
smesh.EDGE, smesh.FT_Length, smesh
.FT_MoreThan, length_margin)
+aFilter = smesh.GetFilter(
SMESH.EDGE, SMESH.FT_Length, SMESH
.FT_MoreThan, length_margin)
anIds = mesh.GetIdsFromFilter(aFilter)
# print the result
anIds = mesh.GetIdsFromFilter(aFilter)
# print the result
-print
"Criterion: Edges length > ", length_margin, " Nb = ", len(anIds
)
+print
("Criterion: Edges length > ", length_margin, " Nb = ", len(anIds)
)
j = 1
for i in range(len(anIds)):
j = 1
for i in range(len(anIds)):
- if j > 20: j = 1; print
""
- print
anIds[i],
+ if j > 20: j = 1; print
("")
+ print
(anIds[i], end=' ')
j = j + 1
pass
j = j + 1
pass
-print
""
+print
("")
# create a group
# create a group
-aGroup = mesh.GetMesh().CreateGroup(
smesh.EDGE, "Edges with length > " + `length_margin`
)
+aGroup = mesh.GetMesh().CreateGroup(
SMESH.EDGE, "Edges with length > " + repr(length_margin)
)
aGroup.Add(anIds)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(
1
)
+salome.sg.updateObjBrowser()