Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Basic Geometrical Objects


Creation of a Point

1 # Creation of a Point
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 p100 = geompy.MakeVertexWithRef(p0, 100., 100., 100.)
13 px = geompy.MakeVertex(100., 0., 0.)
14 py = geompy.MakeVertex(0., 100., 0.)
15 pz = geompy.MakeVertex(0., 0., 100.)
16 p1 = geompy.MakeVertex(50., 50., 30.)
17 
18 # create a curve and vertices on it
19 Arc = geompy.MakeArc(py, pz, px)
20 # create a vertex by parameter
21 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
22 # create a vertex by length
23 p_on_arc2 = geompy.MakeVertexOnCurveByLength(Arc, 50., None)
24 #create a vertex by point projection
25 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
26 
27 # create 2 lines and make a point on its intersection
28 line_1 = geompy.MakeLineTwoPnt(p0, p100)
29 line_2 = geompy.MakeLineTwoPnt(p1, pz)
30 p_inter = geompy.MakeVertexOnLinesIntersection(line_1, line_2)
31 
32 # create a face and vertices on it
33 Add_line = geompy.MakeLineTwoPnt(px, py)
34 arc_face = geompy.MakeFaceWires([Arc, Add_line], 1)
35 p_on_face1 = geompy.MakeVertexOnSurface(arc_face, 0.5, 0.5)
36 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(arc_face, 35, 35, 35)
37 p_on_face3 = geompy.MakeVertexInsideFace(arc_face)
38 
39 
40 # add objects in the study
41 id_p0 = geompy.addToStudy(p0, "Vertex 0")
42 id_p100 = geompy.addToStudy(p100, "Vertex 100")
43 id_px = geompy.addToStudy(px, "Vertex X")
44 id_py = geompy.addToStudy(py, "Vertex Y")
45 id_pz = geompy.addToStudy(pz, "Vertex Z")
46 id_Arc = geompy.addToStudy(Arc, "Arc")
47 id_line_1 = geompy.addToStudy(line_1, "Line 1")
48 id_line_2 = geompy.addToStudy(line_2, "Line 2")
49 id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc by parameter")
50 id_p_on_arc2 = geompy.addToStudy(p_on_arc2, "Vertex on Arc by length")
51 id_p_on_arc3 = geompy.addToStudy(p_on_arc3, "Vertex on Arc by point projection")
52 id_p_inter = geompy.addToStudy(p_inter, "Vertex on Lines Intersection")
53 id_p_on_face1 = geompy.addToStudy(p_on_face1, "Vertex on face by parameter")
54 id_p_on_face2 = geompy.addToStudy(p_on_face2, "Vertex on face by point projection")
55 id_p_on_face3 = geompy.addToStudy(p_on_face3, "Vertex inside face")
56 
57 # display vertices
58 gg.createAndDisplayGO(id_p0)
59 gg.createAndDisplayGO(id_p100)
60 gg.createAndDisplayGO(id_Arc)
61 gg.createAndDisplayGO(id_p_inter)
62 gg.createAndDisplayGO(id_p_on_arc)
63 gg.createAndDisplayGO(id_p_on_arc2)
64 gg.createAndDisplayGO(id_p_on_arc3)

Download this script


Creation of a Line

1 # Creation of a Line
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 p100 = geompy.MakeVertexWithRef(p0, 100., 100., 100.)
13 px = geompy.MakeVertex(100., 0. , 0. )
14 py = geompy.MakeVertex(0. , 100., 0. )
15 pz = geompy.MakeVertex(0. , 0. , 100.)
16 
17 # create a vector from two points
18 vxy = geompy.MakeVector(px, py)
19 
20 # create a line from a point and a vector
21 line1 = geompy.MakeLine(pz, vxy)
22 
23 #create a line from two points
24 line2 = geompy.MakeLineTwoPnt(p0, p100)
25 
26 # add objects in the study
27 id_vxy = geompy.addToStudy(vxy, "Vector")
28 id_line1 = geompy.addToStudy(line1,"Line1")
29 id_line2 = geompy.addToStudy(line2,"Line2")
30 
31 # display lines
32 gg.createAndDisplayGO(id_vxy)
33 gg.createAndDisplayGO(id_line1)
34 gg.createAndDisplayGO(id_line2)

Download this script


Creation of a Circle

1 # Creation of a Circle
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 px = geompy.MakeVertex(100., 0. , 0. )
13 py = geompy.MakeVertex(0. , 100., 0. )
14 pz = geompy.MakeVertex(0. , 0. , 100.)
15 
16 # create a vector on two points
17 vxy = geompy.MakeVector(px, py)
18 
19 # create a circle from a point, a vector and a radius
20 circle1 = geompy.MakeCircle(pz, vxy, 30)
21 
22 #create a circle from three points
23 circle2 = geompy.MakeCircleThreePnt(p0, px, py)
24 
25 # add objects in the study
26 id_vxy = geompy.addToStudy(vxy, "Vector")
27 id_circle1 = geompy.addToStudy(circle1,"Circle1")
28 id_circle2 = geompy.addToStudy(circle2,"Circle2")
29 
30 # display circles
31 gg.createAndDisplayGO(id_vxy)
32 gg.createAndDisplayGO(id_circle1)
33 gg.createAndDisplayGO(id_circle2)

Download this script


Creation of an Ellipse

1 # Creation of an Ellipse
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 p1 = geompy.MakeVertex(50., 50., 50.)
13 p2 = geompy.MakeVertex(0., 50., 0.)
14 
15 # create a normal vector from two points
16 normal = geompy.MakeVector(p0, p1)
17 
18 # create a major axis vector from two points
19 major = geompy.MakeVector(p0, p2)
20 
21 # create an ellipse from a point, a vector and radiuses
22 ellipse1 = geompy.MakeEllipse(p1, normal, 50, 25)
23 
24 # create an ellipse from a point, a normal vector, radiuses and a major axis vector
25 ellipse2 = geompy.MakeEllipse(p1, normal, 50, 25, major)
26 
27 # add objects in the study
28 id_normal = geompy.addToStudy(normal, "Normal")
29 id_major = geompy.addToStudy(major, "Major Axis")
30 id_ellipse1 = geompy.addToStudy(ellipse1, "Ellipse 1")
31 id_ellipse2 = geompy.addToStudy(ellipse2, "Ellipse 2")
32 
33 # display the ellipse and its normal vector
34 gg.createAndDisplayGO(id_normal)
35 gg.createAndDisplayGO(id_major)
36 gg.createAndDisplayGO(id_ellipse1)
37 gg.createAndDisplayGO(id_ellipse2)

Download this script


Creation of an Arc

1 # Creation of an Arc
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 p1 = geompy.MakeVertex(100., 0., 0.)
13 p2 = geompy.MakeVertex(50., 0., 50.)
14 
15 # create an arc from a three points
16 arc1 = geompy.MakeArc(p0, p1, p2)
17 
18 # create an arc from a center point, a start point and end point
19 arc2 = geompy.MakeArcCenter(p0, p1, p2, 1)
20 
21 # create an arc from a center point, a major point and minor point
22 arc3 = geompy.MakeArcOfEllipse(p0, p1, p2)
23 
24 # add objects in the study
25 id_arc1 = geompy.addToStudy(arc1, "Arc 1")
26 id_arc2 = geompy.addToStudy(arc2, "Arc 2")
27 id_arc3 = geompy.addToStudy(arc3, "Arc 3")
28 
29 # display the arcs
30 gg.createAndDisplayGO(id_arc1)
31 gg.createAndDisplayGO(id_arc2)
32 gg.createAndDisplayGO(id_arc3)

Download this script


Creation of a Curve

1 # Creation of a Curve
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices and vectors
11 p0 = geompy.MakeVertex(0. , 0. , 0. )
12 p1 = geompy.MakeVertex(50. , 100., 200.)
13 p2 = geompy.MakeVertex(150., 50., 100.)
14 p3 = geompy.MakeVertex(100., 150., 170.)
15 p4 = geompy.MakeVertex(200., 200., 150.)
16 
17 v1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
18 v2 = geompy.MakeVectorDXDYDZ(1, 0, 0)
19 
20 # create a polyline from a list of points
21 polyline = geompy.MakePolyline([p0, p1, p2, p3, p4])
22 closed_polyline = geompy.MakePolyline([p0, p1, p2, p0])
23 
24 # create a bezier curve from a list of points
25 bezier = geompy.MakeBezier([p0, p1, p2, p3, p4])
26 
27 #create a b-spline curve from a list of points
28 interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4], False)
29 
30 #create a b-spline curve with defined directions at the ends
31 interpol_tangents = geompy.MakeInterpolWithTangents([p0, p1, p2, p3, p4], v1, v2)
32 
33 #create a polyline using parametric definition of the basic points
34 param_polyline = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, GEOM.Polyline, theNewMethod=True)
35 
36 # create a bezier curve using parametric definition of the basic points
37 param_bezier = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 20, GEOM.Bezier, theNewMethod=True)
38 
39 #create a b-spline curve using parametric definition of the basic points
40 param_interpol = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, GEOM.Interpolation, theNewMethod=True)
41 
42 #create a face from closed polyline
43 face = geompy.MakeFace(closed_polyline, True)
44 
45 #create an U-isoline curve
46 isoline = geompy.MakeIsoline(face, True, 0.6)
47 
48 # add objects in the study
49 id_p0 = geompy.addToStudy(p0, "Point1")
50 id_p1 = geompy.addToStudy(p1, "Point2")
51 id_p2 = geompy.addToStudy(p2, "Point3")
52 id_p3 = geompy.addToStudy(p3, "Point4")
53 id_p4 = geompy.addToStudy(p4, "Point5")
54 id_v1 = geompy.addToStudy(v1, "Vector1")
55 id_v2 = geompy.addToStudy(v2, "Vector2")
56 id_polyline = geompy.addToStudy(polyline, "Polyline")
57 id_closed_polyline = geompy.addToStudy(closed_polyline, "Closed Polyline")
58 id_bezier = geompy.addToStudy(bezier, "Bezier")
59 id_interpol = geompy.addToStudy(interpol, "Interpol")
60 id_interpol_tangents = geompy.addToStudy(interpol_tangents, "Interpol Tangents")
61 id_param_polyline = geompy.addToStudy(param_polyline, "Polyline Parametric")
62 id_param_bezier = geompy.addToStudy(param_bezier, "Bezier Parametric")
63 id_param_interpol = geompy.addToStudy(param_interpol, "Interpol Parametric")
64 id_face = geompy.addToStudy(face, "Face")
65 id_isoline = geompy.addToStudy(isoline, "Isoline")
66 
67 
68 # display the points and the curves
69 gg.createAndDisplayGO(id_p0)
70 gg.createAndDisplayGO(id_p1)
71 gg.createAndDisplayGO(id_p2)
72 gg.createAndDisplayGO(id_p3)
73 gg.createAndDisplayGO(id_p4)
74 gg.createAndDisplayGO(id_polyline)
75 gg.createAndDisplayGO(id_closed_polyline)
76 gg.createAndDisplayGO(id_bezier)
77 gg.createAndDisplayGO(id_interpol)
78 gg.createAndDisplayGO(id_interpol_tangents)
79 gg.createAndDisplayGO(id_param_polyline)
80 gg.createAndDisplayGO(id_param_bezier)
81 gg.createAndDisplayGO(id_param_interpol)
82 gg.createAndDisplayGO(id_face)
83 gg.createAndDisplayGO(id_isoline)

Download this script


Creation of a Vector

1 # Creation of a Vector
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p1 = geompy.MakeVertex(10., 50., 20.)
12 p2 = geompy.MakeVertex(70., 70., 70.)
13 
14 # create a vector from two points
15 vector1 = geompy.MakeVector(p1, p2)
16 
17 # create a vector from the given components
18 vector2 = geompy.MakeVectorDXDYDZ(30, 30, 100)
19 
20 # add objects in the study
21 id_p1 = geompy.addToStudy(p1, "Point1")
22 id_p2 = geompy.addToStudy(p2, "Point2")
23 id_vector1 = geompy.addToStudy(vector1,"Vector1")
24 id_vector2 = geompy.addToStudy(vector2,"Vector2")
25 
26 # display the points and the vectors
27 gg.createAndDisplayGO(id_p1)
28 gg.createAndDisplayGO(id_p2)
29 gg.createAndDisplayGO(id_vector1)
30 gg.createAndDisplayGO(id_vector2)

Download this script


Creation of a Plane

1 # Creation of a Plane
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p1 = geompy.MakeVertex( 0., 0., 100.)
12 p2 = geompy.MakeVertex(100., 0., 0.)
13 p3 = geompy.MakeVertex(200., 200., 200.)
14 p4 = geompy.MakeVertex(100., 100., 0.)
15 p5 = geompy.MakeVertex(0. , 100., 0.)
16 
17 # create a vectors from the given components
18 vector1 = geompy.MakeVectorDXDYDZ(100., 100., 100.)
19 vector2 = geompy.MakeVectorDXDYDZ(-100., 0., 100.)
20 
21 # create a vector from two points
22 vector_arc = geompy.MakeVector(p2, p5)
23 
24 # create an arc from three points
25 arc = geompy.MakeArc(p2, p4, p5)
26 
27 # create a wire
28 wire = geompy.MakeWire([vector_arc, arc])
29 
30 # create a face
31 isPlanarWanted = 1
32 face = geompy.MakeFace(wire, isPlanarWanted)
33 trimsize = 1000.
34 
35 # create a Local Coordinate System
36 
37 LCS = geompy.MakeMarker(100., 100., 101., 1, 0, 0, 0, 1, 0)
38 
39 # create a plane from a point, a vector and a trimsize
40 plane1 = geompy.MakePlane(p1, vector1, trimsize)
41 
42 # create a plane from three points and a trimsize
43 plane2 = geompy.MakePlaneThreePnt(p1, p2, p3, trimsize)
44 
45 # create a plane from the given face
46 plane3 = geompy.MakePlaneFace(face, trimsize)
47 
48 # create a plane from two vectors and a trimsize
49 plane4 = geompy.MakePlane2Vec(vector1, vector2, trimsize)
50 
51 # create a plane with the Local Coordinate System and a trimsize
52 plane5 = geompy.MakePlaneLCS(LCS, trimsize, 1)
53 
54 # add objects in the study
55 id_face = geompy.addToStudy(face, "Face")
56 id_plane1 = geompy.addToStudy(plane1,"Plane1")
57 id_plane2 = geompy.addToStudy(plane2,"Plane2")
58 id_plane3 = geompy.addToStudy(plane3,"Plane3")
59 id_plane4 = geompy.addToStudy(plane4,"Plane4")
60 id_plane5 = geompy.addToStudy(plane5,"Plane5")
61 
62 # display the points and the vectors
63 gg.createAndDisplayGO(id_face)
64 gg.createAndDisplayGO(id_plane1)
65 gg.createAndDisplayGO(id_plane2)
66 gg.createAndDisplayGO(id_plane3)
67 gg.createAndDisplayGO(id_plane4)
68 gg.createAndDisplayGO(id_plane5)
69 gg.setDisplayMode(id_plane1,1)
70 gg.setTransparency(id_plane1,0.5)
71 gg.setDisplayMode(id_plane2,1)
72 gg.setTransparency(id_plane2,0.5)
73 gg.setDisplayMode(id_plane3,1)
74 gg.setTransparency(id_plane3,0.5)
75 gg.setDisplayMode(id_plane4,1)
76 gg.setTransparency(id_plane4,0.5)
77 gg.setDisplayMode(id_plane5,1)
78 gg.setTransparency(id_plane5,0.5)

Download this script


Creation of a Local Coordinate System

1 # Creation of a Local Coordinate System
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 import math
9 import SALOMEDS
10 
11 #Create vertexes, vectors and shapes to construct local CS
12 Vertex_1 = geompy.MakeVertex(50, 50, 50)
13 Vertex_2 = geompy.MakeVertex(70, 70, 70)
14 Vertex_3 = geompy.MakeVertex(0, 0, 0)
15 Vector_X = geompy.MakeVectorDXDYDZ(50, 0, 0)
16 Vector_Y = geompy.MakeVectorDXDYDZ(0, 50, 0)
17 Face_1 = geompy.MakeFaceHW(100, 100, 1)
18 Box_1 = geompy.MakeBoxTwoPnt(Vertex_1, Vertex_2)
19 
20 #Construct local CS by manual definition
21 LocalCS_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
22 
23 #Construct local CS by center point and two vectors (X and Y directions)
24 LocalCS_2 = geompy.MakeMarkerPntTwoVec(Vertex_3, Vector_X, Vector_Y)
25 
26 #Construct local CS from shape orientation
27 LocalCS_FACE = geompy.MakeMarkerFromShape(Face_1)
28 LocalCS_BOX = geompy.MakeMarkerFromShape(Box_1)
29 
30 #Add created object to study
31 geompy.addToStudy( Face_1, "Face_1" )
32 geompy.addToStudy( Vertex_1, "Vertex_1" )
33 geompy.addToStudy( Vertex_2, "Vertex_2" )
34 geompy.addToStudy( Box_1, "Box_1" )
35 geompy.addToStudy( Vertex_3, "Vertex_3" )
36 geompy.addToStudy( Vector_X, "Vector_X" )
37 geompy.addToStudy( Vector_Y, "Vector_Y" )
38 geompy.addToStudy( LocalCS_1, "LocalCS_1" )
39 geompy.addToStudy( LocalCS_2, "LocalCS_3" )
40 geompy.addToStudy( LocalCS_FACE, "LocalCS_FACE" )
41 geompy.addToStudy( LocalCS_BOX, "LocalCS_BOX" )

Download this script


Creation of a Surface From Face

1 # Creation of a Surface From Face
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 import math
9 import SALOMEDS
10 
11 # Create Vertices, Edges, Wire, Face and Disk
12 Vertex_1 = geompy.MakeVertex(0, 0, 0)
13 Vertex_2 = geompy.MakeVertex(100, 0, 0)
14 Vertex_3 = geompy.MakeVertex(50, 100, 0)
15 Edge_1 = geompy.MakeEdge(Vertex_1, Vertex_2)
16 Edge_2 = geompy.MakeEdge(Vertex_2, Vertex_3)
17 Edge_3 = geompy.MakeEdge(Vertex_3, Vertex_1)
18 Wire_1 = geompy.MakeWire([Edge_1, Edge_2, Edge_3])
19 Face_1 = geompy.MakeFace(Wire_1, True)
20 Disk_1 = geompy.MakeDiskR(100, 1)
21 
22 # Create Surfaces From Faces.
23 SurfaceFromFace_1 = geompy.MakeSurfaceFromFace(Face_1)
24 SurfaceFromFace_2 = geompy.MakeSurfaceFromFace(Disk_1)
25 
26 #Add created object to study
27 geompy.addToStudy( Vertex_1, "Vertex_1" )
28 geompy.addToStudy( Vertex_2, "Vertex_2" )
29 geompy.addToStudy( Vertex_3, "Vertex_3" )
30 geompy.addToStudy( Edge_1, "Edge_1" )
31 geompy.addToStudy( Edge_2, "Edge_2" )
32 geompy.addToStudy( Edge_3, "Edge_3" )
33 geompy.addToStudy( Wire_1, "Wire_1" )
34 geompy.addToStudy( Face_1, "Face_1" )
35 geompy.addToStudy( Disk_1, "Disk_1" )
36 geompy.addToStudy( SurfaceFromFace_1, "SurfaceFromFace_1" )
37 geompy.addToStudy( SurfaceFromFace_2, "SurfaceFromFace_2" )

Download this script


Creation of 2D Polyline

1 # 2D polyline
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI("GEOM")
9 
10 # create vertices
11 p1 = geompy.MakeVertex(70., 0., 0.)
12 p2 = geompy.MakeVertex(70., 70., 80.)
13 p3 = geompy.MakeVertex( 0., 70., 0.)
14 
15 #create a vector from two points
16 vector_arc = geompy.MakeVector(p1, p3)
17 
18 # create an arc from three points
19 arc = geompy.MakeArc(p1, p2, p3)
20 
21 # create a wire
22 wire = geompy.MakeWire([vector_arc, arc])
23 
24 # create a planar face
25 isPlanarWanted = 1
26 face = geompy.MakeFace(wire, isPlanarWanted)
27 
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])
32 
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)
37 
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")
42 
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)

Download this script