debug blocFissure: CasTests.ellipse_1

This commit is contained in:
Paul RASCLE 2016-12-05 17:54:39 +01:00
parent fd1b23f804
commit 596f40f598

View File

@ -82,24 +82,45 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
else:
maxl = geompy.BasicProperties(edge)[0]
if maxl < 0.01: # problème MakeSection
logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
logging.info("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0)
edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False)
ednouv = []
for ii, ed in enumerate(edps):
dmax=100.
vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
distx = [geompy.MinDistance(vx, face) for vx in vxs]
distx += [geompy.MinDistance(vx, nappes[k]) for vx in vxs]
dmax = max(distx)
logging.debug(" dmax %s",dmax)
if dmax < 0.01:
lgedge = geompy.BasicProperties(ed)[0]
logging.debug(" dmax %s, longueur edge %s",dmax, lgedge)
if dmax < 0.01 and lgedge > 0.01:
ednouv.append(ed)
logging.debug(" edges issues de la partition: %s", ednouv)
for ii, ed in enumerate(ednouv):
geomPublish(initLog.debug, ed, "ednouv%d"%ii)
[edsorted, minl,maxl] = sortEdges(ednouv)
logging.debug(" longueur edge trouvée: %s", maxl)
edge = edsorted[-1]
if (len(ednouv) > 0):
logging.debug(" edges issues de la partition: %s", ednouv)
for ii, ed in enumerate(ednouv):
geomPublish(initLog.debug, ed, "ednouv%d"%ii)
[edsorted, minl,maxl] = sortEdges(ednouv)
logging.debug(" longueur edge trouvée: %s", maxl)
edge = edsorted[-1]
else:
logging.info("problème partition recherche edge radiale %s", k)
vxs = geompy.ExtractShapes(partNappeFace, geompy.ShapeType["VERTEX"], False)
vxnouv=[]
for ii,vx in enumerate(vxs):
distx = geompy.MinDistance(vx, face)
distx += geompy.MinDistance(vx, nappes[k])
logging.debug("vertex distance: %s", distx)
if distx < 0.005:
vxnouv.append(vx)
logging.debug("nombre vertex candidats %s", len(vxnouv))
if len(vxnouv) >= 2:
eds = [geompy.MakeEdge(vxnouv[j],vxnouv[(j+1)%len(vxnouv)]) for j in range(len(vxnouv))]
[edsorted2, minl,maxl] = sortEdges(eds)
edge = edsorted2[-1]
logging.debug("lg edge: %s", maxl)
else:
logging.debug("problème recherche edge radiale %s non résolu", k)
edges.append(edge)
name = 'edgeEndPipe%d'%k
geomPublish(initLog.debug, edge, name)