]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix GEOM examples scripts.
authorakl <akl@opencascade.com>
Fri, 15 Feb 2013 12:00:51 +0000 (12:00 +0000)
committerakl <akl@opencascade.com>
Fri, 15 Feb 2013 12:00:51 +0000 (12:00 +0000)
doc/salome/examples/Makefile.am
doc/salome/examples/blocks_operations_ex03.py
doc/salome/examples/complex_objs_ex06.py
doc/salome/examples/primitives_ex06.py
doc/salome/examples/repairing_operations_ex05.py
doc/salome/examples/repairing_operations_ex09.py
doc/salome/examples/viewing_geom_objs_ex04.py

index d058efcc58ba8f15d44738b9abfaa86ee9239a1b..10fa6cba43622e2f6cf87de9732cdff1772f8321 100644 (file)
@@ -29,14 +29,8 @@ pyexamplesdir = $(docdir)/examples/GEOM
 BAD_TESTS = \
        3dsketcher.py \
        angle.py \
-       blocks_operations_ex03.py \
        complex_objs_ex06.py \
-       free_boundaries.py \
-       import_export.py \
-       primitives_ex06.py \
-       repairing_operations_ex05.py \
-       repairing_operations_ex09.py \
-       viewing_geom_objs_ex04.py 
+       repairing_operations_ex09.py 
 
 GOOD_TESTS = \
        advanced_geom_objs_ex01.py \
@@ -57,6 +51,7 @@ GOOD_TESTS = \
        basic_properties.py \
        blocks_operations_ex01.py \
        blocks_operations_ex02.py \
+       blocks_operations_ex03.py \
        boolean_operations_ex01.py \
        boolean_operations_ex02.py \
        boolean_operations_ex03.py \
@@ -77,8 +72,10 @@ GOOD_TESTS = \
        complex_objs_ex08.py \
        complex_objs_ex09.py \
        complex_objs_ex10.py \
+       free_boundaries.py \
        free_faces.py \
        get_non_blocks.py \
+       import_export.py \
        inertia.py \
        min_distance.py \
        normal_face.py \
@@ -89,11 +86,13 @@ GOOD_TESTS = \
        primitives_ex03.py \
        primitives_ex04.py \
        primitives_ex05.py \
+       primitives_ex06.py \
        primitives_ex07.py \
        repairing_operations_ex01.py \
        repairing_operations_ex02.py \
        repairing_operations_ex03.py \
        repairing_operations_ex04.py \
+       repairing_operations_ex05.py \
        repairing_operations_ex06.py \
        repairing_operations_ex07.py \
        repairing_operations_ex08.py \
@@ -123,6 +122,7 @@ GOOD_TESTS = \
        viewing_geom_objs_ex01.py \
        viewing_geom_objs_ex02.py \
        viewing_geom_objs_ex03.py \
+       viewing_geom_objs_ex04.py \
        whatis.py \
        working_with_groups_ex01.py \
        working_with_groups_ex02.py \
index 546bc22748ae03ba2d12cd811a8136ad007d7349..268a52e10f65e0b5b126aca0e807140c0a001790 100644 (file)
@@ -4,7 +4,7 @@ import geompy
 import salome
 
 # create a box
-box = geompy.MakeBoxDXDYDZ(200, 200, 200)
+check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
 
 # build all possible propagation groups
 listChains = geompy.Propagate(check_box)
index a836b35fc4acb6740e6940c4d9cbe09acaf228a3..8f6c4e35aa417de84bde205fb1e7e2d1fde7decf 100644 (file)
@@ -7,14 +7,19 @@ gg = salome.ImportComponentGUI("GEOM")
 # create path
 WirePath = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
 
+# get sub-shapes
+edges = geompy.SubShapeAll(WirePath, geompy.ShapeType["EDGE"])
+vertices = geompy.SubShapeAll(WirePath, geompy.ShapeType["VERTEX"])
+
+
 #=======================================================
 #                 Create shell sections
 #=======================================================
-ps = [Vertex_1,Vertex_2,Vertex_3,Vertex_4]
-theLocations = [Vertex_1, Vertex_2, Vertex_3, Vertex_4]
+ps = [vertices[0],vertices[1],vertices[2],vertices[3]]
+theLocations = [vertices[0],vertices[1],vertices[2],vertices[3]]
 VC = geompy.MakeCompound(theLocations)
 geompy.addToStudy(VC,"VC")
-vs = [Edge_1,Edge_1,Edge_3,Edge_3]
+vs = [edges[0],edges[0],edges[2],edges[2]]
 hs = [20,40,30,20]
 shells = []
 subbases = []
@@ -50,7 +55,7 @@ faces = []
 w = geompy.MakeSketcher("Sketcher:F 20 20:TT 0 20:TT 0 0:TT 20 0",
                          [c1[0], c1[1], c1[2], nx, ny, nz, 0, 0, 1])
 [e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
-arc = MakeArc(w,3,-1)
+arc = geompy.MakeArc(w,3,-1)
 w = geompy.MakeWire([e1,e2,e3,arc])
 f1 = geompy.MakeFace(w,1)
 
index c558eafb8fcdafe1390896571bd864d5c35001df..d3fd53e353d709f013741ff2442cb1206d027238 100644 (file)
@@ -31,5 +31,5 @@ id_disk3  = geompy.addToStudy(disk3,"Disk3")
 # display disks
 gg.createAndDisplayGO(id_vxy)
 gg.createAndDisplayGO(id_disk1)
-gg.createAndDisplayGO(id_diks2)
-gg.createAndDisplayGO(id_diks3)
+gg.createAndDisplayGO(id_disk2)
+gg.createAndDisplayGO(id_disk3)
index f6593b3e804a5749915fdec2ac9443c791d69bbe..2804991777ed7de57baa98575a84f94ae0dcf652 100644 (file)
@@ -28,13 +28,13 @@ f_2 = geompy.GetSubShapeID(cut, faces[2])
 # remove one face from the shape
 cut_without_f_2 = geompy.SuppressFaces(cut, [f_2])
 
-# get wires as sub-shapes
-wires = []
-wires = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["WIRE"])
-w_0 = geompy.GetSubShapeID(cut_without_f_2, wires[0])
+# get edges as sub-shapes
+edges = []
+edges = geompy.SubShapeAllSortedCentres(cut_without_f_2, geompy.ShapeType["EDGE"])
+e_2 = geompy.GetSubShapeID(cut_without_f_2, edges[2])
 
-# suppress the selected wire
-result = geompy.SuppressHoles(cut_without_f_2, [w_0])
+# suppress a hole using the selected edge
+result = geompy.SuppressHoles(cut_without_f_2, [e_2])
 
 # add objects in the study
 id_cut = geompy.addToStudy(cut, "Cut")
index 41807fee4d2e812af7c80df314cf241f3db061f7..7bb548758a3189bb46f158282b8ea713292e5ff5 100644 (file)
@@ -1,6 +1,7 @@
 # Limit Tolerance
 
 import geompy
+import salome
 gg = salome.ImportComponentGUI("GEOM")
 
 # import initial topology
index cf521f407e9fccab116fd19e79c3b47ea57020a8..f31edefeea4e883533c8ec44643d827173acbb9c 100644 (file)
@@ -2,8 +2,9 @@
 
 import salome
 import geompy
+import GEOM
 
-texture = geompy.LoadTexture("/users/user/mytexture.dat")
+texture = geompy.LoadTexture(os.getenv("DATA_DIR")+"/Textures/texture1.dat")
 
 v1 = geompy.MakeVertex(0, 0, 0)
 v2 = geompy.MakeVertex(100, 0, 0)