import geompy
import salome
+import math
gg = salome.ImportComponentGUI("GEOM")
# create path
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)
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)
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)