6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
11 p1 = geompy.MakeVertex(70., 0., 0.)
12 p2 = geompy.MakeVertex(70., 70., 80.)
13 p3 = geompy.MakeVertex( 0., 70., 0.)
15 #create a vector from two points
16 vector_arc = geompy.MakeVector(p1, p3)
18 # create an arc from three points
19 arc = geompy.MakeArc(p1, p2, p3)
22 wire = geompy.MakeWire([vector_arc, arc])
24 # create a planar face
26 face = geompy.MakeFace(wire, isPlanarWanted)
28 # Create a 2D polyline with Polyline2D interface
29 pl = geompy.Polyline2D()
30 pl.addSection("section 1", GEOM.Polyline, True, [0, 0, 10, 0, 10, 10])
31 polyline1 = pl.result([100, 0, 0, 1, 1, 1, -1, 1, 0])
33 pl = geompy.Polyline2D()
34 pl.addSection("section 2", GEOM.Interpolation, False)
35 pl.addPoints([20, 0, 30, 0, 30, 10])
36 polyline2 = pl.result(face)
38 # add objects in the study
39 id_face = geompy.addToStudy(face,"Face")
40 id_polyline1 = geompy.addToStudy(polyline1, "Polyline1")
41 id_polyline2 = geompy.addToStudy(polyline2, "Polyline2")
43 # display the first polyline and the second polyline with its planar face
44 gg.createAndDisplayGO(id_face)
45 gg.setDisplayMode(id_face,1)
46 gg.setTransparency(id_face,0.5)
47 gg.createAndDisplayGO(id_polyline1)
48 gg.createAndDisplayGO(id_polyline2)