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