6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
10 ShapeTypeEdge = geompy.ShapeType["EDGE"]
12 # create vertices and vectors
13 p0 = geompy.MakeVertex( 0., 0., 0.)
14 px = geompy.MakeVertex(100., 0., 0.)
15 py = geompy.MakeVertex( 0., 100., 0.)
16 pz = geompy.MakeVertex( 0., 0., 100.)
17 vz = geompy.MakeVector(p0, pz)
18 vxy = geompy.MakeVector(px, py)
21 arc = geompy.MakeArc(py, pz, px)
24 wire = geompy.MakeWire([vxy, arc])
26 # create a planar face
27 face = geompy.MakeFace(wire, 1)
30 prism = geompy.MakePrismVecH(face, vz, 100.0)
32 # get the list of IDs (IDList) for the fillet
33 prism_edges = geompy.SubShapeAllSortedCentres(prism, ShapeTypeEdge)
35 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
36 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
37 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
39 # make a fillet on the specified edges of the given shape
40 fillet = geompy.MakeFillet(prism, radius, ShapeTypeEdge, IDlist_e)
42 # make a fillet on all edges of the given shape
43 filletall = geompy.MakeFilletAll(prism, radius)
45 # add objects in the study
46 id_prism = geompy.addToStudy(prism,"Prism")
47 id_fillet = geompy.addToStudy(fillet,"Fillet")
48 id_filletall = geompy.addToStudy(filletall,"Fillet all")
50 # display the prism and the results of fillet operation
51 gg.createAndDisplayGO(id_prism)
52 gg.setDisplayMode(id_prism,1)
53 gg.createAndDisplayGO(id_fillet)
54 gg.setDisplayMode(id_fillet,1)
55 gg.createAndDisplayGO(id_filletall)
56 gg.setDisplayMode(id_filletall,1)