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' )
import logging
from geomsmesh import geompy
+from orderEdgesFromWire import orderEdgesFromWire
# -----------------------------------------------------------------------------
# --- prolongation d'un wire par deux segments tangents
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)]
#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
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)
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)