From: Paul RASCLE Date: Wed, 10 Dec 2014 15:37:01 +0000 (+0100) Subject: adaptation patch OCC 6.8.0 et probleme prolongation wire X-Git-Tag: V7_8_0a1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2475437e5dfa27df324e347ce7e9bf519daf026f;p=modules%2Fsmesh.git adaptation patch OCC 6.8.0 et probleme prolongation wire --- diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index c2bcf776d..2feaec3a8 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -60,7 +60,7 @@ class faceGauche_2(fissureGenerique): shellFiss = geompy.ImportFile(os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep"), "BREP") fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"]) - geompy.UnionIDs(fondFiss, [14, 7]) + geompy.UnionIDs(fondFiss, [14, 9]) geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) diff --git a/src/Tools/blocFissure/gmu/prolongeWire.py b/src/Tools/blocFissure/gmu/prolongeWire.py index 72e766dff..916a8433c 100644 --- a/src/Tools/blocFissure/gmu/prolongeWire.py +++ b/src/Tools/blocFissure/gmu/prolongeWire.py @@ -2,6 +2,7 @@ import logging from geomsmesh import geompy +from orderEdgesFromWire import orderEdgesFromWire # ----------------------------------------------------------------------------- # --- prolongation d'un wire par deux segments tangents @@ -12,8 +13,11 @@ def prolongeWire(aWire, extrem, norms, long): logging.info("start") if geompy.NumberOfEdges(aWire) > 1: edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"]) + uneSeuleEdge = False else: edges = [aWire] + uneSeuleEdge = True + edgesBout = [] for i, v1 in enumerate(extrem): exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-long, long)] dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)] @@ -22,8 +26,31 @@ def prolongeWire(aWire, extrem, norms, long): #v2 = geompy.MakeTranslationVectorDistance(v1, norms[i], long) edge = geompy.MakeEdge(v1, v2) edges.append(edge) + edgesBout.append(edge) name = "extrem%d"%i - #geompy.addToStudy(edge,name) - wireProlonge = geompy.MakeWire(edges) - geompy.addToStudy(wireProlonge, "wireProlonge") + geompy.addToStudy(edge,name) + try: + wireProlonge = geompy.MakeWire(edges) + geompy.addToStudy(wireProlonge, "wireProlonge") + except: + logging.warning("probleme MakeWire, approche pas a pas") + if uneSeuleEdge: + edgelist = [aWire] + accessList = [0] + else: + edgelist, accessList = orderEdgesFromWire(aWire) + edge1 = edgelist[accessList[0]] + if geompy.MinDistance(edgesBout[0], edge1) < 1.e-4 : + i0 = 0 + i1 = 1 + else: + i0 = 1 + i1 = 0 + wireProlonge = edgesBout[i0] + for i in range(len(edgelist)): + wireProlonge = geompy.MakeWire([wireProlonge, edgelist[accessList[i]]]) + geompy.addToStudy(wireProlonge, "wireProlonge_%d"%i) + wireProlonge = geompy.MakeWire([wireProlonge,edgesBout[i1]]) + geompy.addToStudy(wireProlonge, "wireNonProlonge") + logging.warning("prolongation wire pas a pas OK") return wireProlonge diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche.py b/src/Tools/blocFissure/materielCasTests/fissureGauche.py index 6efe23942..2660e04de 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche.py @@ -43,7 +43,7 @@ geomObj_3 = geompy.MakeCylinderRH(1450, 8000) Cylinder_3 = geompy.MakeRotation(geomObj_3, OZ, 180*math.pi/180.0) Cut_1 = geompy.MakeCut(Partition_1, Cylinder_3) geompy.addToStudy( Cut_1, 'Cut_1' ) -[faceFiss1] = geompy.SubShapes(Cut_1, [63]) +[faceFiss1] = geompy.SubShapes(Cut_1, [61]) geompy.addToStudyInFather( Cut_1, faceFiss1, 'faceFiss1' ) [Vertex_3,geomObj_4] = geompy.SubShapes(faceFiss1, [4, 5]) Cylinder_4 = geompy.MakeCylinderRH(2000, 4000) diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py index 420118628..289102c69 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py @@ -43,7 +43,7 @@ objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, 180*math.pi/180.0) Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0) geompy.addToStudy( Partition_2, 'Partition_2' ) -[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [17]) +[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13]) geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) Plane_1 = geompy.MakePlaneLCS(None, 2000, 3) FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)