6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
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.)
19 Arc = geompy.MakeArc(py, pz, px)
21 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
23 p_on_arc2 = geompy.MakeVertexOnCurveByLength(Arc, 50.,
None)
25 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
28 line_1 = geompy.MakeLineTwoPnt(p0, p100)
29 line_2 = geompy.MakeLineTwoPnt(p1, pz)
30 p_inter = geompy.MakeVertexOnLinesIntersection(line_1, line_2)
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)
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")
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)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
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.)
18 vxy = geompy.MakeVector(px, py)
21 line1 = geompy.MakeLine(pz, vxy)
24 line2 = geompy.MakeLineTwoPnt(p0, p100)
27 id_vxy = geompy.addToStudy(vxy,
"Vector")
28 id_line1 = geompy.addToStudy(line1,
"Line1")
29 id_line2 = geompy.addToStudy(line2,
"Line2")
32 gg.createAndDisplayGO(id_vxy)
33 gg.createAndDisplayGO(id_line1)
34 gg.createAndDisplayGO(id_line2)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
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.)
17 vxy = geompy.MakeVector(px, py)
20 circle1 = geompy.MakeCircle(pz, vxy, 30)
23 circle2 = geompy.MakeCircleThreePnt(p0, px, py)
26 id_vxy = geompy.addToStudy(vxy,
"Vector")
27 id_circle1 = geompy.addToStudy(circle1,
"Circle1")
28 id_circle2 = geompy.addToStudy(circle2,
"Circle2")
31 gg.createAndDisplayGO(id_vxy)
32 gg.createAndDisplayGO(id_circle1)
33 gg.createAndDisplayGO(id_circle2)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 p1 = geompy.MakeVertex(50., 50., 50.)
13 p2 = geompy.MakeVertex(0., 50., 0.)
16 normal = geompy.MakeVector(p0, p1)
19 major = geompy.MakeVector(p0, p2)
22 ellipse1 = geompy.MakeEllipse(p1, normal, 50, 25)
25 ellipse2 = geompy.MakeEllipse(p1, normal, 50, 25, major)
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")
34 gg.createAndDisplayGO(id_normal)
35 gg.createAndDisplayGO(id_major)
36 gg.createAndDisplayGO(id_ellipse1)
37 gg.createAndDisplayGO(id_ellipse2)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p0 = geompy.MakeVertex(0., 0., 0.)
12 p1 = geompy.MakeVertex(100., 0., 0.)
13 p2 = geompy.MakeVertex(50., 0., 50.)
16 arc1 = geompy.MakeArc(p0, p1, p2)
19 arc2 = geompy.MakeArcCenter(p0, p1, p2, 1)
22 arc3 = geompy.MakeArcOfEllipse(p0, p1, p2)
25 id_arc1 = geompy.addToStudy(arc1,
"Arc 1")
26 id_arc2 = geompy.addToStudy(arc2,
"Arc 2")
27 id_arc3 = geompy.addToStudy(arc3,
"Arc 3")
30 gg.createAndDisplayGO(id_arc1)
31 gg.createAndDisplayGO(id_arc2)
32 gg.createAndDisplayGO(id_arc3)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
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.)
17 v1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
18 v2 = geompy.MakeVectorDXDYDZ(1, 0, 0)
21 polyline = geompy.MakePolyline([p0, p1, p2, p3, p4])
22 closed_polyline = geompy.MakePolyline([p0, p1, p2, p0])
25 bezier = geompy.MakeBezier([p0, p1, p2, p3, p4])
28 interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4],
False)
31 interpol_tangents = geompy.MakeInterpolWithTangents([p0, p1, p2, p3, p4], v1, v2)
34 param_polyline = geompy.MakeCurveParametric(
"t",
"sin(t)",
"cos(t)", 0., 100., 100, GEOM.Polyline, theNewMethod=
True)
37 param_bezier = geompy.MakeCurveParametric(
"t",
"sin(t)",
"cos(t)", 0., 100., 20, GEOM.Bezier, theNewMethod=
True)
40 param_interpol = geompy.MakeCurveParametric(
"t",
"sin(t)",
"cos(t)", 0., 100., 100, GEOM.Interpolation, theNewMethod=
True)
43 face = geompy.MakeFace(closed_polyline,
True)
46 isoline = geompy.MakeIsoline(face,
True, 0.6)
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")
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)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
11 p1 = geompy.MakeVertex(10., 50., 20.)
12 p2 = geompy.MakeVertex(70., 70., 70.)
15 vector1 = geompy.MakeVector(p1, p2)
18 vector2 = geompy.MakeVectorDXDYDZ(30, 30, 100)
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")
27 gg.createAndDisplayGO(id_p1)
28 gg.createAndDisplayGO(id_p2)
29 gg.createAndDisplayGO(id_vector1)
30 gg.createAndDisplayGO(id_vector2)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 gg = salome.ImportComponentGUI(
"GEOM")
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.)
18 vector1 = geompy.MakeVectorDXDYDZ(100., 100., 100.)
19 vector2 = geompy.MakeVectorDXDYDZ(-100., 0., 100.)
22 vector_arc = geompy.MakeVector(p2, p5)
25 arc = geompy.MakeArc(p2, p4, p5)
28 wire = geompy.MakeWire([vector_arc, arc])
32 face = geompy.MakeFace(wire, isPlanarWanted)
37 LCS = geompy.MakeMarker(100., 100., 101., 1, 0, 0, 0, 1, 0)
40 plane1 = geompy.MakePlane(p1, vector1, trimsize)
43 plane2 = geompy.MakePlaneThreePnt(p1, p2, p3, trimsize)
46 plane3 = geompy.MakePlaneFace(face, trimsize)
49 plane4 = geompy.MakePlane2Vec(vector1, vector2, trimsize)
52 plane5 = geompy.MakePlaneLCS(LCS, trimsize, 1)
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")
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)
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
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)
21 LocalCS_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
24 LocalCS_2 = geompy.MakeMarkerPntTwoVec(Vertex_3, Vector_X, Vector_Y)
27 LocalCS_FACE = geompy.MakeMarkerFromShape(Face_1)
28 LocalCS_BOX = geompy.MakeMarkerFromShape(Box_1)
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" )
6 from salome.geom
import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
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)
23 SurfaceFromFace_1 = geompy.MakeSurfaceFromFace(Face_1)
24 SurfaceFromFace_2 = geompy.MakeSurfaceFromFace(Disk_1)
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" )
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.)
16 vector_arc = geompy.MakeVector(p1, p3)
19 arc = geompy.MakeArc(p1, p2, p3)
22 wire = geompy.MakeWire([vector_arc, arc])
26 face = geompy.MakeFace(wire, isPlanarWanted)
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)
39 id_face = geompy.addToStudy(face,
"Face")
40 id_polyline1 = geompy.addToStudy(polyline1,
"Polyline1")
41 id_polyline2 = geompy.addToStudy(polyline2,
"Polyline2")
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)