1 # -*- coding: utf-8 -*-
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
14 p1 = geompy.MakeVertex(0., 0., 0.)
15 p2 = geompy.MakeVertex(100., 100., 100.)
16 box = geompy.MakeBoxTwoPnt(p1, p2)
17 geompy.addToStudy(box, "box")
19 p3 = geompy.MakeVertex(dist_coin, 0, dist_coin)
20 geompy.addToStudy(p3, "p3")
22 part = geompy.MakePartition([box], [p3])
23 geompy.addToStudy(part, "part")
25 left = geompy.GetFaceNearPoint(box, p3)
26 geompy.addToStudyInFather(box, left, "left")
33 from salome.smesh import smeshBuilder
34 smesh = smeshBuilder.New(salome.myStudy)
36 Mesh = smesh.Mesh(part, "Mesh")
38 algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
39 algo2d.SetGeometricMesh( 1 )
40 algo2d.SetAngleMesh( 4 )
41 algo2d.SetPhySize( 8 )
43 algo2d.SetInternalEnforcedVertexAllFaces(True)
47 id_node = Mesh.FindNodeClosestTo(dist_coin, 0, dist_coin)
49 x, y, z = Mesh.GetNodeXYZ(id_node)
51 assert("%.2f, %.2f, %.2f"%(x, y, z) == "%.2f, %.2f, %.2f"%(dist_coin, 0, dist_coin))
53 salome.sg.updateObjBrowser(True)