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
- torun = [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]
+ torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,]
# -----------------------------------------------------------------------------------------------
from blocFissure.gmu import geomsmesh
# -*- coding: utf-8 -*-
import os
-from blocFissure import gmu
-from blocFissure.gmu.geomsmesh import geompy, smesh
+from geomsmesh import geompy, smesh
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import math
import GEOM
#import NETGENPlugin
import logging
-from blocFissure.gmu.fissureGenerique import fissureGenerique
+from fissureGenerique import fissureGenerique
-from blocFissure.gmu.initEtude import initEtude
-from blocFissure.gmu.triedreBase import triedreBase
-from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
-from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
-from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
+from initEtude import initEtude
+from triedreBase import triedreBase
+from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
+from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
+from construitFissureGenerale import construitFissureGenerale
O, OX, OY, OZ = triedreBase()
shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
- geompy.addToStudy( shellFiss, 'shellFiss' )
- geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
+ geomPublish(initLog.debug, shellFiss, 'shellFiss' )
+ geomPublishInFather(initLog.debug, shellFiss, fondFiss, 'fondFiss' )
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1])
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
def compoundFromList(elements, nom=None):
"""
for i,a in enumerate(shapeList):
nom = nom +"%d"%i
logging.debug('nom: %s',nom)
- geompy.addToStudy(a, nom)
+ geomPublish(initLog.debug, a, nom)
shapeCompound = None
if len(shapeList) > 0:
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
from sortEdges import sortEdges
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
name='compoundRay%d'%k
- geompy.addToStudy(comp, name)
+ geomPublish(initLog.debug, comp, name)
else:
idfin = min(len(gptsdisks), numout+1)
iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
name='compoundRay%d'%k
- geompy.addToStudy(comp, name)
+ geomPublish(initLog.debug, comp, name)
nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
nappes.append(nappe)
name='nappe%d'%k
- geompy.addToStudy(nappe, name)
+ geomPublish(initLog.debug, nappe, name)
facesDebouchantes[i] = True
listNappes.append(nappes)
if facesDebouchantes[i]:
for k, face in enumerate(facesPipePeau):
#logging.debug('i, k, face, nappes[0] %s %s %s %s', i, k, face, nappes[0])
- #geompy.addToStudy(nappes[0], 'lanappe')
- #geompy.addToStudy(face, 'laface')
+ #geomPublish(initLog.debug, nappes[0], 'lanappe')
+ #geomPublish(initLog.debug, face, 'laface')
edge = geompy.MakeSection(face, nappes[0])
if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0:
idFacesDebouchantes[i] = k
ednouv.append(ed)
logging.debug(" edges issues de la partition: %s", ednouv)
for ii, ed in enumerate(ednouv):
- geompy.addToStudy(ed, "ednouv%d"%ii)
+ geomPublish(initLog.debug, ed, "ednouv%d"%ii)
[edsorted, minl,maxl] = sortEdges(ednouv)
logging.debug(" longueur edge trouvée: %s", maxl)
edge = edsorted[-1]
edges.append(edge)
name = 'edgeEndPipe%d'%k
- geompy.addToStudy(edge, name)
+ geomPublish(initLog.debug, edge, name)
listEdges.append(edges)
return (listEdges, idFacesDebouchantes)
\ No newline at end of file
import logging
import salome
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
from geomsmesh import smesh
from salome.smesh import smeshBuilder
(fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
for i,edge in enumerate(edgesFondFiss):
- geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i)
+ geomPublishInFather(initLog.debug, wireFondFiss, edge, "edgeFondFiss%d"%i)
# --- peau et face de fissure
#
for i, avc in enumerate(aretesVivesCoupees):
name = "areteViveCoupee%d"%i
- geompy.addToStudy(avc, name)
+ geomPublish(initLog.debug, avc, name)
# --- identification des faces et edges de fissure externe pour maillage
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from checkDecoupePartition import checkDecoupePartition
# -----------------------------------------------------------------------------
fissPipePart = fissPipe
part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
partitionsPeauFissFond.append(part)
- geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart )
+ geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
else:
partitionsPeauFissFond.append(None)
ipart = ipart +1
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from projettePointSurCourbe import projettePointSurCourbe
def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
idf = -1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
centre = ptEdgeFond[idFillingFromBout[i]][idf]
name = "centre%d"%idf
- geompy.addToStudy(centre, name)
+ geomPublish(initLog.debug, centre, name)
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][idf]
- geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau")
+ geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau")
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
edgesCirc = []
for grpEdgesCirc in grpsEdgesCirc:
else:
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
name ="bout%d"%k
- geompy.addToStudyInFather(centre, bout, name)
+ geomPublishInFather(initLog.debug, centre, bout, name)
# enregistrement des points dans la structure
points = []
for j in range(nbsegRad +1):
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- crée zone géométrique défaut a partir d'un filling
trace = True
facesDefaut = filling
centreSphere = geompy.MakeCDG(shapeDefaut)
- geompy.addToStudy(centreSphere, "cdg_defaut")
+ geomPublish(initLog.debug, centreSphere, "cdg_defaut")
centreDefaut = geompy.MakeProjection(centreSphere, filling)
if trace:
- geompy.addToStudy(centreDefaut, "centreDefaut")
+ geomPublish(initLog.debug, centreDefaut, "centreDefaut")
normalDefaut = geompy.GetNormal(filling, centreDefaut)
if trace:
- geompy.addToStudy(normalDefaut, "normalDefaut")
+ geomPublish(initLog.debug, normalDefaut, "normalDefaut")
extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion)
if trace:
- geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
+ geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut")
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from prolongeVertices import prolongeVertices
# -----------------------------------------------------------------------------
curves.append(curve)
if trace:
name="poly_%d"%aShape
- geompy.addToStudy(curve, name)
+ geomPublish(initLog.debug, curve, name)
#
cdg = geompy.MakeCDG(curve)
cdgs.append(cdg)
if trace:
name="cdgpoly_%d"%aShape
- geompy.addToStudy(cdg, name)
+ geomPublish(initLog.debug, cdg, name)
#
projCdg = geompy.MakeProjection(cdg, face)
projs.append(projCdg)
if trace:
name="projCdg_%d"%aShape
- geompy.addToStudy(projCdg, name)
+ geomPublish(initLog.debug, projCdg, name)
#
normal = geompy.GetNormal(face, projCdg)
normals.append(normal)
if trace:
name="normal_%d"%aShape
- geompy.addToStudy(normal, name)
+ geomPublish(initLog.debug, normal, name)
#
extrusion = geompy.MakePrismVecH2Ways(curve, normal, 10)
extrusions.append(extrusion)
if trace:
name="extrusion_%d"%aShape
- geompy.addToStudy(extrusion, name)
+ geomPublish(initLog.debug, extrusion, name)
#
verticesProlongees = prolongeVertices(vertices)
#
curveprol = geompy.MakePolyline(verticesProlongees, False)
if trace:
name="polyProl_%d"%aShape
- geompy.addToStudy(curveprol, name)
+ geomPublish(initLog.debug, curveprol, name)
#
extruprol = geompy.MakePrismVecH2Ways(curveprol, normal, 10)
if trace:
name="extruProl_%d"%aShape
- geompy.addToStudy(extruprol, name)
+ geomPublish(initLog.debug, extruprol, name)
#
partition = geompy.MakePartition([face], [extruprol], [], [], geompy.ShapeType["FACE"], 0, [], 0)
partitions.append(partition)
if trace:
name="partition_%d"%aShape
- geompy.addToStudy(partition, name)
+ geomPublish(initLog.debug, partition, name)
pass
#
centreSphere = geompy.MakeCDG(shapeDefaut)
- geompy.addToStudy(centreSphere, "cdg_defaut")
+ geomPublish(initLog.debug, centreSphere, "cdg_defaut")
ccurves = geompy.MakeCompound(curves)
gravCenter = geompy.MakeCDG(ccurves)
- geompy.addToStudy(gravCenter, "cdg_curves")
+ geomPublish(initLog.debug, gravCenter, "cdg_curves")
for i in range(len(partitions)):
if trace:
logging.debug(" --- original shape %s", origShapes[i])
if d == minDist:
aFace = facesToSort[j]
name="decoupe_%d"%origShapes[i]
- geompy.addToStudy(aFace, name)
+ geomPublish(initLog.debug, aFace, name)
decoupes.append(aFace)
break
pass
facesDefaut = decoupes[0]
if len(decoupes) > 1:
facesDefaut = geompy.MakePartition(decoupes, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
- geompy.addToStudy(facesDefaut, "facesDefaut")
+ geomPublish(initLog.debug, facesDefaut, "facesDefaut")
shells=[]
if len(decoupes) > 1: # plusieurs faces de defaut
theFaces[k:k+1] = []
theShell = geompy.MakeShell(aShell)
name = "theShell%d"%len(shells)
- geompy.addToStudy(theShell,name)
+ geomPublish(initLog.debug, theShell,name)
shells.append(theShell)
#
distances = []
subFaces = [facesDefaut]
theShellDefaut = geompy.MakeShell(subFaces)
if trace:
- geompy.addToStudy(theShellDefaut,"theShellDefaut")
+ geomPublish(initLog.debug, theShellDefaut,"theShellDefaut")
theFaces = geompy.ExtractShapes(theShellDefaut, geompy.ShapeType["FACE"], True)
distances = []
centreDefaut = geompy.MakeProjection(centreSphere, theFaces[index])
if trace:
- geompy.addToStudy(centreDefaut, "centreDefaut")
+ geomPublish(initLog.debug, centreDefaut, "centreDefaut")
normalDefaut = geompy.GetNormal(subFaces[index], centreDefaut)
if trace:
- geompy.addToStudy(normalDefaut, "normalDefaut")
+ geomPublish(initLog.debug, normalDefaut, "normalDefaut")
extrusionDefaut = geompy.MakePrismVecH(theShellDefaut, normalDefaut, -lgExtrusion)
info = geompy.ShapeInfo(extrusionDefaut)
logging.debug("shape info %s", info)
solid0 = geompy.MakeFuse(solid0, solids[i])
extrusionDefaut = solid0
if trace:
- geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
+ geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut")
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from whichSide import whichSide
shapesInside.append(shape)
if trace:
name = prefix + "_Inside%d"%i
- geompy.addToStudyInFather(obj, shape, name)
+ geomPublishInFather(initLog.debug, obj, shape, name)
i+=1
elif side == -sideRef:
shapesOutside.append(shape)
if trace:
name = prefix + "_Outside%d"%j
- geompy.addToStudyInFather(obj, shape, name)
+ geomPublishInFather(initLog.debug, obj, shape, name)
j+=1
elif side == 0:
shapesOnside.append(shape)
if trace:
name = prefix + "_Onside%d"%k
- geompy.addToStudyInFather(obj, shape, name)
+ geomPublishInFather(initLog.debug, obj, shape, name)
k+=1
logging.debug("--- shape was %s", name)
return [shapesInside, shapesOutside, shapesOnside]
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from whichSideMulti import whichSideMulti
shapesInside.append(shape)
if trace:
name = prefix + "_Inside%d"%i
- geompy.addToStudyInFather(obj, shape, name)
+ geomPublishInFather(initLog.debug, obj, shape, name)
i+=1
elif side == -1:
shapesOutside.append(shape)
if trace:
name = prefix + "_Outside%d"%j
- geompy.addToStudyInFather(obj, shape, name)
+ geomPublishInFather(initLog.debug, obj, shape, name)
j+=1
elif side == 0:
shapesOnside.append(shape)
if trace:
name = prefix + "_Onside%d"%k
- geompy.addToStudyInFather(obj, shape, name)
+ geomPublishInFather(initLog.debug, obj, shape, name)
k+=1
logging.debug("--- shape was %s", name)
return [shapesInside, shapesOutside, shapesOnside]
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- TORE
faces = geompy.GetShapesOnShape(bloc, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
- geompy.addToStudyInFather( tore, faces[0], 'face0' )
- geompy.addToStudyInFather( tore, faces[1], 'face1' )
- geompy.addToStudyInFather( tore, faces[2], 'face2' )
- geompy.addToStudyInFather( tore, faces[3], 'face3' )
+ geomPublishInFather(initLog.debug, tore, faces[0], 'face0' )
+ geomPublishInFather(initLog.debug, tore, faces[1], 'face1' )
+ geomPublishInFather(initLog.debug, tore, faces[2], 'face2' )
+ geomPublishInFather(initLog.debug, tore, faces[3], 'face3' )
centres = [None, None, None, None]
[v1,centres[0],v3] = geompy.ExtractShapes(faces[0], geompy.ShapeType["VERTEX"], True)
[v1,centres[2],v3] = geompy.ExtractShapes(faces[2], geompy.ShapeType["VERTEX"], True)
[v1,centres[3],v3] = geompy.ExtractShapes(faces[3], geompy.ShapeType["VERTEX"], True)
- geompy.addToStudyInFather( faces[0], centres[0], 'centre0' )
- geompy.addToStudyInFather( faces[1], centres[1], 'centre1' )
- geompy.addToStudyInFather( faces[2], centres[2], 'centre2' )
- geompy.addToStudyInFather( faces[3], centres[3], 'centre3' )
+ geomPublishInFather(initLog.debug, faces[0], centres[0], 'centre0' )
+ geomPublishInFather(initLog.debug, faces[1], centres[1], 'centre1' )
+ geomPublishInFather(initLog.debug, faces[2], centres[2], 'centre2' )
+ geomPublishInFather(initLog.debug, faces[3], centres[3], 'centre3' )
alledges = [None, None, None, None]
alledges[0] = geompy.ExtractShapes(faces[0], geompy.ShapeType["EDGE"], True)
dicoedge[edgid] = edgesface[j]
edges.append(edgesface[j])
named = 'edge_' + str(i) + '_' +str(j)
- geompy.addToStudyInFather( faces[i], edgesface[j], named)
+ geomPublishInFather(initLog.debug, faces[i], edgesface[j], named)
vertices = geompy.ExtractShapes(edgesface[j], geompy.ShapeType["VERTEX"], False)
#firstVertex = geompy.GetFirstVertex(edgesface[j])
if geompy.GetSubShapeID(tore, vertices[0]) != geompy.GetSubShapeID(tore, centres[i]):
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- faces fissure dans et hors tore, et edges face hors tore
facefissintore = f1
facefissoutore = f0
- geompy.addToStudyInFather(faceFissure, facefissintore,'facefissintore')
- geompy.addToStudyInFather(faceFissure, facefissoutore,'facefissoutore')
+ geomPublishInFather(initLog.debug, faceFissure, facefissintore,'facefissintore')
+ geomPublishInFather(initLog.debug, faceFissure, facefissoutore,'facefissoutore')
edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
for i in range(len(edgeint)):
name = "edgeint_%d"%i
- geompy.addToStudyInFather(facefissoutore, edgeint[i],name)
+ geomPublishInFather(initLog.debug, facefissoutore, edgeint[i],name)
for i in range(len(edgeext)):
name = "edgeext_%d"%i
- geompy.addToStudyInFather(facefissoutore, edgeext[i],name)
+ geomPublishInFather(initLog.debug, facefissoutore, edgeext[i],name)
reverext = []
if len(edgeext) > 1:
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- identification des faces tore et fissure dans le solide hors tore du bloc partitionné
blocFaceTore1 = geompy.GetInPlaceByHistory(blocp, facetore1)
blocFaceTore2 = geompy.GetInPlaceByHistory(blocp, facetore2)
- geompy.addToStudyInFather(blocp, blocFaceFiss,'blocFaceFiss')
- geompy.addToStudyInFather(blocp, blocFaceTore1,'blocFaceTore1')
- geompy.addToStudyInFather(blocp, blocFaceTore2,'blocFaceTore2')
+ geomPublishInFather(initLog.debug, blocp, blocFaceFiss,'blocFaceFiss')
+ geomPublishInFather(initLog.debug, blocp, blocFaceTore1,'blocFaceTore1')
+ geomPublishInFather(initLog.debug, blocp, blocFaceTore2,'blocFaceTore2')
return blocFaceFiss, blocFaceTore1, blocFaceTore2
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from extractionOrientee import extractionOrientee
from getSubshapeIds import getSubshapeIds
#[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
- geompy.addToStudyInFather( tore, facetore1, 'facetore1' )
- geompy.addToStudyInFather( tore, facetore2, 'facetore2' )
+ geomPublishInFather(initLog.debug, tore, facetore1, 'facetore1' )
+ geomPublishInFather(initLog.debug, tore, facetore2, 'facetore2' )
[volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True)
- geompy.addToStudyInFather( tore, volumeTore1, 'volumeTore1' )
- geompy.addToStudyInFather( tore, volumeTore2, 'volumeTore2' )
+ geomPublishInFather(initLog.debug, tore, volumeTore1, 'volumeTore1' )
+ geomPublishInFather(initLog.debug, tore, volumeTore2, 'volumeTore2' )
return facetore1, facetore2, volumeTore1, volumeTore2
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- trouver les vertices extremites d'un wire
else:
idsubs[subid] = [sub]
name='vertex%d'%i
- geompy.addToStudyInFather(aWire, sub, name)
+ geomPublishInFather(initLog.debug, aWire, sub, name)
if getNormals:
idnorm[subid] = normals[i]
name='norm%d'%i
- geompy.addToStudyInFather(aWire, normals[i], name)
+ geomPublishInFather(initLog.debug, aWire, normals[i], name)
logging.debug("idsubs: %s", idsubs)
for k, v in idsubs.iteritems():
if len(v) == 1:
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- trouver les vertices intermediaires d'un wire
else:
idsubs[subid] = [sub]
name='vertex%d'%i
- geompy.addToStudyInFather(aWire, sub, name)
+ geomPublishInFather(initLog.debug, aWire, sub, name)
if getNormals:
idnorm[subid] = normals[i]
name='norm%d'%i
- geompy.addToStudyInFather(aWire, normals[i], name)
+ geomPublishInFather(initLog.debug, aWire, normals[i], name)
for k, v in idsubs.iteritems():
if len(v) > 1:
shortList.append(v[0])
# -*- coding: utf-8 -*-
from geomsmesh import geompy, smesh
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import math
import GEOM
Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
plan_y = geompy.MakePlaneLCS(None, 100000, 3)
- geompy.addToStudy( plan_y, "plan_y" )
- geompy.addToStudy( tube_1, "tube_1" )
- geompy.addToStudy( coude, "coude" )
- geompy.addToStudy( tube_2, "tube_2" )
+ geomPublish(initLog.debug, plan_y, "plan_y" )
+ geomPublish(initLog.debug, tube_1, "tube_1" )
+ geomPublish(initLog.debug, coude, "coude" )
+ geomPublish(initLog.debug, tube_2, "tube_2" )
P1 = O
- geompy.addToStudy( P1, "P1" )
+ geompy.addToStudy(P1, "P1" )
op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
- geompy.addToStudy( P2, "P2" )
+ geompy.addToStudy(P2, "P2" )
# --- tube coude sain
geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
- geompy.addToStudy( geometrieSaine, self.nomCas )
+ geomPublish(initLog.debug, geometrieSaine, self.nomCas )
[P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
xmin = -de -r_cintr -l_tube_p2
grped = geompy.CutGroups(grpedy0, long_p1)
grped = geompy.CutGroups(grped, long_p2)
ep = geompy.CutGroups(grped, long_coude)
- geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
- geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
- geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
- geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
- geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
- geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
+ geomPublishInFather(initLog.debug, geometrieSaine, long_p1, 'long_p1' )
+ geomPublishInFather(initLog.debug, geometrieSaine, ep, 'ep' )
+ geomPublishInFather(initLog.debug, geometrieSaine, long_coude, 'long_coude' )
+ geomPublishInFather(initLog.debug, geometrieSaine, circ_g, 'circ_g' )
+ geomPublishInFather(initLog.debug, geometrieSaine, circ_d, 'circ_d' )
+ geomPublishInFather(initLog.debug, geometrieSaine, long_p2, 'long_p2' )
# --- face extremite tube (EXTUBE)
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(EXTUBE, facesIds)
- geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
+ geomPublishInFather(initLog.debug, geometrieSaine, EXTUBE, 'EXTUBE' )
# --- edge bord extremite tube (BORDTU)
edgesIds.append(edge)
BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
geompy.UnionIDs(BORDTU, edgesIds)
- geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
+ geomPublishInFather(initLog.debug, geometrieSaine, BORDTU, 'BORDTU' )
# --- face origine tube (CLGV)
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
vec2 = geompy.MakeVector(P2, pp2)
- #geompy.addToStudy(vec2, 'vec2')
+ #geomPublish(initLog.debug, vec2, 'vec2')
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(CLGV, facesIds)
- geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
+ geomPublishInFather(initLog.debug, geometrieSaine, CLGV, 'CLGV' )
# --- peau tube interieur (PEAUINT)
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
interne = geompy.MakeFuse(extru1, revol1)
interne = geompy.MakeFuse(extru2, interne)
- geompy.addToStudy(interne, 'interne')
+ geomPublish(initLog.debug, interne, 'interne')
facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUINT, facesIds)
- geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
+ geomPublishInFather(initLog.debug, geometrieSaine, PEAUINT, 'PEAUINT' )
# --- peau tube exterieur (PEAUEXT)
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe)
- geompy.addToStudy(externe, 'externe')
+ geomPublish(initLog.debug, externe, 'externe')
facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUEXT, facesIds)
- geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
+ geomPublishInFather(initLog.debug, geometrieSaine, PEAUEXT, 'PEAUEXT' )
# --- solide sain
volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
geompy.UnionIDs(COUDE, volIds)
- geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' )
+ geomPublishInFather(initLog.debug, geometrieSaine, COUDE, 'COUDSAIN' )
geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
azimut = -azimut # axe inverse / ASCOUF
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
- geompy.addToStudy(axe,"axe")
+ geomPublish(initLog.debug, axe,"axe")
if not lgInfluence:
lgInfluence = profondeur
pi = geompy.MakeVertex(rayint, 0, 0)
pbl = geompy.MakeRotation(pb, OZ, angle)
pbr = geompy.MakeRotation(pb, OZ, -angle)
- geompy.addToStudy(pbl,"pbl")
- geompy.addToStudy(pbr,"pbr")
+ geomPublish(initLog.debug, pbl,"pbl")
+ geomPublish(initLog.debug, pbr,"pbr")
pal = geompy.MakeTranslationVector(pbl, OZ)
par = geompy.MakeTranslationVector(pbr, OZ)
axl = geompy.MakeVector(pbl,pal)
wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
#wiretube = geompy.MakeInterpol(points)
wiretube=geompy.MakeWire([wire0,wire1,wire2])
- geompy.addToStudy(wiretube,"wiretube")
+ geomPublish(initLog.debug, wiretube,"wiretube")
pe = geompy.MakeVertex(rayext, 0, 0)
pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
arce = geompy.MakeArc(points[0], pe, points[-1])
- geompy.addToStudy(arce,"arce")
+ geomPublish(initLog.debug, arce,"arce")
facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
- geompy.addToStudy( facefiss, 'facefissPlace' )
+ geomPublish(initLog.debug, facefiss, 'facefissPlace' )
pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
- geompy.addToStudy( centre, 'centrefissPlace' )
+ geomPublish(initLog.debug, centre, 'centrefissPlace' )
wiretube = geompy.GetInPlace(facefiss, wiretube)
- geompy.addToStudy(wiretube, 'wiretubePlace' )
+ geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
try:
edgetube = geompy.MakeEdgeWire(wiretube)
- geompy.addToStudy(edgetube,"edgetube")
+ geomPublish(initLog.debug, edgetube,"edgetube")
except:
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
edgetube = None
points.append(pt)
curves.append(geompy.MakeInterpol(points))
point0 = points[0]
- geompy.addToStudy(curves[-1],"curve0")
+ geomPublish(initLog.debug, curves[-1],"curve0")
# for i, pt in enumerate(points):
# name = "point%d"%i
-# geompy.addToStudyInFather(curves[-1], pt, name)
+# geomPublishInFather(initLog.debug,curves[-1], pt, name)
points = []
nbp = 3*nbp1
pt = geompy.MakeRotation(pi, axe, angi)
points.append(pt)
curves.append(geompy.MakeInterpol(points))
- geompy.addToStudy(curves[-1],"curve1")
+ geomPublish(initLog.debug, curves[-1],"curve1")
# for i, pt in enumerate(points):
# name = "point%d"%i
-# geompy.addToStudyInFather(curves[-1], pt, name)
+# geomPublishInFather(initLog.debug,curves[-1], pt, name)
points = []
nbp = 3*nbp1
points.append(pt)
curves.append(geompy.MakeInterpol(points))
point1 = points[-1]
- geompy.addToStudy(curves[-1],"curve2")
+ geomPublish(initLog.debug, curves[-1],"curve2")
# for i, pt in enumerate(points):
# name = "point%d"%i
-# geompy.addToStudyInFather(curves[-1], pt, name)
+# geomPublishInFather(initLog.debug,curves[-1], pt, name)
wiretube = geompy.MakeWire(curves)
- geompy.addToStudy(wiretube,"wiretube")
+ geomPublish(initLog.debug, wiretube,"wiretube")
try:
edgetube = geompy.MakeEdgeWire(wiretube)
- geompy.addToStudy(edgetube,"edgetube")
+ geomPublish(initLog.debug, edgetube,"edgetube")
except:
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
edgetube = None
pts.append(pt)
pts.append(point1)
arce = geompy.MakeInterpol(pts)
- geompy.addToStudy(arce,"arce")
+ geomPublish(initLog.debug, arce,"arce")
facefiss = geompy.MakeFaceWires([arce, wiretube], 0)
- geompy.addToStudy( facefiss, 'facefissPlace' )
+ geomPublish(initLog.debug, facefiss, 'facefissPlace' )
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
centre = geompy.MakeRotation(pc, axe, alfrd)
- geompy.addToStudy( centre, 'centrefissPlace' )
+ geomPublish(initLog.debug, centre, 'centrefissPlace' )
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
edgesTriees, minl, maxl = sortEdges(edges)
edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine
wiretube = geompy.MakeWire(edges)
#wiretube = edgesTriees[-1]
- geompy.addToStudy(wiretube, 'wiretubePlace' )
+ geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
# ---------------------------------------------------------
arci = geompy.MakePosition(arco, originLCS, localLCS, "arci")
arce = geompy.MakePosition(lino, originLCS, localLCS, "arce")
facefiss = geompy.MakeFaceWires([arce, arci], 0)
- geompy.addToStudy( facefiss, 'facefissPlace' )
+ geomPublish(initLog.debug, facefiss, 'facefissPlace' )
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
edgesTriees, minl, maxl = sortEdges(edges)
edgetube = edgesTriees[-1] # la plus grande correspond à arci
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
centre = geompy.MakeRotation(pc, axe, alfrd)
- geompy.addToStudy( centre, 'centrefissPlace' )
+ geomPublish(initLog.debug, centre, 'centrefissPlace' )
coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur)
import logging
from geomsmesh import geompy
from geomsmesh import smesh
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
import SMESH
# on recrée un objet GEOM temporaire par filling.
filling = geompy.MakeFilling(geompy.MakeCompound(setOfLines), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
#logging.debug("face de filling")
- #geompy.addToStudy(filling, 'filling_{0}'.format(i + 1))
+ #geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1))
tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0)
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
if len(tmpExplodeRef) == len(tmpExplodeNum):
logging.debug("face de filling non coupee")
- geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1))
+ geompy.addToStudy( filling, "faceNonCoupee_{0}".format(i + 1)) # doit etre publie pour critere OK plus bas
facesNonCoupees.append(filling)
maillagesNonCoupes.append(listOfNewMeshes[i])
else:
logging.debug("face de filling coupee")
- geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1))
+ geompy.addToStudy( filling, "faceCoupee_{0}".format(i + 1))
facesCoupees.append(filling)
maillagesCoupes.append(listOfNewMeshes[i])
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from toreFissure import toreFissure
from ellipsoideDefaut import ellipsoideDefaut
plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut)
ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut)
- geompy.addToStudy( pipe0, 'pipe0' )
- geompy.addToStudy( gener1, 'gener1' )
- geompy.addToStudy( pipe1, 'pipe1' )
- geompy.addToStudy( facefis1, 'facefis1' )
- geompy.addToStudy( plane1, 'plane1' )
- geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
+ geomPublish(initLog.debug, pipe0, 'pipe0' )
+ geomPublish(initLog.debug, gener1, 'gener1' )
+ geomPublish(initLog.debug, pipe1, 'pipe1' )
+ geomPublish(initLog.debug, facefis1, 'facefis1' )
+ geomPublish(initLog.debug, plane1, 'plane1' )
+ geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
shapeDefaut = facefis1
xyz_defaut = geompy.PointCoordinates(centreDefaut)
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import bisect
publie = False
edgeFondExt = fondFiss
aWire = geompy.MakeWire([fondFiss], 1e-07)
if not publie:
- geompy.addToStudy(aWire, "wireFondFissExt")
+ geomPublish(initLog.debug, aWire, "wireFondFissExt")
lgWire = geompy.BasicProperties(aWire)[0]
edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True)
centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr])
else: # on ne sait pas comment est orientée l'edge unique, mais ça n'a pas d'importance
centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], lgOnEdge/lgEdges[iedr])
- geompy.addToStudyInFather(aWire, centreFondFiss, "centreFondFiss")
+ geomPublishInFather(initLog.debug,aWire, centreFondFiss, "centreFondFiss")
tgtCentre = geompy.MakeTangentOnCurve(edges[iedr], lgOnEdge/ lgEdges[iedr])
if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
edgeFondExt = None
if not publie and edgeFondExt is not None:
- geompy.addToStudy(edgeFondExt, "edgeFondExt")
+ geomPublish(initLog.debug, edgeFondExt, "edgeFondExt")
publie = True
return edgeFondExt, centreFondFiss, tgtCentre
import math
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from produitMixte import produitMixte
from whichSide import whichSide
#logging.debug("edgesFondIn %s", edgesFondIn)
for iedf, edge in enumerate(edgesFondIn):
name = "edgeFondIn%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
[u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
centre = PointOnEdge
centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
- geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, centre2, "centre2_%d"%iedf)
verticesEdgesFondIn.append(centre)
name = "verticeEdgesFondIn%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, centre, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, name)
norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
- geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, "norm%d"%iedf)
cercle = geompy.MakeCircle(centre, norm, rayonPipe)
- geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
[vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
vec1 = geompy.MakeVector(centre, vertex)
vec2 = geompy.MakeVector(centre, ptPeau)
else:
cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
name = "cercle%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, cercle, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name)
cercles.append(cercle)
# --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
logging.debug("distance curviligne centre extremite0: %s", ofp)
p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
- geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf)
- geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf)
+ geomPublishInFather(initLog.debug, wireFondFiss, p1, "p1_%d"%iedf)
+ geomPublishInFather(initLog.debug, wireFondFiss, p2, "p2_%d"%iedf)
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
if geompy.MinDistance(centre, edp) < 1.e-3:
pipext = geompy.MakePipe(cercle, edp)
name = "pipeExt%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, pipext, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, pipext, name)
pipexts.append(pipext)
for ifa, face in enumerate(facesInside):
logging.debug(" face %s inside ajoutée", ifa)
facesFissExt.append(face)
name="faceFissExt%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, face, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, face, name)
dist = 1.
for ipe, edpe in enumerate(edgesPeauFis):
for ipi, edpi in enumerate(edgesPipeFis):
if dist < 1.e-3:
edgesFissExtPeau.append(edpe)
name="edgesFissExtPeau%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, edpe, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, edpe, name)
edgesFissExtPipe.append(edpi)
name="edgesFissExtPipe%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, edpi, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, edpi, name)
break
if dist < 1.e-3:
break
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
+
from extractionOrientee import extractionOrientee
from extractionOrienteeMulti import extractionOrienteeMulti
logging.info('start')
edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss))
- geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss))
- geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss")
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesFondC, "edgesFondFiss")
if aretesVivesC is None:
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
verticesPipePeau.append(vertices[0])
name = "edgePipeIn%d"%i
- geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
name = "verticePipePeau%d"%i
- geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name)
+ geomPublishInFather(initLog.debug, partitionPeauFissFond, vertices[0], name)
logging.debug("edgePipeIn%s coupe les faces OnSide", i)
except:
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss):
"""
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
- geompy.addToStudy(faceFissureExterne, "faceFissureExterne")
- geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
- geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
+ geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
+ geomPublishInFather(initLog.debug, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
+ geomPublishInFather(initLog.debug, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC)
\ No newline at end of file
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from sortFaces import sortFaces
from extractionOrientee import extractionOrientee
pass
name="partitionPeauByPipe%d"%ifil
- geompy.addToStudy(partitionPeauByPipe, name)
+ geomPublish(initLog.debug, partitionPeauByPipe, name)
[edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
[facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
facesPeauSorted = [facePeau]
name="facePeau%d"%ifil
- geompy.addToStudy(facePeau, name)
+ geomPublish(initLog.debug, facePeau, name)
return (facePeau, facesPeauSorted, edgesPeauFondIn)
\ No newline at end of file
import logging
import salome
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from geomsmesh import smesh
import SMESH
import math
#plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
#ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
- #geompy.addToStudy( pipe0, 'pipe0' )
- #geompy.addToStudy( gener1, 'gener1' )
- #geompy.addToStudy( pipe1, 'pipe1' )
- #geompy.addToStudy( facefis1, 'facefis1' )
- #geompy.addToStudy( plane1, 'plane1' )
- #geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
+ #geomPublish(initLog.debug, pipe0, 'pipe0' )
+ #geomPublish(initLog.debug, gener1, 'gener1' )
+ #geomPublish(initLog.debug, pipe1, 'pipe1' )
+ #geomPublish(initLog.debug, facefis1, 'facefis1' )
+ #geomPublish(initLog.debug, plane1, 'plane1' )
+ #geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
# --- partition du bloc défaut par génératrice, tore et plan fissure
if step == 7:
import logging
import salome
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
from geomsmesh import smesh
from salome.smesh import smeshBuilder
# partition face fissure étendue par fillings, on garde la plus grande face
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
- geompy.addToStudy(partShapeDefaut, 'partShapeDefaut')
+ geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
if isPointInterne:
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
facesPortFissure = facesPartShapeDefautSorted[-1] #= global
- geompy.addToStudy(facesPortFissure, "facesPortFissure")
+ geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
O, OX, OY, OZ = triedreBase()
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #= local
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
- geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe')
- #geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
+ geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
+ #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
extrem, norms = findWireEndVertices(fondFiss, True)
logging.debug("extrem: %s, norm: %s",extrem, norms)
cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
- geompy.addToStudy(cercle, 'cercle')
+ geomPublish(initLog.debug, cercle, 'cercle')
fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
- geompy.addToStudy(pipeFiss, 'pipeFiss')
+ geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
- geompy.addToStudy(partFissPipe, 'partFissPipe')
+ geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) #= global
- geompy.addToStudy(fissPipe, 'fissPipe')
+ geomPublish(initLog.debug, fissPipe, 'fissPipe')
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) #= local
- geompy.addToStudy(partPipe, 'partPipe')
+ geomPublish(initLog.debug, partPipe, 'partPipe')
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) #= global
for i, edge in enumerate(edgesPipeFiss):
name = "edgePipe%d"%i
- geompy.addToStudyInFather(fissPipe, edge, name)
+ geomPublishInFather(initLog.debug,fissPipe, edge, name)
try:
wirePipeFiss = geompy.MakeWire(edgesPipeFiss) #= global
except:
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
logging.debug("wirePipeFiss construit sous forme de compound")
- geompy.addToStudy(wirePipeFiss, "wirePipeFiss")
+ geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
for i, edge in enumerate(edgesFondFiss):
name = "edgeFondFiss%d"%i
- geompy.addToStudyInFather(fissPipe, edge, name)
+ geomPublishInFather(initLog.debug,fissPipe, edge, name)
wireFondFiss = geompy.MakeWire(edgesFondFiss) #= global
- geompy.addToStudy(wireFondFiss,"wireFondFiss")
+ geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
# -----------------------------------------------------------------------------
# --- peau et face de fissure
fissPipePart = fissPipe
part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
partitionsPeauFissFond.append(part)
- geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart )
+ geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
else:
partitionsPeauFissFond.append(None)
ipart = ipart +1
if not isinstance(a, list):
aretesVives.append(a)
name = "areteVive%d"%ia
- geompy.addToStudy(a, name)
+ geomPublish(initLog.debug, a, name)
ia += 1
else:
if a[0] is not None:
aretesVives.append(a[0])
name = "areteVive%d"%ia
- geompy.addToStudy(a[0], name)
+ geomPublish(initLog.debug, a[0], name)
ia += 1
aretesVivesC = None #= global
# edges prolongées
edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) #= local
- geompy.addToStudyInFather(partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPipeC, "edgesPipeFiss")
edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss)) #= local
- geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss")
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesFondC, "edgesFondFiss")
if aretesVivesC is None: #= global facesInside facesOnside
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
verticesPipePeau.append(vertices[0])
name = "edgePipeIn%d"%i
- geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name)
name = "verticePipePeau%d"%i
- geompy.addToStudyInFather(partitionPeauFissFond, vertices[0], name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, vertices[0], name)
logging.debug("edgePipeIn%s coupe les faces OnSide", i)
except:
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
for i,edge in enumerate(edgesFondFiss):
- geompy.addToStudyInFather(wireFondFiss, edge, "edgeFondFiss%d"%i)
+ geomPublishInFather(initLog.debug,wireFondFiss, edge, "edgeFondFiss%d"%i)
for iedf, edge in enumerate(edgesFondIn):
name = "edgeFondIn%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name)
dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
[u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
centre = PointOnEdge
centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
- geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, centre2, "centre2_%d"%iedf)
verticesEdgesFondIn.append(centre)
name = "verticeEdgesFondIn%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, centre, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, name)
norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
- geompy.addToStudyInFather(partitionPeauFissFond, centre, "norm%d"%iedf)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, "norm%d"%iedf)
cercle = geompy.MakeCircle(centre, norm, rayonPipe)
- geompy.addToStudyInFather(partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, "cerclorig%d"%iedf)
[vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
vec1 = geompy.MakeVector(centre, vertex)
vec2 = geompy.MakeVector(centre, ptPeau)
else:
cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
name = "cercle%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, cercle, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name)
cercles.append(cercle)
# --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
logging.debug("distance curviligne centre extremite0: %s", ofp)
p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
- geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf)
- geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf)
+ geomPublishInFather(initLog.debug,wireFondFiss, p1, "p1_%d"%iedf)
+ geomPublishInFather(initLog.debug,wireFondFiss, p2, "p2_%d"%iedf)
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
if geompy.MinDistance(centre, edp) < 1.e-3:
pipext = geompy.MakePipe(cercle, edp)
name = "pipeExt%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, pipext, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, pipext, name)
pipexts.append(pipext)
for face in facesInside:
logging.debug(" face %s inside ajoutée", i)
facesFissExt.append(face)
name="faceFissExt%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, face, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, face, name)
dist = 1.
for ipe, edpe in enumerate(edgesPeauFis):
for ipi, edpi in enumerate(edgesPipeFis):
if dist < 1.e-3:
edgesFissExtPeau.append(edpe)
name="edgesFissExtPeau%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, edpe, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edpe, name)
edgesFissExtPipe.append(edpi)
name="edgesFissExtPipe%d"%iedf
- geompy.addToStudyInFather(partitionPeauFissFond, edpi, name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edpi, name)
break
if dist < 1.e-3:
break
if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
edgesFissExtPeau.append(edgesPeauFis[0])
name="edgesFissExtPeau%d"%j
- geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
j += 1
# -----------------------------------------------------------------------
pass
name="partitionPeauByPipe%d"%ifil
- geompy.addToStudy(partitionPeauByPipe, name)
+ geomPublish(initLog.debug, partitionPeauByPipe, name)
[edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
[facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
else:
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
name="facePeau%d"%ifil
- geompy.addToStudy(facePeau, name)
+ geomPublish(initLog.debug, facePeau, name)
facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
nameEdge = "edgeRadFacePipePeau%d"%i
facesPipePeau[i] = face
endsEdgeFond[i] = sharedVertices[0]
- geompy.addToStudy(face, nameFace)
- geompy.addToStudy(sharedVertices[0], nameVert)
+ geomPublish(initLog.debug, face, nameFace)
+ geomPublish(initLog.debug, 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)
+ geomPublish(initLog.debug, edge, nameEdge)
break
pass
pass
geompy.UnionList(grpEdgesCirc, edges)
edgesCircPeau[i] = grpEdgesCirc
name = "edgeCirc%d"%i
- geompy.addToStudyInFather(facePeau, grpEdgesCirc, name)
+ geomPublishInFather(initLog.debug,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)
+ geomPublishInFather(initLog.debug,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)
+ geomPublishInFather(initLog.debug,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")
+ geomPublishInFather(initLog.debug,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")
+ geomPublishInFather(initLog.debug,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)
+ geomPublishInFather(initLog.debug,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)
+ geomPublishInFather(initLog.debug,facePeau, edge, name)
ptEdgeFond[ifil] = endsEdgeFond # pour chaque face [points edge fond de fissure aux débouchés du pipe]
for i, avc in enumerate(aretesVivesCoupees):
name = "areteViveCoupee%d"%i
- geompy.addToStudy(avc, name)
+ geomPublish(initLog.debug, avc, name)
# --- identification des faces et edges de fissure externe pour maillage
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
- geompy.addToStudy(faceFissureExterne, "faceFissureExterne")
- geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
- geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
+ geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
+ geomPublishInFather(initLog.debug,faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
+ geomPublishInFather(initLog.debug,faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
logging.debug("---------------------------- Preparation Maillage du Pipe --------------")
# -----------------------------------------------------------------------
origins.append(vertpx)
normals.append(norm)
# name = "vertcx%d"%i
-# geompy.addToStudyInFather(wireFondFiss, vertcx, name)
+# geomPublishInFather(initLog.debug,wireFondFiss, vertcx, name)
# name = "vertpx%d"%i
-# geompy.addToStudyInFather(wireFondFiss, vertpx, name)
+# geomPublishInFather(initLog.debug,wireFondFiss, vertpx, name)
# name = "plan%d"%i
-# geompy.addToStudyInFather(wireFondFiss, plan, name)
+# geomPublishInFather(initLog.debug,wireFondFiss, plan, name)
# --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
name='compoundRay%d'%k
- geompy.addToStudy(comp, name)
+ geomPublish(initLog.debug, comp, name)
else:
idfin = min(len(gptsdisks), numout+1)
iddeb = min(idfin-3, idisk) # il faut 3 rayons pour faire un filling qui suive le fond de fissure
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
name='compoundRay%d'%k
- geompy.addToStudy(comp, name)
+ geomPublish(initLog.debug, comp, name)
nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
nappes.append(nappe)
name='nappe%d'%k
- geompy.addToStudy(nappe, name)
+ geomPublish(initLog.debug, nappe, name)
facesDebouchantes[i] = True
listNappes.append(nappes)
ednouv.append(ed)
logging.debug(" edges issues de la partition: %s", ednouv)
for ii, ed in enumerate(ednouv):
- geompy.addToStudy(ed, "ednouv%d"%ii)
+ geomPublish(initLog.debug, ed, "ednouv%d"%ii)
[edsorted, minl,maxl] = sortEdges(ednouv)
logging.debug(" longueur edge trouvée: %s", maxl)
edge = edsorted[-1]
edges.append(edge)
name = 'edgeEndPipe%d'%k
- geompy.addToStudy(edge, name)
+ geomPublish(initLog.debug, edge, name)
listEdges.append(edges)
# --- création des points du maillage du pipe sur la face de peau
id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
centre = ptEdgeFond[idFillingFromBout[i]][id]
name = "centre%d"%id
- geompy.addToStudy(centre, name)
+ geomPublish(initLog.debug, centre, name)
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
- geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau")
+ geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau")
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
edgesCirc = []
for grpEdgesCirc in grpsEdgesCirc:
else:
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
name ="bout%d"%k
- geompy.addToStudyInFather(centre, bout, name)
+ geomPublishInFather(initLog.debug,centre, bout, name)
# enregistrement des points dans la structure
points = []
for j in range(nbsegRad +1):
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
- geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords")
+ geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
import logging
import salome
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from geomsmesh import smesh
from salome.smesh import smeshBuilder
import SMESH
WirePorteFondFissure = wiretube
fillingFaceExterne = facesDefaut[0]
logging.debug("fillingFaceExterne %s", fillingFaceExterne)
- geompy.addToStudy(fillingFaceExterne, "fillingFaceExterne")
+ geomPublish(initLog.debug, fillingFaceExterne, "fillingFaceExterne")
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
O, OX, OY, OZ = triedreBase()
# --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée
partitionPeauFissFond = geompy.MakePartition([facePorteFissure, WirePorteFondFissure, fillingFaceExterne], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
- geompy.addToStudy( partitionPeauFissFond, 'partitionPeauFissFond' )
+ geomPublish(initLog.debug, partitionPeauFissFond, 'partitionPeauFissFond' )
edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False)
lgmax = lg
imax = i
edgemax = edges[imax]
- geompy.addToStudy(edgemax, 'edgemax')
+ geomPublish(initLog.debug, edgemax, 'edgemax')
centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
- geompy.addToStudy(centreFondFiss, 'centreFondFiss')
+ geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss')
tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
- geompy.addToStudy(tangentFondFiss, 'tangentFondFiss')
+ geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss')
bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
- geompy.addToStudy(bord1FondFiss, 'bord1FondFiss')
+ geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss')
tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
- geompy.addToStudy(tangentBord1FondFiss, 'tangentBord1FondFiss')
+ geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss')
bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
- geompy.addToStudy(bord2FondFiss, 'bord2FondFiss')
+ geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss')
tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
- geompy.addToStudy(tangentBord2FondFiss, 'tangentBord2FondFiss')
+ geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss')
planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
- geompy.addToStudy(planBord1, 'planBord1')
- geompy.addToStudy(planBord2, 'planBord2')
+ geomPublish(initLog.debug, planBord1, 'planBord1')
+ geomPublish(initLog.debug, planBord2, 'planBord2')
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
[facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
# --- partition peau -face fissure - pipe fond de fissure prolongé
partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], [], [], geompy.ShapeType["FACE"], 0, [], 0)
- geompy.addToStudy( partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
+ geomPublish(initLog.debug, partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
# --- identification face de peau
[facesPeauFissInside, facesPeauFissOutside, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
facePeau = facesPeauSorted[-1] # la plus grande face
- geompy.addToStudyInFather(partitionPeauFissByPipe, facePeau, "facePeau")
+ geomPublishInFather(initLog.debug,partitionPeauFissByPipe, facePeau, "facePeau")
# --- identification edges de bord face peau
edgesBords = []
edgesBords.append(edgepeau)
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesBords)
- geompy.addToStudyInFather(facePeau, groupEdgesBordPeau , "EdgesBords")
+ geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords")
# --- identification face fissure externe au pipe et edge commune peau fissure
for face in facesPeauFissInside:
if sharedEdges is not None:
faceFiss = face
edgePeauFiss = sharedEdges[0]
- geompy.addToStudyInFather(partitionPeauFissByPipe, faceFiss, "faceFiss")
- geompy.addToStudyInFather(faceFiss, edgePeauFiss, "edgePeauFiss")
- geompy.addToStudyInFather(facePeau, edgePeauFiss, "edgePeauFiss")
+ geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss")
+ geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss")
+ geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss")
break
except:
pass
verticesDemiCerclesPeau = []
for i, edge in enumerate(demiCerclesPeau):
name = "demiCerclePeau_%d"%i
- geompy.addToStudyInFather(facePeau, edge, name)
+ geomPublishInFather(initLog.debug,facePeau, edge, name)
verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
for i, vertex in enumerate(verticesDemiCerclesPeau):
name = "verticesDemiCerclesPeau_%d"%i
- geompy.addToStudyInFather(facePeau, vertex, name)
+ geomPublishInFather(initLog.debug,facePeau, vertex, name)
verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
for i, vertex in enumerate(verticesOutCercles):
name = "verticesOutCercles_%d"%i
- geompy.addToStudyInFather(facePeau, vertex, name)
+ geomPublishInFather(initLog.debug,facePeau, vertex, name)
# --- demi cercles regroupés
groupsDemiCerclesPeau = []
group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(group, demis)
name = "Cercle%d"%i
- geompy.addToStudyInFather(facePeau, group , name)
+ geomPublishInFather(initLog.debug,facePeau, group , name)
groupsDemiCerclesPeau.append(group)
# --- identification edges commune pipe face fissure externe au pipe
if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
edgesFaceFissPipe.append(edge)
name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
- geompy.addToStudyInFather(faceFiss, edge, name)
+ geomPublishInFather(initLog.debug,faceFiss, edge, name)
groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
- geompy.addToStudyInFather(faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
+ geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
# -----------------------------------------------------------------------------
# --- pipe de fond de fissure
#pipeFondFiss = pipesSorted[-1]
#pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
- geompy.addToStudy( disque, 'disque')
- geompy.addToStudy( wireFondFiss, 'wireFondFiss')
- geompy.addToStudy( pipeFondFiss, 'pipeFondFiss')
+ geomPublish(initLog.debug, disque, 'disque')
+ geomPublish(initLog.debug, wireFondFiss, 'wireFondFiss')
+ geomPublish(initLog.debug, pipeFondFiss, 'pipeFondFiss')
VerticesEndFondFiss = findWireEndVertices(wireFondFiss)
for i, v in enumerate(VerticesEndFondFiss):
name = "vertexEndFondFiss_%d"%i
- geompy.addToStudyInFather(wireFondFiss, v, name)
+ geomPublishInFather(initLog.debug,wireFondFiss, v, name)
VerticesEndPipeFiss = []
for v in VerticesEndFondFiss:
VerticesEndPipeFiss.append(geompy.GetInPlace(pipeFondFiss, v))
for i, v in enumerate(VerticesEndPipeFiss):
name = "vertexEndPipeFiss_%d"%i
- geompy.addToStudyInFather(pipeFondFiss, v, name)
+ geomPublishInFather(initLog.debug,pipeFondFiss, v, name)
- geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
- geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
+ geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
+ geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
if geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[0]) > geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[1]):
a = verticesOutCercles[0]
verticesOutCercles[0] = verticesOutCercles[1]
verticesOutCercles[1] = a
- geompy.addToStudyInFather(facePeau, verticesOutCercles[0], "THOR")
- geompy.addToStudyInFather(facePeau, verticesOutCercles[1], "THEX")
+ geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[0], "THOR")
+ geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[1], "THEX")
[facesPipeInside, facesPipeOutside, facesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "FACE", 0.1, "pipe_bord_")
[edgesPipeInside, edgesPipeOutside, edgesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "EDGE", 0.1, "pipe_bord_")
centre = geompy.MakeVertexOnSurface(planfiss, 0.5, 0.5)
refpoint = geompy.MakeTranslationVector(centre, geompy.GetNormal(planfiss,centre))
- geompy.addToStudy(refpoint, 'refpoint')
+ geomPublish(initLog.debug, refpoint, 'refpoint')
[facesPipeInplan, facesPipeOutplan, facesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "FACE", 0.1, "pipe_plan_")
[edgesPipeInplan, edgesPipeOutplan, edgesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "EDGE", 0.1, "pipe_plan_")
generFiss.append(edge)
groupGenerFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(groupGenerFiss, generFiss)
- geompy.addToStudyInFather(pipeFondFiss, groupGenerFiss, "GenFiss")
+ geomPublishInFather(initLog.debug,pipeFondFiss, groupGenerFiss, "GenFiss")
# --- demi cercles externes regroupés
groupsDemiCerclesPipe = []
group = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(group, demis)
name = "Cercle%d"%i
- geompy.addToStudyInFather(pipeFondFiss, group , name)
+ geomPublishInFather(initLog.debug,pipeFondFiss, group , name)
groupsDemiCerclesPipe.append(group)
# --- faces fissure dans le pipe
logging.debug("face found")
facesFissinPipe.append(face)
name = "faceFissInPipe_%d"%i
- geompy.addToStudyInFather(pipeFondFiss, face, name)
+ geomPublishInFather(initLog.debug,pipeFondFiss, face, name)
break
groupFaceFissInPipe = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["FACE"])
geompy.UnionList(groupFaceFissInPipe, facesFissinPipe)
name = "FaceFissInPipe"
- geompy.addToStudyInFather(pipeFondFiss, groupFaceFissInPipe , name)
+ geomPublishInFather(initLog.debug,pipeFondFiss, groupFaceFissInPipe , name)
# --- edges de fond de fissure
logging.debug(" edge %s ", anEdge)
edgesFondFiss.append(anEdge)
name ="edgeFondFissure_%d"%i
- geompy.addToStudyInFather(pipeFondFiss, anEdge, name)
+ geomPublishInFather(initLog.debug,pipeFondFiss, anEdge, name)
groupEdgeFondFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgeFondFiss, edgesFondFiss)
name = "FONDFISS"
- geompy.addToStudyInFather(pipeFondFiss, groupEdgeFondFiss , name)
+ geomPublishInFather(initLog.debug,pipeFondFiss, groupEdgeFondFiss , name)
# -------------------------------------------------------------------------
# --- maillage
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from geomsmesh import smesh
from salome.smesh import smeshBuilder
import SMESH
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
- geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords")
+ geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- partition du bloc defaut par generatrice, tore et plan fissure
faceFissure = geompy.GetInPlaceByHistory(volDefautPart, facefis)
#ellipsoidep =geompy.GetInPlaceByHistory(volDefautPart, ellipsoide)
- geompy.addToStudy( volDefautPart, 'volDefautPart' )
- geompy.addToStudyInFather( volDefautPart, tore, 'tore' )
- geompy.addToStudyInFather( volDefautPart, faceFissure, 'FACE1' )
- #geompy.addToStudyInFather( volDefautPart, gencnt, 'generatrice' )
+ geomPublish(initLog.debug, volDefautPart, 'volDefautPart' )
+ geomPublishInFather(initLog.debug, volDefautPart, tore, 'tore' )
+ geomPublishInFather(initLog.debug, volDefautPart, faceFissure, 'FACE1' )
+ #geomPublishInFather(initLog.debug, volDefautPart, gencnt, 'generatrice' )
solids = geompy.ExtractShapes(blocp, geompy.ShapeType["SOLID"], True)
vols = []
imaxvol = vols.index(maxvol)
ellipsoidep = solids[imaxvol]
- geompy.addToStudyInFather( volDefautPart, blocp, 'bloc' )
- geompy.addToStudyInFather( volDefautPart, ellipsoidep, 'ellipsoide' )
+ geomPublishInFather(initLog.debug, volDefautPart, blocp, 'bloc' )
+ geomPublishInFather(initLog.debug, volDefautPart, ellipsoidep, 'ellipsoide' )
sharedFaces = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["FACE"])
for i in range(len(sharedFaces)):
name = "faceCommuneEllipsoideBloc_%d"%i
- geompy.addToStudyInFather(blocp, sharedFaces[i], name)
+ geomPublishInFather(initLog.debug,blocp, sharedFaces[i], name)
#sharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
allSharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
sharedEdges.append(allSharedEdges[i])
for i in range(len(sharedEdges)):
name = "edgeCommuneEllipsoideBloc_%d"%i
- geompy.addToStudyInFather(blocp, sharedEdges[i], name)
+ geomPublishInFather(initLog.debug,blocp, sharedEdges[i], name)
facesExternes = []
facesExtBloc = []
faceExt = geompy.GetInPlace(ellipsoidep, faces[i])
if faceExt is not None:
name = "faceExterne_e%d"%i
- geompy.addToStudyInFather(ellipsoidep, faceExt, name)
+ geomPublishInFather(initLog.debug,ellipsoidep, faceExt, name)
facesExternes.append(faceExt)
facesExtElli.append(faceExt)
faceExt = geompy.GetInPlace(blocp, faces[i])
if faceExt is not None:
name = "faceExterne_b%d"%i
- geompy.addToStudyInFather(blocp, faceExt, name)
+ geomPublishInFather(initLog.debug,blocp, faceExt, name)
facesExternes.append(faceExt)
facesExtBloc.append(faceExt)
else:
#extrusionFace = geompy.MakePrismVecH2Ways(faces[i], normal, 0.1)
#extrusionFace = geompy.MakeScaleTransform(extrusionFace, vertex, 1.01)
name = "extrusionFace_b%d"%i
- geompy.addToStudyInFather(blocp, extrusionFace, name)
+ geomPublishInFather(initLog.debug,blocp, extrusionFace, name)
#facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ON)
for j in range(len(facesExt)):
name = "faceExterne_b%d_%d"%(i,j)
- geompy.addToStudyInFather(blocp, facesExt[j], name)
+ geomPublishInFather(initLog.debug,blocp, facesExt[j], name)
facesExternes.append(facesExt[j])
facesExtBloc.append(facesExt[j])
pass
if len(allSharedEdges) > 0:
name = "faceExterne_b%d_%d"%(i,j)
- geompy.addToStudyInFather(blocp, facesBloc[i], name)
+ geomPublishInFather(initLog.debug,blocp, facesBloc[i], name)
facesExternes.append(facesBloc[i])
facesExtBloc.append(facesBloc[i])
aretesInternes += shared
for i in range(len(aretesInternes)):
name = "aretesInternes_%d"%i
- geompy.addToStudyInFather(blocp, aretesInternes[i], name)
+ geomPublishInFather(initLog.debug,blocp, aretesInternes[i], name)
edgesBords = []
for faceExtB in facesExtBloc:
if not isInterne:
edgesBords.append(edges[i])
name = "edgeBord%d"%i
- geompy.addToStudyInFather(blocp,edges[i] , name)
+ geomPublishInFather(initLog.debug,blocp,edges[i] , name)
group = None
if len(edgesBords) > 0:
group = geompy.CreateGroup(blocp, geompy.ShapeType["EDGE"])
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- partition volume sain et bloc, face du bloc recevant la fissure
partieSaine = b
faceBloc = geompy.GetShapesOnShapeAsCompound(volumeSain, volDefaut, geompy.ShapeType["FACE"], GEOM.ST_ON)
- geompy.addToStudy( volumeSainPart, 'volumeSainPart' )
- geompy.addToStudyInFather( volumeSainPart, partieSaine, 'partieSaine' )
- geompy.addToStudyInFather( volumeSainPart, volDefaut, 'volDefaut' )
- geompy.addToStudyInFather( volDefaut, faceBloc, 'faceBloc' )
+ geomPublish(initLog.debug, volumeSainPart, 'volumeSainPart' )
+ geomPublishInFather(initLog.debug, volumeSainPart, partieSaine, 'partieSaine' )
+ geomPublishInFather(initLog.debug, volumeSainPart, volDefaut, 'volDefaut' )
+ geomPublishInFather(initLog.debug, volDefaut, faceBloc, 'faceBloc' )
return volumeSainPart, partieSaine, volDefaut, faceBloc
import math
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from findWireEndVertices import findWireEndVertices
from prolongeWire import prolongeWire
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
- geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe')
- #geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
+ geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
+ #geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
extrem, norms = findWireEndVertices(fondFiss, True)
logging.debug("extrem: %s, norm: %s",extrem, norms)
cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
- geompy.addToStudy(cercle, 'cercle')
+ geomPublish(initLog.debug, cercle, 'cercle')
fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
- geompy.addToStudy(pipeFiss, 'pipeFiss')
+ geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
- geompy.addToStudy(partFissPipe, 'partFissPipe')
+ geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
- geompy.addToStudy(fissPipe, 'fissPipe')
+ geomPublish(initLog.debug, fissPipe, 'fissPipe')
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
- geompy.addToStudy(partPipe, 'partPipe')
+ geomPublish(initLog.debug, partPipe, 'partPipe')
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
for i, edge in enumerate(edgesPipeFiss):
name = "edgePipe%d"%i
- geompy.addToStudyInFather(fissPipe, edge, name)
+ geomPublishInFather(initLog.debug,fissPipe, edge, name)
try:
wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
except:
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
logging.debug("wirePipeFiss construit sous forme de compound")
- geompy.addToStudy(wirePipeFiss, "wirePipeFiss")
+ geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
for i, edge in enumerate(edgesFondFiss):
name = "edgeFondFiss%d"%i
- geompy.addToStudyInFather(fissPipe, edge, name)
+ geomPublishInFather(initLog.debug,fissPipe, edge, name)
wireFondFiss = geompy.MakeWire(edgesFondFiss)
- geompy.addToStudy(wireFondFiss,"wireFondFiss")
+ geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)
\ No newline at end of file
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- recherche et classement des edges du tore par propagate
lencomp = []
compounds = geompy.Propagate(tore)
for i in range(len(compounds)):
- #geompy.addToStudyInFather( tore, compounds[i], 'edges' )
+ #geomPublishInFather(initLog.debug, tore, compounds[i], 'edges' )
props = geompy.BasicProperties(compounds[i])
lencomp.append(props[0])
pass
else:
circles.append(compounds[i])
- geompy.addToStudyInFather( tore, diams[0], 'diams0' )
- geompy.addToStudyInFather( tore, diams[1], 'diams1' )
- geompy.addToStudyInFather( tore, circles[0], 'circles0' )
- geompy.addToStudyInFather( tore, circles[1], 'circles1' )
- geompy.addToStudyInFather( tore, geners[0], 'geners' )
+ geomPublishInFather(initLog.debug, tore, diams[0], 'diams0' )
+ geomPublishInFather(initLog.debug, tore, diams[1], 'diams1' )
+ geomPublishInFather(initLog.debug, tore, circles[0], 'circles0' )
+ geomPublishInFather(initLog.debug, tore, circles[1], 'circles1' )
+ geomPublishInFather(initLog.debug, tore, geners[0], 'geners' )
return diams, circles, geners
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
import math
import numpy as np
if i == 0:
noeudsBords[0].append(node)
#name = "bord0_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
if i == (nbLignes -1):
noeudsBords[2].append(node)
#name = "bord2_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
if j == 0:
noeudsBords[1].append(node)
#name = "bord1_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
if j == (nbCols -1):
noeudsBords[3].append(node)
#name = "bord3_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
k += 1
curve = geompy.MakeInterpol(nodeList, False, False)
#name = "curve_%d"%i
- #geompy.addToStudy( curve, name )
+ #geomPublish(initLog.debug, curve, name )
if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe
curvconts.append(nodeList)
curves.append(curve)
vecteurDefaut = geompy.MakeVector(vertex, cdg)
if vecteurDefaut is not None:
- geompy.addToStudy(normal, "normFillOrig%d"%iface)
- geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface)
+ geomPublish(initLog.debug, normal, "normFillOrig%d"%iface)
+ geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface)
if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
filling = geompy.ChangeOrientation(filling)
- geompy.addToStudy( filling, "filling%d"%iface )
+ geomPublish(initLog.debug, filling, "filling%d"%iface )
#geompy.ExportBREP(filling, "filling.brep")
iface = iface+1
fillings.append(filling)
curve = geompy.MakeInterpol(nodes, False, False)
curves.append(curve)
fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
- geompy.addToStudy( fillcont, "filcont%d"%icont )
+ geomPublish(initLog.debug, fillcont, "filcont%d"%icont )
fillconts.append(fillcont)
icont = icont+1
pass # --- loop while there are remaining nodes
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
import math
import numpy as np
allNodeIds = meshQuad.GetNodesId()
while len(allNodeIds):
+ logging.debug("len(allNodeIds): %s ", len(allNodeIds))
nodeIds = allNodeIds
for idNode in nodeIds: # rechercher un coin
elems = meshQuad.GetNodeInverseElements(idNode)
if i == 0:
noeudsBords[0].append(node)
#name = "bord0_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
if i == (nbLignes -1):
noeudsBords[2].append(node)
#name = "bord2_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
if j == 0:
noeudsBords[1].append(node)
#name = "bord1_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
if j == (nbCols -1):
noeudsBords[3].append(node)
#name = "bord3_%d"%k
- #geompy.addToStudy( node, name )
+ #geomPublish(initLog.debug, node, name )
k += 1
curve = geompy.MakeInterpol(nodeList, False, False)
#name = "curve_%d"%i
- #geompy.addToStudy( curve, name )
+ #geomPublish(initLog.debug, curve, name )
if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe
curvconts.append(nodeList)
curves.append(curve)
vecteurDefaut = geompy.MakeVector(vertex, cdg)
if vecteurDefaut is not None:
- geompy.addToStudy(normal, "normFillOrig%d"%iface)
- geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface)
+ geomPublish(initLog.debug, normal, "normFillOrig%d"%iface)
+ geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface)
if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
filling = geompy.ChangeOrientation(filling)
- geompy.addToStudy( filling, "filling%d"%iface )
+ geomPublish(initLog.debug, filling, "filling%d"%iface )
#geompy.ExportBREP(filling, "filling.brep")
iface = iface+1
fillings.append(filling)
curve = geompy.MakeInterpol(nodes, False, False)
curves.append(curve)
fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
- geompy.addToStudy( fillcont, "filcont%d"%icont )
+ geomPublish(initLog.debug, fillcont, "filcont%d"%icont )
fillconts.append(fillcont)
icont = icont+1
pass # --- loop while there are remaining nodes
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import GEOM
from listOfExtraFunctions import createNewMeshesFromCorner
# A partir des lignes de chaque face,
# on recrée un objet GEOM temporaire par filling.
filling = geompy.MakeFilling(geompy.MakeCompound(face), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
- geompy.addToStudy(filling, 'filling_{0}'.format(i + 1))
+ geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1))
tmpFillings.append(filling)
for face in setOfNodes:
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
if len(tmpExplodeRef) == len(tmpExplodeNum):
- geompy.addToStudy(filling, "faceNonCoupee_{0}".format(i + 1))
+ geomPublish(initLog.debug, filling, "faceNonCoupee_{0}".format(i + 1))
facesNonCoupees.append(filling)
else:
- geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1))
+ geomPublish(initLog.debug, filling, "faceCoupee_{0}".format(i + 1))
facesCoupees.append(filling)
fillings = facesCoupees, facesNonCoupees
tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True)
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True)
if len(tmpExplodeRef) == len(tmpExplodeNum):
- geompy.addToStudy(filling, "areteNonCoupee_{0}".format(i + 1))
+ geomPublish(initLog.debug, filling, "areteNonCoupee_{0}".format(i + 1))
aretesNonCoupees.append(filling)
else:
- geompy.addToStudy(filling, "areteCoupee_{0}".format(i + 1))
+ geomPublish(initLog.debug, filling, "areteCoupee_{0}".format(i + 1))
aretesCoupees.append(filling)
bords_Partages = aretesCoupees, aretesNonCoupees
# TODO: A enlever
# for i, face in enumerate(setOfLines):
# for j, line in enumerate(face):
-# geompy.addToStudy(line, 'face{0}_ligne{1}'.format(i + 1, j + 1))
+# geomPublish(initLog.debug, line, 'face{0}_ligne{1}'.format(i + 1, j + 1))
#TODO: A enlever
# for i, filling in enumerate(fillings[0]):
-# geompy.addToStudy(filling, 'filling_{0}'.format(i + 1))
+# geomPublish(initLog.debug, filling, 'filling_{0}'.format(i + 1))
# for j, line in enumerate(setOfLines[i]):
# geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1))
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
from sortFaces import sortFaces
def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
"""
logging.info('start')
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
- geompy.addToStudy(partShapeDefaut, 'partShapeDefaut')
+ geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
if pointInterne is not None:
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
facesPortFissure = facesPartShapeDefautSorted[-1]
- geompy.addToStudy(facesPortFissure, "facesPortFissure")
+ geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
return facesPortFissure
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import math
from triedreBase import triedreBase
O, OX, OY, OZ = triedreBase()
logging.debug("alpha",alpha)
logging.debug("beta",beta)
if trace:
- geompy.addToStudy( rot1, 'rot1' )
- geompy.addToStudy( axe2, 'axe2' )
- geompy.addToStudy( rot2, 'rot2' )
+ geomPublish(initLog.debug, rot1, 'rot1' )
+ geomPublish(initLog.debug, axe2, 'axe2' )
+ geomPublish(initLog.debug, rot2, 'rot2' )
xyz = geompy.PointCoordinates(point)
trans = geompy.MakeTranslation(rot2, xyz[0], xyz[1], xyz[2])
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- construction d'une shape de dectection des éléments à modifier suite à la la duplication des noeuds de la face fissure (d'un coté de la face)
normal = geompy.GetNormal(face, vertex)
extrusionFaceFissure = geompy.MakePrismVecH(facesFissure, normal, 100)
- geompy.addToStudy(extrusionFaceFissure, "extrusionFaceFissure")
+ geomPublish(initLog.debug, extrusionFaceFissure, "extrusionFaceFissure")
return extrusionFaceFissure, normal
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# -----------------------------------------------------------------------------
# --- tri par longueur des 3 generatrices
gencnt= genx[i]
pass
- geompy.addToStudyInFather( tore, genext, 'genext' )
- geompy.addToStudyInFather( tore, genint, 'genint' )
- geompy.addToStudyInFather( tore, gencnt, 'gencnt' )
+ geomPublishInFather(initLog.debug, tore, genext, 'genext' )
+ geomPublishInFather(initLog.debug, tore, genint, 'genint' )
+ geomPublishInFather(initLog.debug, tore, gencnt, 'gencnt' )
return genext, genint, gencnt
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
import math
from triedreBase import triedreBase
Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3)
generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1)
- #geompy.addToStudy( Vertex_1, 'Vertex_1' )
- #geompy.addToStudy( Vertex_2, 'Vertex_2' )
- #geompy.addToStudy( Vertex_3, 'Vertex_3' )
- #geompy.addToStudy( Arc_1, 'Arc_1' )
- #geompy.addToStudy( generatrice, 'generatrice' )
+ #geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
+ #geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
+ #geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
+ #geomPublish(initLog.debug, Arc_1, 'Arc_1' )
+ #geomPublish(initLog.debug, generatrice, 'generatrice' )
# --- face circulaire sur la generatrice, pour extrusion
Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0)
FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1)
- #geompy.addToStudy( Circle_1, 'Circle_1' )
- #geompy.addToStudy( Rotation_1, 'Rotation_1' )
- #geompy.addToStudy( Translation_1, 'Translation_1' )
- #geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' )
+ #geomPublish(initLog.debug, Circle_1, 'Circle_1' )
+ #geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
+ #geomPublish(initLog.debug, Translation_1, 'Translation_1' )
+ #geomPublish(initLog.debug, FaceGenFiss, 'FaceGenFiss' )
# --- tore extrude
Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3)
FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1)
- #geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
- #geompy.addToStudy( Line_1, 'Line_1' )
- #geompy.addToStudy( FaceFissure, 'FaceFissure' )
+ #geomPublishInFather(initLog.debug, generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
+ #geomPublish(initLog.debug, Line_1, 'Line_1' )
+ #geomPublish(initLog.debug, FaceFissure, 'FaceFissure' )
# --- tore coupe en 2 demi tore de section 1/2 disque
Plane_1 = geompy.MakePlane(O, OZ, 2000)
Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
- geompy.addToStudy(Pipe1Part , 'Pipe1Part' )
+ geomPublish(initLog.debug, Pipe1Part , 'Pipe1Part' )
return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
# --- origine et vecteurs de base
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
- geompy.addToStudy( O, 'O' )
- geompy.addToStudy( OX, 'OX' )
- geompy.addToStudy( OY, 'OY' )
- geompy.addToStudy( OZ, 'OZ' )
+ geomPublish(initLog.debug, O, 'O' )
+ geomPublish(initLog.debug, OX, 'OX' )
+ geomPublish(initLog.debug, OY, 'OY' )
+ geomPublish(initLog.debug, OZ, 'OZ' )
return O, OX, OY, OZ
import logging
from geomsmesh import geompy
+from geomsmesh import geomPublish
+from geomsmesh import geomPublishInFather
+import initLog
def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau):
"""
if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
edgesFissExtPeau.append(edgesPeauFis[0])
name="edgesFissExtPeau%d"%j
- geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
+ geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
j += 1
return edgesFissExtPeau
\ No newline at end of file