7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New(salome.myStudy)
13 import salome_notebook
16 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
18 mesh = smesh.Mesh( box )
19 mesh.Segment().AutomaticLength(0.1)
23 # find node at (0,0,0)
25 for vId in geompy.SubShapeAllIDs( box, geompy.ShapeType["VERTEX"]):
27 nodeIds = mesh.GetSubMeshNodesId( vId, True )
29 xyz = mesh.GetNodeXYZ( node )
30 if xyz[0] == 0 and xyz[1] == 0 and xyz[2] == 0 :
37 raise "node000 not found"
39 # find node000 using the tested function
40 n = mesh.FindNodeClosestTo( -1,-1,-1 )
42 raise "FindNodeClosestTo() returns " + str( n ) + " != " + str( node000 )
44 # move node000 to a new location
46 n = mesh.MoveNode( n,x,y,z )
48 raise "MoveNode() returns " + n
50 # check the coordinates of the node000
51 xyz = mesh.GetNodeXYZ( node000 )
52 if not ( xyz[0] == x and xyz[1] == y and xyz[2] == z) :
53 raise "Wrong coordinates: " + str( xyz ) + " != " + str( [x,y,z] )