4 salome.salome_init_without_session()
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
8 gg = salome.ImportComponentGUI("GEOM")
10 # create vertices and vectors
11 p0 = geompy.MakeVertex( 0., 0., 0.)
12 px = geompy.MakeVertex(20., 0., 0.)
13 py = geompy.MakeVertex( 0., 20., 0.)
14 pz = geompy.MakeVertex( 0., 0., 20.)
15 pxy = geompy.MakeVertex( 50., 0., 0.)
16 pxyz = geompy.MakeVertex( 50., 50., 50.)
17 vz = geompy.MakeVector(p0, pz)
18 vxy = geompy.MakeVector(px, py)
19 vtr1d = geompy.MakeVector(p0, pxyz)
20 vtr2d = geompy.MakeVector(p0, pxy)
23 arc = geompy.MakeArc(py, pz, px)
26 wire = geompy.MakeWire([vxy, arc])
28 # create a planar face
29 face = geompy.MakeFace(wire, 1)
32 prism = geompy.MakePrismVecH(face, vz, 20.0)
34 # translate the given object along the given vector a given number of times
35 tr1d = geompy.MakeMultiTranslation1D(prism, vtr1d, 20, 4)
37 # consequently apply two specified translations to the object a given number of times
38 tr2d = geompy.MakeMultiTranslation2D(prism, vtr1d, 20, 4, vtr2d, 80, 3)
40 # add objects in the study
41 id_prism = geompy.addToStudy(prism,"Prism")
42 id_tr1d = geompy.addToStudy(tr1d,"Translation 1D")
43 id_tr2d = geompy.addToStudy(tr2d,"Translation 2D")
45 # display the prism and the results of fillet operation
46 gg.createAndDisplayGO(id_prism)
47 gg.setDisplayMode(id_prism,1)
48 gg.createAndDisplayGO(id_tr1d)
49 gg.setDisplayMode(id_tr1d,1)
50 gg.createAndDisplayGO(id_tr2d)
51 gg.setDisplayMode(id_tr2d,1)