Fix GEOM examples scripts.

This commit is contained in:
akl 2013-02-15 12:00:51 +00:00
parent d342cb8288
commit 1d4c921e93
7 changed files with 28 additions and 21 deletions

View 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 \

View 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)

View 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)

View 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)

View 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")

View File

@ -1,6 +1,7 @@
# Limit Tolerance
import geompy
import salome
gg = salome.ImportComponentGUI("GEOM")
# import initial topology

View 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)