salome: salomePrismExample.py

File salomePrismExample.py, 767 bytes (added by brankm, 7 years ago)

Program za primer izdelave izvleka v prostor.

Line 
1import salome
2salome.salome_init()
3import GEOM
4from salome.geom import geomBuilder
5geompy = geomBuilder.New(salome.myStudy)
6gg = salome.ImportComponentGUI("GEOM")
7
8p1 = geompy.MakeVertex(   0.,   0.,   0.)
9p2 = geompy.MakeVertex( 100.,   0.,   0.)
10p3 = geompy.MakeVertex( 100., 100.,   0.)
11p4 = geompy.MakeVertex(   0., 100.,   0.)
12
13geompy.addToStudy(p1,"point1")
14geompy.addToStudy(p2,"point2")
15geompy.addToStudy(p3,"point3")
16geompy.addToStudy(p4,"point4")
17
18polyline = geompy.MakePolyline([p1, p2, p3, p4, p1])
19geompy.addToStudy(polyline,"polyline")
20
21face = geompy.MakeFace(polyline, True)
22geompy.addToStudy(face, "face")
23
24p5 = geompy.MakeVertex(0.,0.,100.)
25prism1 = geompy.MakePrism(face, p1, p5)
26geompy.addToStudy(prism1, "prism1")
27salome.sg.updateObjBrowser(True)