Fix example test scripts

This commit is contained in:
akl 2013-02-20 13:52:17 +00:00
parent cee2bc8752
commit b78679f31c
3 changed files with 40 additions and 36 deletions

View File

@ -27,8 +27,6 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
pyexamplesdir = $(docdir)/examples/GEOM
BAD_TESTS = \
angle.py \
complex_objs_ex06.py \
repairing_operations_ex09.py
GOOD_TESTS = \
@ -36,6 +34,7 @@ GOOD_TESTS = \
advanced_geom_objs_ex01.py \
advanced_geom_objs_ex02.py \
advanced_geom_objs_ex03.py \
angle.py \
basic_geom_objs_ex01.py \
basic_geom_objs_ex02.py \
basic_geom_objs_ex03.py \
@ -68,6 +67,7 @@ GOOD_TESTS = \
complex_objs_ex03.py \
complex_objs_ex04.py \
complex_objs_ex05.py \
complex_objs_ex06.py \
complex_objs_ex07.py \
complex_objs_ex08.py \
complex_objs_ex09.py \

View File

@ -53,8 +53,11 @@ pnt1 = geompy.MakeVertex(0, 0, 0)
pnt2 = geompy.MakeVertex(10, 0, 0)
pnt3 = geompy.MakeVertex(20, 10, 0)
arc = geompy.MakeArc(pnt1, pnt2, pnt3)
Angle = geompy.GetAngle(OX, arc)
if (math.fabs(Angle + 1.0) > 1e-6 or geompy.MeasuOp.IsDone()):
print "Error. Angle must not be computed on curvilinear edges"
try:
Angle = geompy.GetAngle(OX, arc)
pass
except:
# It is a correct case, because GetAngle() must not be computed on curvilinear edges.
pass
assert (not geompy.MeasuOp.IsDone() ), 'Angle must not be computed on curvilinear edges.'

View File

@ -2,6 +2,7 @@
import geompy
import salome
import math
gg = salome.ImportComponentGUI("GEOM")
# create path
@ -54,30 +55,30 @@ 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 = geompy.MakeArc(w,3,-1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f1 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 0:TT 0 0:TT 0 20:TT -20 20",
[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)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f2 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F 20 0:TT 0 0:TT 0 -20:TT 20 -20",
[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)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f3 = geompy.MakeFace(w,1)
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)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f4 = geompy.MakeFace(w,1)
faces.append(f1)
@ -99,30 +100,30 @@ nz = c3[2] - c2[2]
w = geompy.MakeSketcher("Sketcher:F 20 20:TT 0 20:TT 0 0:TT 20 0",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f1 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 0:TT 0 0:TT 0 20:TT -20 20",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f2 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F 20 0:TT 0 0:TT 0 -20:TT 20 -20",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f3 = geompy.MakeFace(w,1)
w = geompy.MakeSketcher("Sketcher:F -20 -20:TT 0 -20:TT 0 0:TT -20 0",
[c2[0], c2[1], c2[2], nx, ny, nz, 0, 0, 1])
[e1,e2,e3] = geompy.SubShapeAll(w, geompy.ShapeType["EDGE"])
arc = MakeArc(w,3,1)
w = geompy.MakeWire([e1,e2,e3,arc])
contour = geompy.CloseContour(w, [], isCommonVertex=False)
[e1,e2,e3,e4] = geompy.SubShapeAll(contour, geompy.ShapeType["EDGE"])
w = geompy.MakeWire([e1,e2,e3,e4])
f4 = geompy.MakeFace(w,1)
faces.append(f1)
@ -168,19 +169,19 @@ fs.append(ff)
aPartition = geompy.MakePartition(shellsph,fs)
fs = geompy.SubShapeAllSortedCentres(aPartition, geompy.ShapeType["FACE"])
faces.append(fs[0])
faces.append(fs[1])
faces.append(fs[2])
faces.append(fs[3])
for face in fs:
if ( 4 == geompy.NbShapes(face, geompy.ShapeType["VERTEX"]) ):
faces.append(face)
pass
pass
shell = geompy.MakeSewing(faces,1.e-6)
shells.append(shell)
faces = geompy.SubShapeAllSortedCentres(shell, geompy.ShapeType["FACE"])
subbases.append(faces[2])
#===========================================================
# Create Pipe
#===========================================================
subbases = []
Pipe = geompy.MakePipeWithShellSections(shells, subbases, theLocations, WirePath,
theWithContact=0, theWithCorrection=0)