smesh/doc/salome/examples/modifying_meshes_ex06.py

19 lines
390 B
Python
Raw Normal View History

2013-02-12 20:37:44 +06:00
# Add Quadrangle
import SMESH_mechanic
mesh = SMESH_mechanic.mesh
2017-03-20 17:27:30 +05:00
print("")
2013-02-12 20:37:44 +06:00
# add node
n1 = mesh.AddNode(50, 10, 0)
2017-03-20 17:27:30 +05:00
if n1 == 0: print("KO node addition.")
2013-02-12 20:37:44 +06:00
n2 = mesh.AddNode(40, 20, 0)
2017-03-20 17:27:30 +05:00
if n2 == 0: print("KO node addition.")
2013-02-12 20:37:44 +06:00
# add quadrangle
q1 = mesh.AddFace([n2, n1, 38, 39])
2017-03-20 17:27:30 +05:00
if q1 == 0: print("KO quadrangle addition.")
else: print("New Quadrangle has been added with ID ", q1)