3 \page tui_basic_operations_page Basic Operations
11 gg = salome.ImportComponentGUI("GEOM")
13 # create a vertex and a vector
14 p0 = geompy.MakeVertex( 0., 0., 0.)
15 p200 = geompy.MakeVertex(200., 200., 200.)
16 pz = geompy.MakeVertex( 0., 0., 100.)
19 vxyz = geompy.MakeVectorDXDYDZ(100., 100., 100.)
21 # create a box from two points
22 box = geompy.MakeBoxTwoPnt(p0, p200)
26 plane = geompy.MakePlane(pz, vxyz, trimsize)
28 # create partition objects
29 partition1 = geompy.MakePartition([box], [plane])
30 partition2 = geompy.Partition([box], [plane])
31 partition3 = geompy.MakeHalfPartition(box, plane)
33 # add objects in the study
34 id_box = geompy.addToStudy(box,"Box")
35 id_plane = geompy.addToStudy(plane,"Plane")
36 id_partition1 = geompy.addToStudy(partition1,"MakePartition")
37 id_partition2 = geompy.addToStudy(partition2,"Partition")
38 id_partition3 = geompy.addToStudy(partition3,"MakeHalfPartition")
40 # display the partition objects and the plane
41 gg.createAndDisplayGO(id_box)
42 gg.setDisplayMode(id_box,1)
43 gg.createAndDisplayGO(id_plane)
44 gg.setDisplayMode(id_plane,1)
45 gg.createAndDisplayGO(id_partition1)
46 gg.createAndDisplayGO(id_partition2)
47 gg.createAndDisplayGO(id_partition3)
51 <br><h2>Archimede</h2>
56 gg = salome.ImportComponentGUI("GEOM")
58 # create a vertex and a vector
59 p0 = geompy.MakeVertex( 0., 0., 0.)
60 p200 = geompy.MakeVertex(200., 200., 200.)
62 # create a box from two points
63 box = geompy.MakeBoxTwoPnt(p0, p200)
65 # perform an Archimede operation on the selected shape with selected parameters
68 meshingdeflection = 0.01
69 archimede = geompy.Archimede(box, weight, waterdensity, meshingdeflection)
71 # add objects in the study
72 id_box = geompy.addToStudy(box,"Box")
73 id_archimede = geompy.addToStudy(archimede,"Archimede")
75 # display the box and the result of Archimede operation
76 gg.createAndDisplayGO(id_box)
77 gg.setDisplayMode(id_box,1)
78 gg.createAndDisplayGO(id_archimede)
79 gg.setDisplayMode(id_archimede,1)