- meshFondExt = smesh.Mesh(wireFondFiss)
- algo1d = meshFondExt.Segment()
- hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
- isDone = meshFondExt.Compute()
-
- ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
- allNodeIds = meshFondExt.GetNodesId()
- for nodeId in allNodeIds:
- xyz = meshFondExt.GetNodeXYZ(nodeId)
- #logging.debug("nodeId %s, coords %s", nodeId, str(xyz))
- pt = geompy.MakeVertex(xyz[0], xyz[1], xyz[2])
- u, PointOnEdge, EdgeInWireIndex = geompy.MakeProjectionOnWire(pt, wireFondFiss) # u compris entre 0 et 1
- edgeOrder = edgesIdByOrientation[EdgeInWireIndex]
- ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt
- #logging.debug("nodeId %s, u %s", nodeId, str(u))
- usort = sorted(ptGSdic)
- logging.debug("nombre de points obtenus par deflexion %s",len(usort))
-
- centres = []
- origins = []
- normals = []
- for edu in usort:
- ied = edu[1]
- u = edu[2]
- vertcx = ptGSdic[edu]
- norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
- plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
- part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0)
- liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
- if len(liste) == 5: # 4 coins du plan plus intersection recherchée
- for point in liste:
- if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin
- vertpx = point
- break
- centres.append(vertcx)
- origins.append(vertpx)
- normals.append(norm)
-# name = "vertcx%d"%i
-# geompy.addToStudyInFather(wireFondFiss, vertcx, name)
-# name = "vertpx%d"%i
-# geompy.addToStudyInFather(wireFondFiss, vertpx, name)
-# name = "plan%d"%i
-# geompy.addToStudyInFather(wireFondFiss, plan, name)