# ---tous les cas en sequence, ou les cas selectionnés ...
-runall = True
+runall = False
if runall:
torun = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,]
else: #prob 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublishDebug
+from geomsmesh import geomPublishDebugInFather
+
from substractSubShapes import substractSubShapes
def identifieEdgesPeau(edgesFissExtPipe,verticesPipePeau, facePeau, facesPeauSorted,
nameEdge = "edgeRadFacePipePeau%d"%i
facesPipePeau[i] = face
endsEdgeFond[i] = sharedVertices[0]
- geompy.addToStudy(face, nameFace)
- geompy.addToStudy(sharedVertices[0], nameVert)
+ geomPublishDebug(face, nameFace)
+ geomPublishDebug(sharedVertices[0], nameVert)
edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
for edge in edgesFace:
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
edgeRadFacePipePeau[i] = edge
- geompy.addToStudy(edge, nameEdge)
+ geomPublishDebug(edge, nameEdge)
break
pass
pass
geompy.UnionList(grpEdgesCirc, edges)
edgesCircPeau[i] = grpEdgesCirc
name = "edgeCirc%d"%i
- geompy.addToStudyInFather(facePeau, grpEdgesCirc, name)
+ geomPublishDebugInFather(facePeau, grpEdgesCirc, name)
edgesListees = edgesListees + edges
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
geompy.UnionList(grpVertCircPeau, vertices)
verticesCircPeau[i] = grpVertCircPeau
name = "pointEdgeCirc%d"%i
- geompy.addToStudyInFather(facePeau, grpVertCircPeau, name)
+ geomPublishDebugInFather(facePeau, grpVertCircPeau, name)
pass
pass # --- au moins une extrémité du pipe sur cette face de peau
for i, edge in enumerate(edgesFilling):
edgepeau = geompy.GetInPlace(facePeau, edge)
name = "edgepeau%d"%i
- geompy.addToStudyInFather(facePeau,edgepeau, name)
+ geomPublishDebugInFather(facePeau,edgepeau, name)
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
logging.debug(" EDGES multiples")
if aretesVivesC is not None:
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
if bordsVifs is not None:
- geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs")
+ geomPublishDebugInFather(facePeau, bordsVifs, "bordsVifs")
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
grptmp = None
if len(aretesVivesCoupees) > 0:
edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
aretesVivesCoupees += edv
logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
- geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
+ geomPublishDebugInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
# --- edges de la face de peau partagées avec la face de fissure
if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
edgesFissurePeau[i] = edge
name = "edgeFissurePeau%d"%i
- geompy.addToStudyInFather(facePeau, edge, name)
+ geomPublishDebugInFather(facePeau, edge, name)
for edge in edges: # on ajoute après les edges manquantes
if edge not in edgesFissurePeau:
edgesFissurePeau.append(edge)
for i, edge in enumerate(edges):
edgesFissurePeau.append(edge)
name = "edgeFissurePeau%d"%i
- geompy.addToStudyInFather(facePeau, edge, name)
+ geomPublishDebugInFather(facePeau, edge, name)
return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
# -*- coding: utf-8 -*-
import logging
+loglevel = 3
def setDebug():
+ global loglevel
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
level=logging.DEBUG)
- logging.info('start Debug')
+ loglevel = 1
+ logging.info('start Debug %s', loglevel)
def setVerbose():
+ global loglevel
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
level=logging.INFO)
- logging.info('start Verbose')
+ loglevel = 2
+ logging.info('start Verbose %s', loglevel)
def setRelease():
+ global loglevel
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
level=logging.WARNING)
- logging.warning('start Release')
+ loglevel = 3
+ logging.warning('start Release %s', loglevel)
def setUnitTests():
+ global loglevel
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
level=logging.CRITICAL)
- logging.critical('start UnitTests')
+ loglevel = 4
+ logging.critical('start UnitTests %s', loglevel)
def setPerfTests():
+ global loglevel
logging.basicConfig(format='%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s',
level=logging.CRITICAL)
- logging.info('start PerfTests')
+ loglevel = 5
+ logging.info('start PerfTests %s', loglevel)
+
+def getLogLevel():
+ return loglevel
#logging.basicConfig(filename='myapp.log',
# format='%(asctime)s %(message)s',