]> SALOME platform Git repositories - plugins/blsurfplugin.git/blob - tests/enforced_internal_vertex.py
Salome HOME
Merge changes from 'master' branch.
[plugins/blsurfplugin.git] / tests / enforced_internal_vertex.py
1 # -*- coding: utf-8 -*-
2
3 import salome
4 import math
5
6 import GEOM
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
9
10 r = 10
11 dist = 10
12 dist_coin = 10.1
13
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")
18
19 p3 = geompy.MakeVertex(dist_coin, 0, dist_coin)
20 geompy.addToStudy(p3, "p3")
21
22 part = geompy.MakePartition([box], [p3])
23 geompy.addToStudy(part, "part")
24
25 left = geompy.GetFaceNearPoint(box, p3)
26 geompy.addToStudyInFather(box, left, "left")
27
28
29 # Mesh
30 # ====
31
32 import SMESH
33 from salome.smesh import smeshBuilder
34 smesh = smeshBuilder.New()
35
36 Mesh = smesh.Mesh(part, "Mesh")
37
38 algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
39 algo2d.SetGeometricMesh( 1 )
40 algo2d.SetAngleMesh( 4 )
41 algo2d.SetPhySize( 8 )
42
43 algo2d.SetInternalEnforcedVertexAllFaces(True)
44
45 Mesh.Compute()
46
47 id_node = Mesh.FindNodeClosestTo(dist_coin, 0, dist_coin)
48
49 x, y, z = Mesh.GetNodeXYZ(id_node)
50
51 assert("%.2f, %.2f, %.2f"%(x, y, z) == "%.2f, %.2f, %.2f"%(dist_coin, 0, dist_coin))
52
53 salome.sg.updateObjBrowser()
54