mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-12 00:29:17 +05:00
generalisation publication conditionnelle
This commit is contained in:
parent
fd5ea41038
commit
a8380feec5
@ -16,7 +16,7 @@ runall = True
|
|||||||
if runall:
|
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,]
|
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
|
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
|
from blocFissure.gmu import geomsmesh
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from blocFissure import gmu
|
from geomsmesh import geompy, smesh
|
||||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
import math
|
import math
|
||||||
import GEOM
|
import GEOM
|
||||||
@ -13,13 +15,13 @@ import SMESH
|
|||||||
#import NETGENPlugin
|
#import NETGENPlugin
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
from fissureGenerique import fissureGenerique
|
||||||
|
|
||||||
from blocFissure.gmu.initEtude import initEtude
|
from initEtude import initEtude
|
||||||
from blocFissure.gmu.triedreBase import triedreBase
|
from triedreBase import triedreBase
|
||||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||||
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
|
from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
|
||||||
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
|
from construitFissureGenerale import construitFissureGenerale
|
||||||
|
|
||||||
O, OX, OY, OZ = triedreBase()
|
O, OX, OY, OZ = triedreBase()
|
||||||
|
|
||||||
@ -97,8 +99,8 @@ class casStandard(fissureGenerique):
|
|||||||
shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
|
shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP")
|
||||||
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
|
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
|
geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] )
|
||||||
geompy.addToStudy( shellFiss, 'shellFiss' )
|
geomPublish(initLog.debug, shellFiss, 'shellFiss' )
|
||||||
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
|
geomPublishInFather(initLog.debug, shellFiss, fondFiss, 'fondFiss' )
|
||||||
|
|
||||||
|
|
||||||
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1])
|
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1])
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
def compoundFromList(elements, nom=None):
|
def compoundFromList(elements, nom=None):
|
||||||
"""
|
"""
|
||||||
@ -21,7 +24,7 @@ def compoundFromList(elements, nom=None):
|
|||||||
for i,a in enumerate(shapeList):
|
for i,a in enumerate(shapeList):
|
||||||
nom = nom +"%d"%i
|
nom = nom +"%d"%i
|
||||||
logging.debug('nom: %s',nom)
|
logging.debug('nom: %s',nom)
|
||||||
geompy.addToStudy(a, nom)
|
geomPublish(initLog.debug, a, nom)
|
||||||
|
|
||||||
shapeCompound = None
|
shapeCompound = None
|
||||||
if len(shapeList) > 0:
|
if len(shapeList) > 0:
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
from sortEdges import sortEdges
|
from sortEdges import sortEdges
|
||||||
|
|
||||||
@ -30,18 +33,18 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
|
|||||||
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
|
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
|
||||||
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
||||||
name='compoundRay%d'%k
|
name='compoundRay%d'%k
|
||||||
geompy.addToStudy(comp, name)
|
geomPublish(initLog.debug, comp, name)
|
||||||
else:
|
else:
|
||||||
idfin = min(len(gptsdisks), numout+1)
|
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
|
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)
|
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
|
||||||
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
||||||
name='compoundRay%d'%k
|
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)
|
nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
|
||||||
nappes.append(nappe)
|
nappes.append(nappe)
|
||||||
name='nappe%d'%k
|
name='nappe%d'%k
|
||||||
geompy.addToStudy(nappe, name)
|
geomPublish(initLog.debug, nappe, name)
|
||||||
facesDebouchantes[i] = True
|
facesDebouchantes[i] = True
|
||||||
listNappes.append(nappes)
|
listNappes.append(nappes)
|
||||||
|
|
||||||
@ -50,8 +53,8 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
|
|||||||
if facesDebouchantes[i]:
|
if facesDebouchantes[i]:
|
||||||
for k, face in enumerate(facesPipePeau):
|
for k, face in enumerate(facesPipePeau):
|
||||||
#logging.debug('i, k, face, nappes[0] %s %s %s %s', i, k, face, nappes[0])
|
#logging.debug('i, k, face, nappes[0] %s %s %s %s', i, k, face, nappes[0])
|
||||||
#geompy.addToStudy(nappes[0], 'lanappe')
|
#geomPublish(initLog.debug, nappes[0], 'lanappe')
|
||||||
#geompy.addToStudy(face, 'laface')
|
#geomPublish(initLog.debug, face, 'laface')
|
||||||
edge = geompy.MakeSection(face, nappes[0])
|
edge = geompy.MakeSection(face, nappes[0])
|
||||||
if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0:
|
if geompy.NbShapes(edge, geompy.ShapeType["EDGE"]) > 0:
|
||||||
idFacesDebouchantes[i] = k
|
idFacesDebouchantes[i] = k
|
||||||
@ -93,13 +96,13 @@ def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
|
|||||||
ednouv.append(ed)
|
ednouv.append(ed)
|
||||||
logging.debug(" edges issues de la partition: %s", ednouv)
|
logging.debug(" edges issues de la partition: %s", ednouv)
|
||||||
for ii, ed in enumerate(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)
|
[edsorted, minl,maxl] = sortEdges(ednouv)
|
||||||
logging.debug(" longueur edge trouvée: %s", maxl)
|
logging.debug(" longueur edge trouvée: %s", maxl)
|
||||||
edge = edsorted[-1]
|
edge = edsorted[-1]
|
||||||
edges.append(edge)
|
edges.append(edge)
|
||||||
name = 'edgeEndPipe%d'%k
|
name = 'edgeEndPipe%d'%k
|
||||||
geompy.addToStudy(edge, name)
|
geomPublish(initLog.debug, edge, name)
|
||||||
listEdges.append(edges)
|
listEdges.append(edges)
|
||||||
|
|
||||||
return (listEdges, idFacesDebouchantes)
|
return (listEdges, idFacesDebouchantes)
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import salome
|
import salome
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
from geomsmesh import smesh
|
from geomsmesh import smesh
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
@ -130,7 +133,7 @@ def construitFissureGenerale(maillagesSains,
|
|||||||
(fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
|
(fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
|
||||||
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
||||||
for i,edge in enumerate(edgesFondFiss):
|
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
|
# --- peau et face de fissure
|
||||||
#
|
#
|
||||||
@ -195,7 +198,7 @@ def construitFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
for i, avc in enumerate(aretesVivesCoupees):
|
for i, avc in enumerate(aretesVivesCoupees):
|
||||||
name = "areteViveCoupee%d"%i
|
name = "areteViveCoupee%d"%i
|
||||||
geompy.addToStudy(avc, name)
|
geomPublish(initLog.debug, avc, name)
|
||||||
|
|
||||||
# --- identification des faces et edges de fissure externe pour maillage
|
# --- identification des faces et edges de fissure externe pour maillage
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from checkDecoupePartition import checkDecoupePartition
|
from checkDecoupePartition import checkDecoupePartition
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@ -35,7 +38,7 @@ def construitPartitionsPeauFissure(facesDefaut, fissPipe):
|
|||||||
fissPipePart = fissPipe
|
fissPipePart = fissPipe
|
||||||
part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
partitionsPeauFissFond.append(part)
|
partitionsPeauFissFond.append(part)
|
||||||
geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart )
|
geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
|
||||||
else:
|
else:
|
||||||
partitionsPeauFissFond.append(None)
|
partitionsPeauFissFond.append(None)
|
||||||
ipart = ipart +1
|
ipart = ipart +1
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from projettePointSurCourbe import projettePointSurCourbe
|
from projettePointSurCourbe import projettePointSurCourbe
|
||||||
|
|
||||||
def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
||||||
@ -20,9 +23,9 @@ 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)
|
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]
|
centre = ptEdgeFond[idFillingFromBout[i]][idf]
|
||||||
name = "centre%d"%idf
|
name = "centre%d"%idf
|
||||||
geompy.addToStudy(centre, name)
|
geomPublish(initLog.debug, centre, name)
|
||||||
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][idf]
|
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][idf]
|
||||||
geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau")
|
geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau")
|
||||||
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
|
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
|
||||||
edgesCirc = []
|
edgesCirc = []
|
||||||
for grpEdgesCirc in grpsEdgesCirc:
|
for grpEdgesCirc in grpsEdgesCirc:
|
||||||
@ -48,7 +51,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
else:
|
else:
|
||||||
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
|
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
|
||||||
name ="bout%d"%k
|
name ="bout%d"%k
|
||||||
geompy.addToStudyInFather(centre, bout, name)
|
geomPublishInFather(initLog.debug, centre, bout, name)
|
||||||
# enregistrement des points dans la structure
|
# enregistrement des points dans la structure
|
||||||
points = []
|
points = []
|
||||||
for j in range(nbsegRad +1):
|
for j in range(nbsegRad +1):
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
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
|
# --- crée zone géométrique défaut a partir d'un filling
|
||||||
@ -21,15 +24,15 @@ def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50):
|
|||||||
trace = True
|
trace = True
|
||||||
facesDefaut = filling
|
facesDefaut = filling
|
||||||
centreSphere = geompy.MakeCDG(shapeDefaut)
|
centreSphere = geompy.MakeCDG(shapeDefaut)
|
||||||
geompy.addToStudy(centreSphere, "cdg_defaut")
|
geomPublish(initLog.debug, centreSphere, "cdg_defaut")
|
||||||
centreDefaut = geompy.MakeProjection(centreSphere, filling)
|
centreDefaut = geompy.MakeProjection(centreSphere, filling)
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(centreDefaut, "centreDefaut")
|
geomPublish(initLog.debug, centreDefaut, "centreDefaut")
|
||||||
normalDefaut = geompy.GetNormal(filling, centreDefaut)
|
normalDefaut = geompy.GetNormal(filling, centreDefaut)
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(normalDefaut, "normalDefaut")
|
geomPublish(initLog.debug, normalDefaut, "normalDefaut")
|
||||||
extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion)
|
extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion)
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
|
geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut")
|
||||||
|
|
||||||
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
|
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from prolongeVertices import prolongeVertices
|
from prolongeVertices import prolongeVertices
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@ -42,57 +45,57 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
curves.append(curve)
|
curves.append(curve)
|
||||||
if trace:
|
if trace:
|
||||||
name="poly_%d"%aShape
|
name="poly_%d"%aShape
|
||||||
geompy.addToStudy(curve, name)
|
geomPublish(initLog.debug, curve, name)
|
||||||
#
|
#
|
||||||
cdg = geompy.MakeCDG(curve)
|
cdg = geompy.MakeCDG(curve)
|
||||||
cdgs.append(cdg)
|
cdgs.append(cdg)
|
||||||
if trace:
|
if trace:
|
||||||
name="cdgpoly_%d"%aShape
|
name="cdgpoly_%d"%aShape
|
||||||
geompy.addToStudy(cdg, name)
|
geomPublish(initLog.debug, cdg, name)
|
||||||
#
|
#
|
||||||
projCdg = geompy.MakeProjection(cdg, face)
|
projCdg = geompy.MakeProjection(cdg, face)
|
||||||
projs.append(projCdg)
|
projs.append(projCdg)
|
||||||
if trace:
|
if trace:
|
||||||
name="projCdg_%d"%aShape
|
name="projCdg_%d"%aShape
|
||||||
geompy.addToStudy(projCdg, name)
|
geomPublish(initLog.debug, projCdg, name)
|
||||||
#
|
#
|
||||||
normal = geompy.GetNormal(face, projCdg)
|
normal = geompy.GetNormal(face, projCdg)
|
||||||
normals.append(normal)
|
normals.append(normal)
|
||||||
if trace:
|
if trace:
|
||||||
name="normal_%d"%aShape
|
name="normal_%d"%aShape
|
||||||
geompy.addToStudy(normal, name)
|
geomPublish(initLog.debug, normal, name)
|
||||||
#
|
#
|
||||||
extrusion = geompy.MakePrismVecH2Ways(curve, normal, 10)
|
extrusion = geompy.MakePrismVecH2Ways(curve, normal, 10)
|
||||||
extrusions.append(extrusion)
|
extrusions.append(extrusion)
|
||||||
if trace:
|
if trace:
|
||||||
name="extrusion_%d"%aShape
|
name="extrusion_%d"%aShape
|
||||||
geompy.addToStudy(extrusion, name)
|
geomPublish(initLog.debug, extrusion, name)
|
||||||
#
|
#
|
||||||
verticesProlongees = prolongeVertices(vertices)
|
verticesProlongees = prolongeVertices(vertices)
|
||||||
#
|
#
|
||||||
curveprol = geompy.MakePolyline(verticesProlongees, False)
|
curveprol = geompy.MakePolyline(verticesProlongees, False)
|
||||||
if trace:
|
if trace:
|
||||||
name="polyProl_%d"%aShape
|
name="polyProl_%d"%aShape
|
||||||
geompy.addToStudy(curveprol, name)
|
geomPublish(initLog.debug, curveprol, name)
|
||||||
#
|
#
|
||||||
extruprol = geompy.MakePrismVecH2Ways(curveprol, normal, 10)
|
extruprol = geompy.MakePrismVecH2Ways(curveprol, normal, 10)
|
||||||
if trace:
|
if trace:
|
||||||
name="extruProl_%d"%aShape
|
name="extruProl_%d"%aShape
|
||||||
geompy.addToStudy(extruprol, name)
|
geomPublish(initLog.debug, extruprol, name)
|
||||||
#
|
#
|
||||||
partition = geompy.MakePartition([face], [extruprol], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
partition = geompy.MakePartition([face], [extruprol], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
partitions.append(partition)
|
partitions.append(partition)
|
||||||
if trace:
|
if trace:
|
||||||
name="partition_%d"%aShape
|
name="partition_%d"%aShape
|
||||||
geompy.addToStudy(partition, name)
|
geomPublish(initLog.debug, partition, name)
|
||||||
pass
|
pass
|
||||||
#
|
#
|
||||||
|
|
||||||
centreSphere = geompy.MakeCDG(shapeDefaut)
|
centreSphere = geompy.MakeCDG(shapeDefaut)
|
||||||
geompy.addToStudy(centreSphere, "cdg_defaut")
|
geomPublish(initLog.debug, centreSphere, "cdg_defaut")
|
||||||
ccurves = geompy.MakeCompound(curves)
|
ccurves = geompy.MakeCompound(curves)
|
||||||
gravCenter = geompy.MakeCDG(ccurves)
|
gravCenter = geompy.MakeCDG(ccurves)
|
||||||
geompy.addToStudy(gravCenter, "cdg_curves")
|
geomPublish(initLog.debug, gravCenter, "cdg_curves")
|
||||||
for i in range(len(partitions)):
|
for i in range(len(partitions)):
|
||||||
if trace:
|
if trace:
|
||||||
logging.debug(" --- original shape %s", origShapes[i])
|
logging.debug(" --- original shape %s", origShapes[i])
|
||||||
@ -114,7 +117,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
if d == minDist:
|
if d == minDist:
|
||||||
aFace = facesToSort[j]
|
aFace = facesToSort[j]
|
||||||
name="decoupe_%d"%origShapes[i]
|
name="decoupe_%d"%origShapes[i]
|
||||||
geompy.addToStudy(aFace, name)
|
geomPublish(initLog.debug, aFace, name)
|
||||||
decoupes.append(aFace)
|
decoupes.append(aFace)
|
||||||
break
|
break
|
||||||
pass
|
pass
|
||||||
@ -123,7 +126,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
facesDefaut = decoupes[0]
|
facesDefaut = decoupes[0]
|
||||||
if len(decoupes) > 1:
|
if len(decoupes) > 1:
|
||||||
facesDefaut = geompy.MakePartition(decoupes, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
facesDefaut = geompy.MakePartition(decoupes, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
geompy.addToStudy(facesDefaut, "facesDefaut")
|
geomPublish(initLog.debug, facesDefaut, "facesDefaut")
|
||||||
|
|
||||||
shells=[]
|
shells=[]
|
||||||
if len(decoupes) > 1: # plusieurs faces de defaut
|
if len(decoupes) > 1: # plusieurs faces de defaut
|
||||||
@ -159,7 +162,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
theFaces[k:k+1] = []
|
theFaces[k:k+1] = []
|
||||||
theShell = geompy.MakeShell(aShell)
|
theShell = geompy.MakeShell(aShell)
|
||||||
name = "theShell%d"%len(shells)
|
name = "theShell%d"%len(shells)
|
||||||
geompy.addToStudy(theShell,name)
|
geomPublish(initLog.debug, theShell,name)
|
||||||
shells.append(theShell)
|
shells.append(theShell)
|
||||||
#
|
#
|
||||||
distances = []
|
distances = []
|
||||||
@ -175,7 +178,7 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
subFaces = [facesDefaut]
|
subFaces = [facesDefaut]
|
||||||
theShellDefaut = geompy.MakeShell(subFaces)
|
theShellDefaut = geompy.MakeShell(subFaces)
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(theShellDefaut,"theShellDefaut")
|
geomPublish(initLog.debug, theShellDefaut,"theShellDefaut")
|
||||||
|
|
||||||
theFaces = geompy.ExtractShapes(theShellDefaut, geompy.ShapeType["FACE"], True)
|
theFaces = geompy.ExtractShapes(theShellDefaut, geompy.ShapeType["FACE"], True)
|
||||||
distances = []
|
distances = []
|
||||||
@ -188,10 +191,10 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
|
|
||||||
centreDefaut = geompy.MakeProjection(centreSphere, theFaces[index])
|
centreDefaut = geompy.MakeProjection(centreSphere, theFaces[index])
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(centreDefaut, "centreDefaut")
|
geomPublish(initLog.debug, centreDefaut, "centreDefaut")
|
||||||
normalDefaut = geompy.GetNormal(subFaces[index], centreDefaut)
|
normalDefaut = geompy.GetNormal(subFaces[index], centreDefaut)
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(normalDefaut, "normalDefaut")
|
geomPublish(initLog.debug, normalDefaut, "normalDefaut")
|
||||||
extrusionDefaut = geompy.MakePrismVecH(theShellDefaut, normalDefaut, -lgExtrusion)
|
extrusionDefaut = geompy.MakePrismVecH(theShellDefaut, normalDefaut, -lgExtrusion)
|
||||||
info = geompy.ShapeInfo(extrusionDefaut)
|
info = geompy.ShapeInfo(extrusionDefaut)
|
||||||
logging.debug("shape info %s", info)
|
logging.debug("shape info %s", info)
|
||||||
@ -202,6 +205,6 @@ def creeZoneDefautGeom(objetSain, shapeDefaut, origShapes, verticesShapes, dmoye
|
|||||||
solid0 = geompy.MakeFuse(solid0, solids[i])
|
solid0 = geompy.MakeFuse(solid0, solids[i])
|
||||||
extrusionDefaut = solid0
|
extrusionDefaut = solid0
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
|
geomPublish(initLog.debug, extrusionDefaut, "extrusionDefaut")
|
||||||
|
|
||||||
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
|
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
from whichSide import whichSide
|
from whichSide import whichSide
|
||||||
|
|
||||||
@ -32,19 +35,19 @@ def extractionOrientee(face, obj, ref, shapeType, tol, prefix=""):
|
|||||||
shapesInside.append(shape)
|
shapesInside.append(shape)
|
||||||
if trace:
|
if trace:
|
||||||
name = prefix + "_Inside%d"%i
|
name = prefix + "_Inside%d"%i
|
||||||
geompy.addToStudyInFather(obj, shape, name)
|
geomPublishInFather(initLog.debug, obj, shape, name)
|
||||||
i+=1
|
i+=1
|
||||||
elif side == -sideRef:
|
elif side == -sideRef:
|
||||||
shapesOutside.append(shape)
|
shapesOutside.append(shape)
|
||||||
if trace:
|
if trace:
|
||||||
name = prefix + "_Outside%d"%j
|
name = prefix + "_Outside%d"%j
|
||||||
geompy.addToStudyInFather(obj, shape, name)
|
geomPublishInFather(initLog.debug, obj, shape, name)
|
||||||
j+=1
|
j+=1
|
||||||
elif side == 0:
|
elif side == 0:
|
||||||
shapesOnside.append(shape)
|
shapesOnside.append(shape)
|
||||||
if trace:
|
if trace:
|
||||||
name = prefix + "_Onside%d"%k
|
name = prefix + "_Onside%d"%k
|
||||||
geompy.addToStudyInFather(obj, shape, name)
|
geomPublishInFather(initLog.debug, obj, shape, name)
|
||||||
k+=1
|
k+=1
|
||||||
logging.debug("--- shape was %s", name)
|
logging.debug("--- shape was %s", name)
|
||||||
return [shapesInside, shapesOutside, shapesOnside]
|
return [shapesInside, shapesOutside, shapesOnside]
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
from whichSideMulti import whichSideMulti
|
from whichSideMulti import whichSideMulti
|
||||||
|
|
||||||
@ -30,19 +33,19 @@ def extractionOrienteeMulti(faces, ifil, obj, centre, shapeType, tol, prefix="")
|
|||||||
shapesInside.append(shape)
|
shapesInside.append(shape)
|
||||||
if trace:
|
if trace:
|
||||||
name = prefix + "_Inside%d"%i
|
name = prefix + "_Inside%d"%i
|
||||||
geompy.addToStudyInFather(obj, shape, name)
|
geomPublishInFather(initLog.debug, obj, shape, name)
|
||||||
i+=1
|
i+=1
|
||||||
elif side == -1:
|
elif side == -1:
|
||||||
shapesOutside.append(shape)
|
shapesOutside.append(shape)
|
||||||
if trace:
|
if trace:
|
||||||
name = prefix + "_Outside%d"%j
|
name = prefix + "_Outside%d"%j
|
||||||
geompy.addToStudyInFather(obj, shape, name)
|
geomPublishInFather(initLog.debug, obj, shape, name)
|
||||||
j+=1
|
j+=1
|
||||||
elif side == 0:
|
elif side == 0:
|
||||||
shapesOnside.append(shape)
|
shapesOnside.append(shape)
|
||||||
if trace:
|
if trace:
|
||||||
name = prefix + "_Onside%d"%k
|
name = prefix + "_Onside%d"%k
|
||||||
geompy.addToStudyInFather(obj, shape, name)
|
geomPublishInFather(initLog.debug, obj, shape, name)
|
||||||
k+=1
|
k+=1
|
||||||
logging.debug("--- shape was %s", name)
|
logging.debug("--- shape was %s", name)
|
||||||
return [shapesInside, shapesOutside, shapesOnside]
|
return [shapesInside, shapesOutside, shapesOnside]
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- TORE
|
# --- TORE
|
||||||
@ -20,10 +23,10 @@ def facesCirculaires(bloc, tore):
|
|||||||
|
|
||||||
faces = geompy.GetShapesOnShape(bloc, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
faces = geompy.GetShapesOnShape(bloc, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
||||||
|
|
||||||
geompy.addToStudyInFather( tore, faces[0], 'face0' )
|
geomPublishInFather(initLog.debug, tore, faces[0], 'face0' )
|
||||||
geompy.addToStudyInFather( tore, faces[1], 'face1' )
|
geomPublishInFather(initLog.debug, tore, faces[1], 'face1' )
|
||||||
geompy.addToStudyInFather( tore, faces[2], 'face2' )
|
geomPublishInFather(initLog.debug, tore, faces[2], 'face2' )
|
||||||
geompy.addToStudyInFather( tore, faces[3], 'face3' )
|
geomPublishInFather(initLog.debug, tore, faces[3], 'face3' )
|
||||||
|
|
||||||
centres = [None, None, None, None]
|
centres = [None, None, None, None]
|
||||||
[v1,centres[0],v3] = geompy.ExtractShapes(faces[0], geompy.ShapeType["VERTEX"], True)
|
[v1,centres[0],v3] = geompy.ExtractShapes(faces[0], geompy.ShapeType["VERTEX"], True)
|
||||||
@ -31,10 +34,10 @@ def facesCirculaires(bloc, tore):
|
|||||||
[v1,centres[2],v3] = geompy.ExtractShapes(faces[2], 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)
|
[v1,centres[3],v3] = geompy.ExtractShapes(faces[3], geompy.ShapeType["VERTEX"], True)
|
||||||
|
|
||||||
geompy.addToStudyInFather( faces[0], centres[0], 'centre0' )
|
geomPublishInFather(initLog.debug, faces[0], centres[0], 'centre0' )
|
||||||
geompy.addToStudyInFather( faces[1], centres[1], 'centre1' )
|
geomPublishInFather(initLog.debug, faces[1], centres[1], 'centre1' )
|
||||||
geompy.addToStudyInFather( faces[2], centres[2], 'centre2' )
|
geomPublishInFather(initLog.debug, faces[2], centres[2], 'centre2' )
|
||||||
geompy.addToStudyInFather( faces[3], centres[3], 'centre3' )
|
geomPublishInFather(initLog.debug, faces[3], centres[3], 'centre3' )
|
||||||
|
|
||||||
alledges = [None, None, None, None]
|
alledges = [None, None, None, None]
|
||||||
alledges[0] = geompy.ExtractShapes(faces[0], geompy.ShapeType["EDGE"], True)
|
alledges[0] = geompy.ExtractShapes(faces[0], geompy.ShapeType["EDGE"], True)
|
||||||
@ -60,7 +63,7 @@ def facesCirculaires(bloc, tore):
|
|||||||
dicoedge[edgid] = edgesface[j]
|
dicoedge[edgid] = edgesface[j]
|
||||||
edges.append(edgesface[j])
|
edges.append(edgesface[j])
|
||||||
named = 'edge_' + str(i) + '_' +str(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)
|
vertices = geompy.ExtractShapes(edgesface[j], geompy.ShapeType["VERTEX"], False)
|
||||||
#firstVertex = geompy.GetFirstVertex(edgesface[j])
|
#firstVertex = geompy.GetFirstVertex(edgesface[j])
|
||||||
if geompy.GetSubShapeID(tore, vertices[0]) != geompy.GetSubShapeID(tore, centres[i]):
|
if geompy.GetSubShapeID(tore, vertices[0]) != geompy.GetSubShapeID(tore, centres[i]):
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
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
|
# --- faces fissure dans et hors tore, et edges face hors tore
|
||||||
@ -24,18 +27,18 @@ def facesFissure(blocp, faceFissure, extrusionDefaut, genint):
|
|||||||
facefissintore = f1
|
facefissintore = f1
|
||||||
facefissoutore = f0
|
facefissoutore = f0
|
||||||
|
|
||||||
geompy.addToStudyInFather(faceFissure, facefissintore,'facefissintore')
|
geomPublishInFather(initLog.debug, faceFissure, facefissintore,'facefissintore')
|
||||||
geompy.addToStudyInFather(faceFissure, facefissoutore,'facefissoutore')
|
geomPublishInFather(initLog.debug, faceFissure, facefissoutore,'facefissoutore')
|
||||||
|
|
||||||
edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
|
edgeint = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_IN)
|
||||||
edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
|
edgeext = geompy.GetShapesOnShape(extrusionDefaut, facefissoutore, geompy.ShapeType["EDGE"], GEOM.ST_ON)
|
||||||
|
|
||||||
for i in range(len(edgeint)):
|
for i in range(len(edgeint)):
|
||||||
name = "edgeint_%d"%i
|
name = "edgeint_%d"%i
|
||||||
geompy.addToStudyInFather(facefissoutore, edgeint[i],name)
|
geomPublishInFather(initLog.debug, facefissoutore, edgeint[i],name)
|
||||||
for i in range(len(edgeext)):
|
for i in range(len(edgeext)):
|
||||||
name = "edgeext_%d"%i
|
name = "edgeext_%d"%i
|
||||||
geompy.addToStudyInFather(facefissoutore, edgeext[i],name)
|
geomPublishInFather(initLog.debug, facefissoutore, edgeext[i],name)
|
||||||
|
|
||||||
reverext = []
|
reverext = []
|
||||||
if len(edgeext) > 1:
|
if len(edgeext) > 1:
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
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é
|
# --- identification des faces tore et fissure dans le solide hors tore du bloc partitionné
|
||||||
@ -21,9 +24,9 @@ def facesToreInBloc(blocp, facefissoutore, facetore1, facetore2):
|
|||||||
blocFaceTore1 = geompy.GetInPlaceByHistory(blocp, facetore1)
|
blocFaceTore1 = geompy.GetInPlaceByHistory(blocp, facetore1)
|
||||||
blocFaceTore2 = geompy.GetInPlaceByHistory(blocp, facetore2)
|
blocFaceTore2 = geompy.GetInPlaceByHistory(blocp, facetore2)
|
||||||
|
|
||||||
geompy.addToStudyInFather(blocp, blocFaceFiss,'blocFaceFiss')
|
geomPublishInFather(initLog.debug, blocp, blocFaceFiss,'blocFaceFiss')
|
||||||
geompy.addToStudyInFather(blocp, blocFaceTore1,'blocFaceTore1')
|
geomPublishInFather(initLog.debug, blocp, blocFaceTore1,'blocFaceTore1')
|
||||||
geompy.addToStudyInFather(blocp, blocFaceTore2,'blocFaceTore2')
|
geomPublishInFather(initLog.debug, blocp, blocFaceTore2,'blocFaceTore2')
|
||||||
|
|
||||||
return blocFaceFiss, blocFaceTore1, blocFaceTore2
|
return blocFaceFiss, blocFaceTore1, blocFaceTore2
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from extractionOrientee import extractionOrientee
|
from extractionOrientee import extractionOrientee
|
||||||
from getSubshapeIds import getSubshapeIds
|
from getSubshapeIds import getSubshapeIds
|
||||||
|
|
||||||
@ -43,11 +46,11 @@ def facesVolumesToriques(tore, plan, facesDefaut):
|
|||||||
|
|
||||||
#[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
#[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
||||||
|
|
||||||
geompy.addToStudyInFather( tore, facetore1, 'facetore1' )
|
geomPublishInFather(initLog.debug, tore, facetore1, 'facetore1' )
|
||||||
geompy.addToStudyInFather( tore, facetore2, 'facetore2' )
|
geomPublishInFather(initLog.debug, tore, facetore2, 'facetore2' )
|
||||||
|
|
||||||
[volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True)
|
[volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True)
|
||||||
geompy.addToStudyInFather( tore, volumeTore1, 'volumeTore1' )
|
geomPublishInFather(initLog.debug, tore, volumeTore1, 'volumeTore1' )
|
||||||
geompy.addToStudyInFather( tore, volumeTore2, 'volumeTore2' )
|
geomPublishInFather(initLog.debug, tore, volumeTore2, 'volumeTore2' )
|
||||||
|
|
||||||
return facetore1, facetore2, volumeTore1, volumeTore2
|
return facetore1, facetore2, volumeTore1, volumeTore2
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- trouver les vertices extremites d'un wire
|
# --- trouver les vertices extremites d'un wire
|
||||||
@ -44,11 +47,11 @@ def findWireEndVertices(aWire, getNormals=False):
|
|||||||
else:
|
else:
|
||||||
idsubs[subid] = [sub]
|
idsubs[subid] = [sub]
|
||||||
name='vertex%d'%i
|
name='vertex%d'%i
|
||||||
geompy.addToStudyInFather(aWire, sub, name)
|
geomPublishInFather(initLog.debug, aWire, sub, name)
|
||||||
if getNormals:
|
if getNormals:
|
||||||
idnorm[subid] = normals[i]
|
idnorm[subid] = normals[i]
|
||||||
name='norm%d'%i
|
name='norm%d'%i
|
||||||
geompy.addToStudyInFather(aWire, normals[i], name)
|
geomPublishInFather(initLog.debug, aWire, normals[i], name)
|
||||||
logging.debug("idsubs: %s", idsubs)
|
logging.debug("idsubs: %s", idsubs)
|
||||||
for k, v in idsubs.iteritems():
|
for k, v in idsubs.iteritems():
|
||||||
if len(v) == 1:
|
if len(v) == 1:
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- trouver les vertices intermediaires d'un wire
|
# --- trouver les vertices intermediaires d'un wire
|
||||||
@ -41,11 +44,11 @@ def findWireIntermediateVertices(aWire, getNormals=False):
|
|||||||
else:
|
else:
|
||||||
idsubs[subid] = [sub]
|
idsubs[subid] = [sub]
|
||||||
name='vertex%d'%i
|
name='vertex%d'%i
|
||||||
geompy.addToStudyInFather(aWire, sub, name)
|
geomPublishInFather(initLog.debug, aWire, sub, name)
|
||||||
if getNormals:
|
if getNormals:
|
||||||
idnorm[subid] = normals[i]
|
idnorm[subid] = normals[i]
|
||||||
name='norm%d'%i
|
name='norm%d'%i
|
||||||
geompy.addToStudyInFather(aWire, normals[i], name)
|
geomPublishInFather(initLog.debug, aWire, normals[i], name)
|
||||||
for k, v in idsubs.iteritems():
|
for k, v in idsubs.iteritems():
|
||||||
if len(v) > 1:
|
if len(v) > 1:
|
||||||
shortList.append(v[0])
|
shortList.append(v[0])
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from geomsmesh import geompy, smesh
|
from geomsmesh import geompy, smesh
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
import math
|
import math
|
||||||
import GEOM
|
import GEOM
|
||||||
@ -69,10 +72,10 @@ class fissureCoude(fissureGenerique):
|
|||||||
Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
|
Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
|
||||||
tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
|
tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
|
||||||
plan_y = geompy.MakePlaneLCS(None, 100000, 3)
|
plan_y = geompy.MakePlaneLCS(None, 100000, 3)
|
||||||
geompy.addToStudy( plan_y, "plan_y" )
|
geomPublish(initLog.debug, plan_y, "plan_y" )
|
||||||
geompy.addToStudy( tube_1, "tube_1" )
|
geomPublish(initLog.debug, tube_1, "tube_1" )
|
||||||
geompy.addToStudy( coude, "coude" )
|
geomPublish(initLog.debug, coude, "coude" )
|
||||||
geompy.addToStudy( tube_2, "tube_2" )
|
geomPublish(initLog.debug, tube_2, "tube_2" )
|
||||||
|
|
||||||
P1 = O
|
P1 = O
|
||||||
geompy.addToStudy(P1, "P1" )
|
geompy.addToStudy(P1, "P1" )
|
||||||
@ -84,7 +87,7 @@ class fissureCoude(fissureGenerique):
|
|||||||
# --- tube coude sain
|
# --- tube coude sain
|
||||||
|
|
||||||
geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
|
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)
|
[P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
|
||||||
|
|
||||||
xmin = -de -r_cintr -l_tube_p2
|
xmin = -de -r_cintr -l_tube_p2
|
||||||
@ -123,19 +126,19 @@ class fissureCoude(fissureGenerique):
|
|||||||
grped = geompy.CutGroups(grpedy0, long_p1)
|
grped = geompy.CutGroups(grpedy0, long_p1)
|
||||||
grped = geompy.CutGroups(grped, long_p2)
|
grped = geompy.CutGroups(grped, long_p2)
|
||||||
ep = geompy.CutGroups(grped, long_coude)
|
ep = geompy.CutGroups(grped, long_coude)
|
||||||
geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
|
geomPublishInFather(initLog.debug, geometrieSaine, long_p1, 'long_p1' )
|
||||||
geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
|
geomPublishInFather(initLog.debug, geometrieSaine, ep, 'ep' )
|
||||||
geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
|
geomPublishInFather(initLog.debug, geometrieSaine, long_coude, 'long_coude' )
|
||||||
geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
|
geomPublishInFather(initLog.debug, geometrieSaine, circ_g, 'circ_g' )
|
||||||
geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
|
geomPublishInFather(initLog.debug, geometrieSaine, circ_d, 'circ_d' )
|
||||||
geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
|
geomPublishInFather(initLog.debug, geometrieSaine, long_p2, 'long_p2' )
|
||||||
|
|
||||||
# --- face extremite tube (EXTUBE)
|
# --- face extremite tube (EXTUBE)
|
||||||
|
|
||||||
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
|
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
|
||||||
EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
||||||
geompy.UnionIDs(EXTUBE, facesIds)
|
geompy.UnionIDs(EXTUBE, facesIds)
|
||||||
geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
|
geomPublishInFather(initLog.debug, geometrieSaine, EXTUBE, 'EXTUBE' )
|
||||||
|
|
||||||
# --- edge bord extremite tube (BORDTU)
|
# --- edge bord extremite tube (BORDTU)
|
||||||
|
|
||||||
@ -147,17 +150,17 @@ class fissureCoude(fissureGenerique):
|
|||||||
edgesIds.append(edge)
|
edgesIds.append(edge)
|
||||||
BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
|
BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionIDs(BORDTU, edgesIds)
|
geompy.UnionIDs(BORDTU, edgesIds)
|
||||||
geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
|
geomPublishInFather(initLog.debug, geometrieSaine, BORDTU, 'BORDTU' )
|
||||||
|
|
||||||
# --- face origine tube (CLGV)
|
# --- face origine tube (CLGV)
|
||||||
|
|
||||||
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
|
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
|
||||||
vec2 = geompy.MakeVector(P2, pp2)
|
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)
|
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
|
||||||
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
||||||
geompy.UnionIDs(CLGV, facesIds)
|
geompy.UnionIDs(CLGV, facesIds)
|
||||||
geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
|
geomPublishInFather(initLog.debug, geometrieSaine, CLGV, 'CLGV' )
|
||||||
|
|
||||||
# --- peau tube interieur (PEAUINT)
|
# --- peau tube interieur (PEAUINT)
|
||||||
|
|
||||||
@ -167,11 +170,11 @@ class fissureCoude(fissureGenerique):
|
|||||||
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
|
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
|
||||||
interne = geompy.MakeFuse(extru1, revol1)
|
interne = geompy.MakeFuse(extru1, revol1)
|
||||||
interne = geompy.MakeFuse(extru2, interne)
|
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)
|
facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
|
||||||
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
||||||
geompy.UnionIDs(PEAUINT, facesIds)
|
geompy.UnionIDs(PEAUINT, facesIds)
|
||||||
geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
|
geomPublishInFather(initLog.debug, geometrieSaine, PEAUINT, 'PEAUINT' )
|
||||||
|
|
||||||
# --- peau tube exterieur (PEAUEXT)
|
# --- peau tube exterieur (PEAUEXT)
|
||||||
|
|
||||||
@ -182,18 +185,18 @@ class fissureCoude(fissureGenerique):
|
|||||||
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
|
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
|
||||||
externe = geompy.MakeFuse(extru1, revol1)
|
externe = geompy.MakeFuse(extru1, revol1)
|
||||||
externe = geompy.MakeFuse(extru2, externe)
|
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)
|
facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
||||||
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
|
||||||
geompy.UnionIDs(PEAUEXT, facesIds)
|
geompy.UnionIDs(PEAUEXT, facesIds)
|
||||||
geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
|
geomPublishInFather(initLog.debug, geometrieSaine, PEAUEXT, 'PEAUEXT' )
|
||||||
|
|
||||||
# --- solide sain
|
# --- solide sain
|
||||||
|
|
||||||
volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
|
volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
|
||||||
COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
|
COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
|
||||||
geompy.UnionIDs(COUDE, volIds)
|
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]
|
geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
|
||||||
|
|
||||||
@ -340,7 +343,7 @@ class fissureCoude(fissureGenerique):
|
|||||||
|
|
||||||
azimut = -azimut # axe inverse / ASCOUF
|
azimut = -azimut # axe inverse / ASCOUF
|
||||||
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
|
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
|
||||||
geompy.addToStudy(axe,"axe")
|
geomPublish(initLog.debug, axe,"axe")
|
||||||
|
|
||||||
if not lgInfluence:
|
if not lgInfluence:
|
||||||
lgInfluence = profondeur
|
lgInfluence = profondeur
|
||||||
@ -377,8 +380,8 @@ class fissureCoude(fissureGenerique):
|
|||||||
pi = geompy.MakeVertex(rayint, 0, 0)
|
pi = geompy.MakeVertex(rayint, 0, 0)
|
||||||
pbl = geompy.MakeRotation(pb, OZ, angle)
|
pbl = geompy.MakeRotation(pb, OZ, angle)
|
||||||
pbr = geompy.MakeRotation(pb, OZ, -angle)
|
pbr = geompy.MakeRotation(pb, OZ, -angle)
|
||||||
geompy.addToStudy(pbl,"pbl")
|
geomPublish(initLog.debug, pbl,"pbl")
|
||||||
geompy.addToStudy(pbr,"pbr")
|
geomPublish(initLog.debug, pbr,"pbr")
|
||||||
pal = geompy.MakeTranslationVector(pbl, OZ)
|
pal = geompy.MakeTranslationVector(pbl, OZ)
|
||||||
par = geompy.MakeTranslationVector(pbr, OZ)
|
par = geompy.MakeTranslationVector(pbr, OZ)
|
||||||
axl = geompy.MakeVector(pbl,pal)
|
axl = geompy.MakeVector(pbl,pal)
|
||||||
@ -409,7 +412,7 @@ class fissureCoude(fissureGenerique):
|
|||||||
wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
|
wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
|
||||||
#wiretube = geompy.MakeInterpol(points)
|
#wiretube = geompy.MakeInterpol(points)
|
||||||
wiretube=geompy.MakeWire([wire0,wire1,wire2])
|
wiretube=geompy.MakeWire([wire0,wire1,wire2])
|
||||||
geompy.addToStudy(wiretube,"wiretube")
|
geomPublish(initLog.debug, wiretube,"wiretube")
|
||||||
|
|
||||||
pe = geompy.MakeVertex(rayext, 0, 0)
|
pe = geompy.MakeVertex(rayext, 0, 0)
|
||||||
pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
|
pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
|
||||||
@ -417,22 +420,22 @@ class fissureCoude(fissureGenerique):
|
|||||||
pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
|
pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
|
||||||
|
|
||||||
arce = geompy.MakeArc(points[0], pe, points[-1])
|
arce = geompy.MakeArc(points[0], pe, points[-1])
|
||||||
geompy.addToStudy(arce,"arce")
|
geomPublish(initLog.debug, arce,"arce")
|
||||||
|
|
||||||
facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
|
facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
|
||||||
geompy.addToStudy( facefiss, 'facefissPlace' )
|
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
|
||||||
|
|
||||||
pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
|
pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
|
||||||
centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
|
centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
|
||||||
centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
|
centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
|
||||||
centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
|
centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
|
||||||
geompy.addToStudy( centre, 'centrefissPlace' )
|
geomPublish(initLog.debug, centre, 'centrefissPlace' )
|
||||||
|
|
||||||
wiretube = geompy.GetInPlace(facefiss, wiretube)
|
wiretube = geompy.GetInPlace(facefiss, wiretube)
|
||||||
geompy.addToStudy(wiretube, 'wiretubePlace' )
|
geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
|
||||||
try:
|
try:
|
||||||
edgetube = geompy.MakeEdgeWire(wiretube)
|
edgetube = geompy.MakeEdgeWire(wiretube)
|
||||||
geompy.addToStudy(edgetube,"edgetube")
|
geomPublish(initLog.debug, edgetube,"edgetube")
|
||||||
except:
|
except:
|
||||||
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
|
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
|
||||||
edgetube = None
|
edgetube = None
|
||||||
@ -485,10 +488,10 @@ class fissureCoude(fissureGenerique):
|
|||||||
points.append(pt)
|
points.append(pt)
|
||||||
curves.append(geompy.MakeInterpol(points))
|
curves.append(geompy.MakeInterpol(points))
|
||||||
point0 = points[0]
|
point0 = points[0]
|
||||||
geompy.addToStudy(curves[-1],"curve0")
|
geomPublish(initLog.debug, curves[-1],"curve0")
|
||||||
# for i, pt in enumerate(points):
|
# for i, pt in enumerate(points):
|
||||||
# name = "point%d"%i
|
# name = "point%d"%i
|
||||||
# geompy.addToStudyInFather(curves[-1], pt, name)
|
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
|
||||||
|
|
||||||
points = []
|
points = []
|
||||||
nbp = 3*nbp1
|
nbp = 3*nbp1
|
||||||
@ -506,10 +509,10 @@ class fissureCoude(fissureGenerique):
|
|||||||
pt = geompy.MakeRotation(pi, axe, angi)
|
pt = geompy.MakeRotation(pi, axe, angi)
|
||||||
points.append(pt)
|
points.append(pt)
|
||||||
curves.append(geompy.MakeInterpol(points))
|
curves.append(geompy.MakeInterpol(points))
|
||||||
geompy.addToStudy(curves[-1],"curve1")
|
geomPublish(initLog.debug, curves[-1],"curve1")
|
||||||
# for i, pt in enumerate(points):
|
# for i, pt in enumerate(points):
|
||||||
# name = "point%d"%i
|
# name = "point%d"%i
|
||||||
# geompy.addToStudyInFather(curves[-1], pt, name)
|
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
|
||||||
|
|
||||||
points = []
|
points = []
|
||||||
nbp = 3*nbp1
|
nbp = 3*nbp1
|
||||||
@ -529,16 +532,16 @@ class fissureCoude(fissureGenerique):
|
|||||||
points.append(pt)
|
points.append(pt)
|
||||||
curves.append(geompy.MakeInterpol(points))
|
curves.append(geompy.MakeInterpol(points))
|
||||||
point1 = points[-1]
|
point1 = points[-1]
|
||||||
geompy.addToStudy(curves[-1],"curve2")
|
geomPublish(initLog.debug, curves[-1],"curve2")
|
||||||
# for i, pt in enumerate(points):
|
# for i, pt in enumerate(points):
|
||||||
# name = "point%d"%i
|
# name = "point%d"%i
|
||||||
# geompy.addToStudyInFather(curves[-1], pt, name)
|
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
|
||||||
|
|
||||||
wiretube = geompy.MakeWire(curves)
|
wiretube = geompy.MakeWire(curves)
|
||||||
geompy.addToStudy(wiretube,"wiretube")
|
geomPublish(initLog.debug, wiretube,"wiretube")
|
||||||
try:
|
try:
|
||||||
edgetube = geompy.MakeEdgeWire(wiretube)
|
edgetube = geompy.MakeEdgeWire(wiretube)
|
||||||
geompy.addToStudy(edgetube,"edgetube")
|
geomPublish(initLog.debug, edgetube,"edgetube")
|
||||||
except:
|
except:
|
||||||
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
|
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
|
||||||
edgetube = None
|
edgetube = None
|
||||||
@ -553,21 +556,21 @@ class fissureCoude(fissureGenerique):
|
|||||||
pts.append(pt)
|
pts.append(pt)
|
||||||
pts.append(point1)
|
pts.append(point1)
|
||||||
arce = geompy.MakeInterpol(pts)
|
arce = geompy.MakeInterpol(pts)
|
||||||
geompy.addToStudy(arce,"arce")
|
geomPublish(initLog.debug, arce,"arce")
|
||||||
|
|
||||||
facefiss = geompy.MakeFaceWires([arce, wiretube], 0)
|
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.)
|
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
|
||||||
centre = geompy.MakeRotation(pc, axe, alfrd)
|
centre = geompy.MakeRotation(pc, axe, alfrd)
|
||||||
geompy.addToStudy( centre, 'centrefissPlace' )
|
geomPublish(initLog.debug, centre, 'centrefissPlace' )
|
||||||
|
|
||||||
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
|
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
|
||||||
edgesTriees, minl, maxl = sortEdges(edges)
|
edgesTriees, minl, maxl = sortEdges(edges)
|
||||||
edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine
|
edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine
|
||||||
wiretube = geompy.MakeWire(edges)
|
wiretube = geompy.MakeWire(edges)
|
||||||
#wiretube = edgesTriees[-1]
|
#wiretube = edgesTriees[-1]
|
||||||
geompy.addToStudy(wiretube, 'wiretubePlace' )
|
geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
@ -612,7 +615,7 @@ class fissureCoude(fissureGenerique):
|
|||||||
arci = geompy.MakePosition(arco, originLCS, localLCS, "arci")
|
arci = geompy.MakePosition(arco, originLCS, localLCS, "arci")
|
||||||
arce = geompy.MakePosition(lino, originLCS, localLCS, "arce")
|
arce = geompy.MakePosition(lino, originLCS, localLCS, "arce")
|
||||||
facefiss = geompy.MakeFaceWires([arce, arci], 0)
|
facefiss = geompy.MakeFaceWires([arce, arci], 0)
|
||||||
geompy.addToStudy( facefiss, 'facefissPlace' )
|
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
|
||||||
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
|
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
|
||||||
edgesTriees, minl, maxl = sortEdges(edges)
|
edgesTriees, minl, maxl = sortEdges(edges)
|
||||||
edgetube = edgesTriees[-1] # la plus grande correspond à arci
|
edgetube = edgesTriees[-1] # la plus grande correspond à arci
|
||||||
@ -620,7 +623,7 @@ class fissureCoude(fissureGenerique):
|
|||||||
|
|
||||||
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
|
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
|
||||||
centre = geompy.MakeRotation(pc, axe, alfrd)
|
centre = geompy.MakeRotation(pc, axe, alfrd)
|
||||||
geompy.addToStudy( centre, 'centrefissPlace' )
|
geomPublish(initLog.debug, centre, 'centrefissPlace' )
|
||||||
|
|
||||||
coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur)
|
coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur)
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@ Created on Tue Jun 24 09:14:13 2014
|
|||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
from geomsmesh import smesh
|
from geomsmesh import smesh
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
import SMESH
|
import SMESH
|
||||||
|
|
||||||
@ -49,14 +52,14 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible
|
|||||||
# on recrée un objet GEOM temporaire par filling.
|
# 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)
|
filling = geompy.MakeFilling(geompy.MakeCompound(setOfLines), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
|
||||||
#logging.debug("face de filling")
|
#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)
|
tmpPartition = geompy.MakePartition([filling], [shapeDefaut], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
|
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
|
||||||
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
|
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
|
||||||
if len(tmpExplodeRef) == len(tmpExplodeNum):
|
if len(tmpExplodeRef) == len(tmpExplodeNum):
|
||||||
logging.debug("face de filling non coupee")
|
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)
|
facesNonCoupees.append(filling)
|
||||||
maillagesNonCoupes.append(listOfNewMeshes[i])
|
maillagesNonCoupes.append(listOfNewMeshes[i])
|
||||||
else:
|
else:
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
from toreFissure import toreFissure
|
from toreFissure import toreFissure
|
||||||
from ellipsoideDefaut import ellipsoideDefaut
|
from ellipsoideDefaut import ellipsoideDefaut
|
||||||
@ -40,12 +43,12 @@ def genereElemsFissureElliptique(shapeFissureParams):
|
|||||||
plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut)
|
plane1 = rotTrans(Plane_1, orientation, centreDefaut, vecteurDefaut)
|
||||||
ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut)
|
ellipsoide1 = rotTrans(ellipsoide, orientation, centreDefaut, vecteurDefaut)
|
||||||
|
|
||||||
geompy.addToStudy( pipe0, 'pipe0' )
|
geomPublish(initLog.debug, pipe0, 'pipe0' )
|
||||||
geompy.addToStudy( gener1, 'gener1' )
|
geomPublish(initLog.debug, gener1, 'gener1' )
|
||||||
geompy.addToStudy( pipe1, 'pipe1' )
|
geomPublish(initLog.debug, pipe1, 'pipe1' )
|
||||||
geompy.addToStudy( facefis1, 'facefis1' )
|
geomPublish(initLog.debug, facefis1, 'facefis1' )
|
||||||
geompy.addToStudy( plane1, 'plane1' )
|
geomPublish(initLog.debug, plane1, 'plane1' )
|
||||||
geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
|
geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
|
||||||
|
|
||||||
shapeDefaut = facefis1
|
shapeDefaut = facefis1
|
||||||
xyz_defaut = geompy.PointCoordinates(centreDefaut)
|
xyz_defaut = geompy.PointCoordinates(centreDefaut)
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import bisect
|
import bisect
|
||||||
|
|
||||||
publie = False
|
publie = False
|
||||||
@ -35,7 +38,7 @@ def getCentreFondFiss(shapesFissure):
|
|||||||
edgeFondExt = fondFiss
|
edgeFondExt = fondFiss
|
||||||
aWire = geompy.MakeWire([fondFiss], 1e-07)
|
aWire = geompy.MakeWire([fondFiss], 1e-07)
|
||||||
if not publie:
|
if not publie:
|
||||||
geompy.addToStudy(aWire, "wireFondFissExt")
|
geomPublish(initLog.debug, aWire, "wireFondFissExt")
|
||||||
|
|
||||||
lgWire = geompy.BasicProperties(aWire)[0]
|
lgWire = geompy.BasicProperties(aWire)[0]
|
||||||
edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True)
|
edges = geompy.ExtractShapes(aWire, geompy.ShapeType["EDGE"], True)
|
||||||
@ -61,7 +64,7 @@ def getCentreFondFiss(shapesFissure):
|
|||||||
centreFondFiss = geompy.MakeVertexOnCurve(edges[iedr], 1.0 - lgOnEdge/lgEdges[iedr])
|
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
|
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])
|
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])
|
tgtCentre = geompy.MakeTangentOnCurve(edges[iedr], lgOnEdge/ lgEdges[iedr])
|
||||||
|
|
||||||
if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge
|
if edgeFondExt is None: # fond de fissure non fourni explicitement sous forme d'edge
|
||||||
@ -71,7 +74,7 @@ def getCentreFondFiss(shapesFissure):
|
|||||||
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
|
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
|
||||||
edgeFondExt = None
|
edgeFondExt = None
|
||||||
if not publie and edgeFondExt is not None:
|
if not publie and edgeFondExt is not None:
|
||||||
geompy.addToStudy(edgeFondExt, "edgeFondExt")
|
geomPublish(initLog.debug, edgeFondExt, "edgeFondExt")
|
||||||
|
|
||||||
publie = True
|
publie = True
|
||||||
return edgeFondExt, centreFondFiss, tgtCentre
|
return edgeFondExt, centreFondFiss, tgtCentre
|
||||||
|
@ -4,6 +4,9 @@ import logging
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
from produitMixte import produitMixte
|
from produitMixte import produitMixte
|
||||||
from whichSide import whichSide
|
from whichSide import whichSide
|
||||||
@ -29,7 +32,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
#logging.debug("edgesFondIn %s", edgesFondIn)
|
#logging.debug("edgesFondIn %s", edgesFondIn)
|
||||||
for iedf, edge in enumerate(edgesFondIn):
|
for iedf, edge in enumerate(edgesFondIn):
|
||||||
name = "edgeFondIn%d"%iedf
|
name = "edgeFondIn%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
|
||||||
dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
|
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
|
ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
|
||||||
[u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
|
[u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
|
||||||
@ -37,14 +40,14 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
|
localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
|
||||||
centre = PointOnEdge
|
centre = PointOnEdge
|
||||||
centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
|
centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, centre2, "centre2_%d"%iedf)
|
||||||
verticesEdgesFondIn.append(centre)
|
verticesEdgesFondIn.append(centre)
|
||||||
name = "verticeEdgesFondIn%d"%iedf
|
name = "verticeEdgesFondIn%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, centre, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, centre, name)
|
||||||
norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
|
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)
|
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)
|
[vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
|
||||||
vec1 = geompy.MakeVector(centre, vertex)
|
vec1 = geompy.MakeVector(centre, vertex)
|
||||||
vec2 = geompy.MakeVector(centre, ptPeau)
|
vec2 = geompy.MakeVector(centre, ptPeau)
|
||||||
@ -66,7 +69,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
else:
|
else:
|
||||||
cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
|
cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
|
||||||
name = "cercle%d"%iedf
|
name = "cercle%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, cercle, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name)
|
||||||
cercles.append(cercle)
|
cercles.append(cercle)
|
||||||
|
|
||||||
# --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
|
# --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
|
||||||
@ -95,8 +98,8 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
logging.debug("distance curviligne centre extremite0: %s", ofp)
|
logging.debug("distance curviligne centre extremite0: %s", ofp)
|
||||||
p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
|
p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
|
||||||
p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
|
p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
|
||||||
geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf)
|
geomPublishInFather(initLog.debug, wireFondFiss, p1, "p1_%d"%iedf)
|
||||||
geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf)
|
geomPublishInFather(initLog.debug, wireFondFiss, p2, "p2_%d"%iedf)
|
||||||
|
|
||||||
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
|
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
|
||||||
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
|
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
|
||||||
@ -104,7 +107,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
if geompy.MinDistance(centre, edp) < 1.e-3:
|
if geompy.MinDistance(centre, edp) < 1.e-3:
|
||||||
pipext = geompy.MakePipe(cercle, edp)
|
pipext = geompy.MakePipe(cercle, edp)
|
||||||
name = "pipeExt%d"%iedf
|
name = "pipeExt%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, pipext, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, pipext, name)
|
||||||
pipexts.append(pipext)
|
pipexts.append(pipext)
|
||||||
|
|
||||||
for ifa, face in enumerate(facesInside):
|
for ifa, face in enumerate(facesInside):
|
||||||
@ -129,7 +132,7 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
logging.debug(" face %s inside ajoutée", ifa)
|
logging.debug(" face %s inside ajoutée", ifa)
|
||||||
facesFissExt.append(face)
|
facesFissExt.append(face)
|
||||||
name="faceFissExt%d"%iedf
|
name="faceFissExt%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, face, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, face, name)
|
||||||
dist = 1.
|
dist = 1.
|
||||||
for ipe, edpe in enumerate(edgesPeauFis):
|
for ipe, edpe in enumerate(edgesPeauFis):
|
||||||
for ipi, edpi in enumerate(edgesPipeFis):
|
for ipi, edpi in enumerate(edgesPipeFis):
|
||||||
@ -137,10 +140,10 @@ def identifieElementsDebouchants(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
if dist < 1.e-3:
|
if dist < 1.e-3:
|
||||||
edgesFissExtPeau.append(edpe)
|
edgesFissExtPeau.append(edpe)
|
||||||
name="edgesFissExtPeau%d"%iedf
|
name="edgesFissExtPeau%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edpe, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, edpe, name)
|
||||||
edgesFissExtPipe.append(edpi)
|
edgesFissExtPipe.append(edpi)
|
||||||
name="edgesFissExtPipe%d"%iedf
|
name="edgesFissExtPipe%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edpi, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, edpi, name)
|
||||||
break
|
break
|
||||||
if dist < 1.e-3:
|
if dist < 1.e-3:
|
||||||
break
|
break
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
from extractionOrientee import extractionOrientee
|
from extractionOrientee import extractionOrientee
|
||||||
from extractionOrienteeMulti import extractionOrienteeMulti
|
from extractionOrienteeMulti import extractionOrienteeMulti
|
||||||
|
|
||||||
@ -19,9 +23,9 @@ def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
logging.info('start')
|
logging.info('start')
|
||||||
|
|
||||||
edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss))
|
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))
|
edgesFondC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesFondFiss))
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edgesFondC, "edgesFondFiss")
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, edgesFondC, "edgesFondFiss")
|
||||||
|
|
||||||
if aretesVivesC is None:
|
if aretesVivesC is None:
|
||||||
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
|
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
|
||||||
@ -38,9 +42,9 @@ def identifieElementsFissure(ifil, facesDefaut, partitionPeauFissFond,
|
|||||||
vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
|
vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
|
||||||
verticesPipePeau.append(vertices[0])
|
verticesPipePeau.append(vertices[0])
|
||||||
name = "edgePipeIn%d"%i
|
name = "edgePipeIn%d"%i
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
|
geomPublishInFather(initLog.debug, partitionPeauFissFond, edge, name)
|
||||||
name = "verticePipePeau%d"%i
|
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)
|
logging.debug("edgePipeIn%s coupe les faces OnSide", i)
|
||||||
except:
|
except:
|
||||||
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
|
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss):
|
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss):
|
||||||
"""
|
"""
|
||||||
@ -42,8 +45,8 @@ def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesP
|
|||||||
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
|
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
|
||||||
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
|
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
|
||||||
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
|
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
|
||||||
geompy.addToStudy(faceFissureExterne, "faceFissureExterne")
|
geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
|
||||||
geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
|
geomPublishInFather(initLog.debug, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
|
||||||
geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
|
geomPublishInFather(initLog.debug, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
|
||||||
|
|
||||||
return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC)
|
return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC)
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
from sortFaces import sortFaces
|
from sortFaces import sortFaces
|
||||||
from extractionOrientee import extractionOrientee
|
from extractionOrientee import extractionOrientee
|
||||||
@ -62,7 +65,7 @@ def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
name="partitionPeauByPipe%d"%ifil
|
name="partitionPeauByPipe%d"%ifil
|
||||||
geompy.addToStudy(partitionPeauByPipe, name)
|
geomPublish(initLog.debug, partitionPeauByPipe, name)
|
||||||
[edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
|
[edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
|
||||||
[facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
|
[facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
|
||||||
|
|
||||||
@ -73,6 +76,6 @@ def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
|
|||||||
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
||||||
facesPeauSorted = [facePeau]
|
facesPeauSorted = [facePeau]
|
||||||
name="facePeau%d"%ifil
|
name="facePeau%d"%ifil
|
||||||
geompy.addToStudy(facePeau, name)
|
geomPublish(initLog.debug, facePeau, name)
|
||||||
|
|
||||||
return (facePeau, facesPeauSorted, edgesPeauFondIn)
|
return (facePeau, facesPeauSorted, edgesPeauFondIn)
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import salome
|
import salome
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from geomsmesh import smesh
|
from geomsmesh import smesh
|
||||||
import SMESH
|
import SMESH
|
||||||
import math
|
import math
|
||||||
@ -98,12 +101,12 @@ def insereFissureElliptique(geometriesSaines, maillagesSains,
|
|||||||
#plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
|
#plane1 = self.rotTrans(Plane_1, orientation, centreDefaut, normalDefaut)
|
||||||
#ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
|
#ellipsoide1 = self.rotTrans(ellipsoide, orientation, centreDefaut, normalDefaut)
|
||||||
|
|
||||||
#geompy.addToStudy( pipe0, 'pipe0' )
|
#geomPublish(initLog.debug, pipe0, 'pipe0' )
|
||||||
#geompy.addToStudy( gener1, 'gener1' )
|
#geomPublish(initLog.debug, gener1, 'gener1' )
|
||||||
#geompy.addToStudy( pipe1, 'pipe1' )
|
#geomPublish(initLog.debug, pipe1, 'pipe1' )
|
||||||
#geompy.addToStudy( facefis1, 'facefis1' )
|
#geomPublish(initLog.debug, facefis1, 'facefis1' )
|
||||||
#geompy.addToStudy( plane1, 'plane1' )
|
#geomPublish(initLog.debug, plane1, 'plane1' )
|
||||||
#geompy.addToStudy( ellipsoide1, 'ellipsoide1' )
|
#geomPublish(initLog.debug, ellipsoide1, 'ellipsoide1' )
|
||||||
|
|
||||||
# --- partition du bloc défaut par génératrice, tore et plan fissure
|
# --- partition du bloc défaut par génératrice, tore et plan fissure
|
||||||
if step == 7:
|
if step == 7:
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import salome
|
import salome
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
from geomsmesh import smesh
|
from geomsmesh import smesh
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
@ -105,7 +108,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# partition face fissure étendue par fillings, on garde la plus grande face
|
# partition face fissure étendue par fillings, on garde la plus grande face
|
||||||
|
|
||||||
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
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)
|
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
|
||||||
if isPointInterne:
|
if isPointInterne:
|
||||||
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
|
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
|
||||||
@ -117,7 +120,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
|
logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
|
||||||
facesPortFissure = facesPartShapeDefautSorted[-1] #= global
|
facesPortFissure = facesPartShapeDefautSorted[-1] #= global
|
||||||
|
|
||||||
geompy.addToStudy(facesPortFissure, "facesPortFissure")
|
geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
|
||||||
|
|
||||||
O, OX, OY, OZ = triedreBase()
|
O, OX, OY, OZ = triedreBase()
|
||||||
|
|
||||||
@ -129,42 +132,42 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
|
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
|
||||||
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #= local
|
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0) #= local
|
||||||
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
|
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
|
||||||
geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe')
|
geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
|
||||||
#geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
|
#geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
|
||||||
|
|
||||||
extrem, norms = findWireEndVertices(fondFiss, True)
|
extrem, norms = findWireEndVertices(fondFiss, True)
|
||||||
logging.debug("extrem: %s, norm: %s",extrem, norms)
|
logging.debug("extrem: %s, norm: %s",extrem, norms)
|
||||||
cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
|
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
|
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)
|
fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
|
||||||
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
|
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
|
||||||
geompy.addToStudy(pipeFiss, 'pipeFiss')
|
geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
|
||||||
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
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
|
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut) #= global
|
||||||
geompy.addToStudy(fissPipe, 'fissPipe')
|
geomPublish(initLog.debug, fissPipe, 'fissPipe')
|
||||||
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) #= local
|
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss) #= local
|
||||||
geompy.addToStudy(partPipe, 'partPipe')
|
geomPublish(initLog.debug, partPipe, 'partPipe')
|
||||||
|
|
||||||
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) #= global
|
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"]) #= global
|
||||||
for i, edge in enumerate(edgesPipeFiss):
|
for i, edge in enumerate(edgesPipeFiss):
|
||||||
name = "edgePipe%d"%i
|
name = "edgePipe%d"%i
|
||||||
geompy.addToStudyInFather(fissPipe, edge, name)
|
geomPublishInFather(initLog.debug,fissPipe, edge, name)
|
||||||
try:
|
try:
|
||||||
wirePipeFiss = geompy.MakeWire(edgesPipeFiss) #= global
|
wirePipeFiss = geompy.MakeWire(edgesPipeFiss) #= global
|
||||||
except:
|
except:
|
||||||
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
|
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
|
||||||
logging.debug("wirePipeFiss construit sous forme de compound")
|
logging.debug("wirePipeFiss construit sous forme de compound")
|
||||||
geompy.addToStudy(wirePipeFiss, "wirePipeFiss")
|
geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
|
||||||
|
|
||||||
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
|
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
|
||||||
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
|
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
|
||||||
for i, edge in enumerate(edgesFondFiss):
|
for i, edge in enumerate(edgesFondFiss):
|
||||||
name = "edgeFondFiss%d"%i
|
name = "edgeFondFiss%d"%i
|
||||||
geompy.addToStudyInFather(fissPipe, edge, name)
|
geomPublishInFather(initLog.debug,fissPipe, edge, name)
|
||||||
wireFondFiss = geompy.MakeWire(edgesFondFiss) #= global
|
wireFondFiss = geompy.MakeWire(edgesFondFiss) #= global
|
||||||
geompy.addToStudy(wireFondFiss,"wireFondFiss")
|
geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- peau et face de fissure
|
# --- peau et face de fissure
|
||||||
@ -187,7 +190,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
fissPipePart = fissPipe
|
fissPipePart = fissPipe
|
||||||
part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
partitionsPeauFissFond.append(part)
|
partitionsPeauFissFond.append(part)
|
||||||
geompy.addToStudy( part, 'partitionPeauFissFond%d'%ipart )
|
geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
|
||||||
else:
|
else:
|
||||||
partitionsPeauFissFond.append(None)
|
partitionsPeauFissFond.append(None)
|
||||||
ipart = ipart +1
|
ipart = ipart +1
|
||||||
@ -203,13 +206,13 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if not isinstance(a, list):
|
if not isinstance(a, list):
|
||||||
aretesVives.append(a)
|
aretesVives.append(a)
|
||||||
name = "areteVive%d"%ia
|
name = "areteVive%d"%ia
|
||||||
geompy.addToStudy(a, name)
|
geomPublish(initLog.debug, a, name)
|
||||||
ia += 1
|
ia += 1
|
||||||
else:
|
else:
|
||||||
if a[0] is not None:
|
if a[0] is not None:
|
||||||
aretesVives.append(a[0])
|
aretesVives.append(a[0])
|
||||||
name = "areteVive%d"%ia
|
name = "areteVive%d"%ia
|
||||||
geompy.addToStudy(a[0], name)
|
geomPublish(initLog.debug, a[0], name)
|
||||||
ia += 1
|
ia += 1
|
||||||
|
|
||||||
aretesVivesC = None #= global
|
aretesVivesC = None #= global
|
||||||
@ -246,9 +249,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# edges prolongées
|
# edges prolongées
|
||||||
|
|
||||||
edgesPipeC = geompy.GetInPlace(partitionPeauFissFond, geompy.MakeCompound(edgesPipeFiss)) #= local
|
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
|
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
|
if aretesVivesC is None: #= global facesInside facesOnside
|
||||||
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
|
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
|
||||||
@ -265,9 +268,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
|
vertices = geompy.GetSharedShapesMulti([edge, geompy.MakeCompound(facesOnside)], geompy.ShapeType["VERTEX"])
|
||||||
verticesPipePeau.append(vertices[0])
|
verticesPipePeau.append(vertices[0])
|
||||||
name = "edgePipeIn%d"%i
|
name = "edgePipeIn%d"%i
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name)
|
||||||
name = "verticePipePeau%d"%i
|
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)
|
logging.debug("edgePipeIn%s coupe les faces OnSide", i)
|
||||||
except:
|
except:
|
||||||
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
|
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
|
||||||
@ -289,11 +292,11 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
||||||
for i,edge in enumerate(edgesFondFiss):
|
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):
|
for iedf, edge in enumerate(edgesFondIn):
|
||||||
name = "edgeFondIn%d"%iedf
|
name = "edgeFondIn%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edge, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, edge, name)
|
||||||
dist = [ geompy.MinDistance(pt, edge) for pt in verticesPipePeau]
|
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
|
ptPeau = verticesPipePeau[dist.index(min(dist))] # le point de verticesPipePeau a distance minimale de l'edge
|
||||||
[u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
|
[u, PointOnEdge, EdgeInWireIndex] = geompy.MakeProjectionOnWire(ptPeau, wireFondFiss)
|
||||||
@ -301,14 +304,14 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
|
localEdgeInFondFiss = edgesFondFiss[EdgeInWireIndex]
|
||||||
centre = PointOnEdge
|
centre = PointOnEdge
|
||||||
centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
|
centre2 = geompy.MakeVertexOnCurve(localEdgeInFondFiss, u)
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, centre2, "centre2_%d"%iedf)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, centre2, "centre2_%d"%iedf)
|
||||||
verticesEdgesFondIn.append(centre)
|
verticesEdgesFondIn.append(centre)
|
||||||
name = "verticeEdgesFondIn%d"%iedf
|
name = "verticeEdgesFondIn%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, centre, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, centre, name)
|
||||||
norm = geompy.MakeTangentOnCurve(localEdgeInFondFiss, u)
|
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)
|
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)
|
[vertex] = geompy.ExtractShapes(cercle, geompy.ShapeType["VERTEX"], False)
|
||||||
vec1 = geompy.MakeVector(centre, vertex)
|
vec1 = geompy.MakeVector(centre, vertex)
|
||||||
vec2 = geompy.MakeVector(centre, ptPeau)
|
vec2 = geompy.MakeVector(centre, ptPeau)
|
||||||
@ -330,7 +333,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
else:
|
else:
|
||||||
cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
|
cercle = geompy.MakeRotation(cercle, norm, -angle + math.pi)
|
||||||
name = "cercle%d"%iedf
|
name = "cercle%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, cercle, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, cercle, name)
|
||||||
cercles.append(cercle)
|
cercles.append(cercle)
|
||||||
|
|
||||||
# --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
|
# --- estimation de la longueur du pipe necessaire de part et d'autre du point de sortie
|
||||||
@ -359,8 +362,8 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
logging.debug("distance curviligne centre extremite0: %s", ofp)
|
logging.debug("distance curviligne centre extremite0: %s", ofp)
|
||||||
p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
|
p1 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp +lgp, locPt0)
|
||||||
p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
|
p2 = geompy.MakeVertexOnCurveByLength(localEdgeInFondFiss, ofp -lgp, locPt0)
|
||||||
geompy.addToStudyInFather(wireFondFiss, p1, "p1_%d"%iedf)
|
geomPublishInFather(initLog.debug,wireFondFiss, p1, "p1_%d"%iedf)
|
||||||
geompy.addToStudyInFather(wireFondFiss, p2, "p2_%d"%iedf)
|
geomPublishInFather(initLog.debug,wireFondFiss, p2, "p2_%d"%iedf)
|
||||||
|
|
||||||
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
|
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
|
||||||
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
|
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
|
||||||
@ -368,7 +371,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if geompy.MinDistance(centre, edp) < 1.e-3:
|
if geompy.MinDistance(centre, edp) < 1.e-3:
|
||||||
pipext = geompy.MakePipe(cercle, edp)
|
pipext = geompy.MakePipe(cercle, edp)
|
||||||
name = "pipeExt%d"%iedf
|
name = "pipeExt%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, pipext, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, pipext, name)
|
||||||
pipexts.append(pipext)
|
pipexts.append(pipext)
|
||||||
|
|
||||||
for face in facesInside:
|
for face in facesInside:
|
||||||
@ -393,7 +396,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
logging.debug(" face %s inside ajoutée", i)
|
logging.debug(" face %s inside ajoutée", i)
|
||||||
facesFissExt.append(face)
|
facesFissExt.append(face)
|
||||||
name="faceFissExt%d"%iedf
|
name="faceFissExt%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, face, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, face, name)
|
||||||
dist = 1.
|
dist = 1.
|
||||||
for ipe, edpe in enumerate(edgesPeauFis):
|
for ipe, edpe in enumerate(edgesPeauFis):
|
||||||
for ipi, edpi in enumerate(edgesPipeFis):
|
for ipi, edpi in enumerate(edgesPipeFis):
|
||||||
@ -401,10 +404,10 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if dist < 1.e-3:
|
if dist < 1.e-3:
|
||||||
edgesFissExtPeau.append(edpe)
|
edgesFissExtPeau.append(edpe)
|
||||||
name="edgesFissExtPeau%d"%iedf
|
name="edgesFissExtPeau%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edpe, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, edpe, name)
|
||||||
edgesFissExtPipe.append(edpi)
|
edgesFissExtPipe.append(edpi)
|
||||||
name="edgesFissExtPipe%d"%iedf
|
name="edgesFissExtPipe%d"%iedf
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edpi, name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, edpi, name)
|
||||||
break
|
break
|
||||||
if dist < 1.e-3:
|
if dist < 1.e-3:
|
||||||
break
|
break
|
||||||
@ -425,7 +428,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
|
if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
|
||||||
edgesFissExtPeau.append(edgesPeauFis[0])
|
edgesFissExtPeau.append(edgesPeauFis[0])
|
||||||
name="edgesFissExtPeau%d"%j
|
name="edgesFissExtPeau%d"%j
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
|
||||||
j += 1
|
j += 1
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
@ -478,7 +481,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
name="partitionPeauByPipe%d"%ifil
|
name="partitionPeauByPipe%d"%ifil
|
||||||
geompy.addToStudy(partitionPeauByPipe, name)
|
geomPublish(initLog.debug, partitionPeauByPipe, name)
|
||||||
[edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
|
[edgesPeauFondIn, edgesPeauFondOut, edgesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
|
||||||
[facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
|
[facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
|
||||||
|
|
||||||
@ -488,7 +491,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
else:
|
else:
|
||||||
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
||||||
name="facePeau%d"%ifil
|
name="facePeau%d"%ifil
|
||||||
geompy.addToStudy(facePeau, name)
|
geomPublish(initLog.debug, facePeau, name)
|
||||||
|
|
||||||
facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
|
facesPipePeau = [None for i in range(len(edgesFissExtPipe))]
|
||||||
endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
|
endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
|
||||||
@ -514,13 +517,13 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
nameEdge = "edgeRadFacePipePeau%d"%i
|
nameEdge = "edgeRadFacePipePeau%d"%i
|
||||||
facesPipePeau[i] = face
|
facesPipePeau[i] = face
|
||||||
endsEdgeFond[i] = sharedVertices[0]
|
endsEdgeFond[i] = sharedVertices[0]
|
||||||
geompy.addToStudy(face, nameFace)
|
geomPublish(initLog.debug, face, nameFace)
|
||||||
geompy.addToStudy(sharedVertices[0], nameVert)
|
geomPublish(initLog.debug, sharedVertices[0], nameVert)
|
||||||
edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
|
edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
|
||||||
for edge in edgesFace:
|
for edge in edgesFace:
|
||||||
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
||||||
edgeRadFacePipePeau[i] = edge
|
edgeRadFacePipePeau[i] = edge
|
||||||
geompy.addToStudy(edge, nameEdge)
|
geomPublish(initLog.debug, edge, nameEdge)
|
||||||
break
|
break
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
@ -537,14 +540,14 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
geompy.UnionList(grpEdgesCirc, edges)
|
geompy.UnionList(grpEdgesCirc, edges)
|
||||||
edgesCircPeau[i] = grpEdgesCirc
|
edgesCircPeau[i] = grpEdgesCirc
|
||||||
name = "edgeCirc%d"%i
|
name = "edgeCirc%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, grpEdgesCirc, name)
|
geomPublishInFather(initLog.debug,facePeau, grpEdgesCirc, name)
|
||||||
edgesListees = edgesListees + edges
|
edgesListees = edgesListees + edges
|
||||||
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
||||||
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
||||||
geompy.UnionList(grpVertCircPeau, vertices)
|
geompy.UnionList(grpVertCircPeau, vertices)
|
||||||
verticesCircPeau[i] = grpVertCircPeau
|
verticesCircPeau[i] = grpVertCircPeau
|
||||||
name = "pointEdgeCirc%d"%i
|
name = "pointEdgeCirc%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, grpVertCircPeau, name)
|
geomPublishInFather(initLog.debug,facePeau, grpVertCircPeau, name)
|
||||||
pass
|
pass
|
||||||
pass # --- au moins une extrémité du pipe sur cette face de peau
|
pass # --- au moins une extrémité du pipe sur cette face de peau
|
||||||
|
|
||||||
@ -555,7 +558,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
for i, edge in enumerate(edgesFilling):
|
for i, edge in enumerate(edgesFilling):
|
||||||
edgepeau = geompy.GetInPlace(facePeau, edge)
|
edgepeau = geompy.GetInPlace(facePeau, edge)
|
||||||
name = "edgepeau%d"%i
|
name = "edgepeau%d"%i
|
||||||
geompy.addToStudyInFather(facePeau,edgepeau, name)
|
geomPublishInFather(initLog.debug,facePeau,edgepeau, name)
|
||||||
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
|
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
|
||||||
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
||||||
logging.debug(" EDGES multiples")
|
logging.debug(" EDGES multiples")
|
||||||
@ -572,7 +575,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if aretesVivesC is not None:
|
if aretesVivesC is not None:
|
||||||
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
|
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
|
||||||
if bordsVifs is not None:
|
if bordsVifs is not None:
|
||||||
geompy.addToStudyInFather(facePeau, bordsVifs, "bordsVifs")
|
geomPublishInFather(initLog.debug,facePeau, bordsVifs, "bordsVifs")
|
||||||
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
|
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
|
||||||
grptmp = None
|
grptmp = None
|
||||||
if len(aretesVivesCoupees) > 0:
|
if len(aretesVivesCoupees) > 0:
|
||||||
@ -586,7 +589,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
|
edv = geompy.ExtractShapes(grpnew, geompy.ShapeType["EDGE"], False)
|
||||||
aretesVivesCoupees += edv
|
aretesVivesCoupees += edv
|
||||||
logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
|
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
|
# --- edges de la face de peau partagées avec la face de fissure
|
||||||
|
|
||||||
@ -600,7 +603,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
|
if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau):
|
||||||
edgesFissurePeau[i] = edge
|
edgesFissurePeau[i] = edge
|
||||||
name = "edgeFissurePeau%d"%i
|
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
|
for edge in edges: # on ajoute après les edges manquantes
|
||||||
if edge not in edgesFissurePeau:
|
if edge not in edgesFissurePeau:
|
||||||
edgesFissurePeau.append(edge)
|
edgesFissurePeau.append(edge)
|
||||||
@ -608,7 +611,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
for i, edge in enumerate(edges):
|
for i, edge in enumerate(edges):
|
||||||
edgesFissurePeau.append(edge)
|
edgesFissurePeau.append(edge)
|
||||||
name = "edgeFissurePeau%d"%i
|
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]
|
ptEdgeFond[ifil] = endsEdgeFond # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
||||||
@ -631,7 +634,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
for i, avc in enumerate(aretesVivesCoupees):
|
for i, avc in enumerate(aretesVivesCoupees):
|
||||||
name = "areteViveCoupee%d"%i
|
name = "areteViveCoupee%d"%i
|
||||||
geompy.addToStudy(avc, name)
|
geomPublish(initLog.debug, avc, name)
|
||||||
|
|
||||||
# --- identification des faces et edges de fissure externe pour maillage
|
# --- identification des faces et edges de fissure externe pour maillage
|
||||||
|
|
||||||
@ -667,9 +670,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
|
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
|
||||||
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
|
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
|
||||||
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
|
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
|
||||||
geompy.addToStudy(faceFissureExterne, "faceFissureExterne")
|
geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
|
||||||
geompy.addToStudyInFather(faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
|
geomPublishInFather(initLog.debug,faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
|
||||||
geompy.addToStudyInFather(faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
|
geomPublishInFather(initLog.debug,faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
|
||||||
|
|
||||||
logging.debug("---------------------------- Preparation Maillage du Pipe --------------")
|
logging.debug("---------------------------- Preparation Maillage du Pipe --------------")
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
@ -734,11 +737,11 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
origins.append(vertpx)
|
origins.append(vertpx)
|
||||||
normals.append(norm)
|
normals.append(norm)
|
||||||
# name = "vertcx%d"%i
|
# name = "vertcx%d"%i
|
||||||
# geompy.addToStudyInFather(wireFondFiss, vertcx, name)
|
# geomPublishInFather(initLog.debug,wireFondFiss, vertcx, name)
|
||||||
# name = "vertpx%d"%i
|
# name = "vertpx%d"%i
|
||||||
# geompy.addToStudyInFather(wireFondFiss, vertpx, name)
|
# geomPublishInFather(initLog.debug,wireFondFiss, vertpx, name)
|
||||||
# name = "plan%d"%i
|
# 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
|
# --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau
|
||||||
|
|
||||||
@ -854,18 +857,18 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
|
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
|
||||||
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
||||||
name='compoundRay%d'%k
|
name='compoundRay%d'%k
|
||||||
geompy.addToStudy(comp, name)
|
geomPublish(initLog.debug, comp, name)
|
||||||
else:
|
else:
|
||||||
idfin = min(len(gptsdisks), numout+1)
|
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
|
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)
|
#logging.debug("extremité %s, indices retenus interne %s, externe %s",i, idfin, iddeb)
|
||||||
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
comp = geompy.MakeCompound(raydisks[k][iddeb:idfin])
|
||||||
name='compoundRay%d'%k
|
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)
|
nappe = geompy.MakeFilling(comp, 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default)
|
||||||
nappes.append(nappe)
|
nappes.append(nappe)
|
||||||
name='nappe%d'%k
|
name='nappe%d'%k
|
||||||
geompy.addToStudy(nappe, name)
|
geomPublish(initLog.debug, nappe, name)
|
||||||
facesDebouchantes[i] = True
|
facesDebouchantes[i] = True
|
||||||
listNappes.append(nappes)
|
listNappes.append(nappes)
|
||||||
|
|
||||||
@ -914,13 +917,13 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
ednouv.append(ed)
|
ednouv.append(ed)
|
||||||
logging.debug(" edges issues de la partition: %s", ednouv)
|
logging.debug(" edges issues de la partition: %s", ednouv)
|
||||||
for ii, ed in enumerate(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)
|
[edsorted, minl,maxl] = sortEdges(ednouv)
|
||||||
logging.debug(" longueur edge trouvée: %s", maxl)
|
logging.debug(" longueur edge trouvée: %s", maxl)
|
||||||
edge = edsorted[-1]
|
edge = edsorted[-1]
|
||||||
edges.append(edge)
|
edges.append(edge)
|
||||||
name = 'edgeEndPipe%d'%k
|
name = 'edgeEndPipe%d'%k
|
||||||
geompy.addToStudy(edge, name)
|
geomPublish(initLog.debug, edge, name)
|
||||||
listEdges.append(edges)
|
listEdges.append(edges)
|
||||||
|
|
||||||
# --- création des points du maillage du pipe sur la face de peau
|
# --- création des points du maillage du pipe sur la face de peau
|
||||||
@ -932,9 +935,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
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)
|
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]
|
centre = ptEdgeFond[idFillingFromBout[i]][id]
|
||||||
name = "centre%d"%id
|
name = "centre%d"%id
|
||||||
geompy.addToStudy(centre, name)
|
geomPublish(initLog.debug, centre, name)
|
||||||
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
|
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
|
||||||
geompy.addToStudyInFather(centre, vertPipePeau, "vertPipePeau")
|
geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau")
|
||||||
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
|
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
|
||||||
edgesCirc = []
|
edgesCirc = []
|
||||||
for grpEdgesCirc in grpsEdgesCirc:
|
for grpEdgesCirc in grpsEdgesCirc:
|
||||||
@ -961,7 +964,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
else:
|
else:
|
||||||
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
|
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u)
|
||||||
name ="bout%d"%k
|
name ="bout%d"%k
|
||||||
geompy.addToStudyInFather(centre, bout, name)
|
geomPublishInFather(initLog.debug,centre, bout, name)
|
||||||
# enregistrement des points dans la structure
|
# enregistrement des points dans la structure
|
||||||
points = []
|
points = []
|
||||||
for j in range(nbsegRad +1):
|
for j in range(nbsegRad +1):
|
||||||
@ -1238,7 +1241,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
||||||
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
|
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
|
||||||
geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords")
|
geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
|
||||||
|
|
||||||
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
|
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
|
||||||
|
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
import salome
|
import salome
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from geomsmesh import smesh
|
from geomsmesh import smesh
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
import SMESH
|
import SMESH
|
||||||
@ -80,7 +83,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
WirePorteFondFissure = wiretube
|
WirePorteFondFissure = wiretube
|
||||||
fillingFaceExterne = facesDefaut[0]
|
fillingFaceExterne = facesDefaut[0]
|
||||||
logging.debug("fillingFaceExterne %s", fillingFaceExterne)
|
logging.debug("fillingFaceExterne %s", fillingFaceExterne)
|
||||||
geompy.addToStudy(fillingFaceExterne, "fillingFaceExterne")
|
geomPublish(initLog.debug, fillingFaceExterne, "fillingFaceExterne")
|
||||||
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
|
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
|
||||||
|
|
||||||
O, OX, OY, OZ = triedreBase()
|
O, OX, OY, OZ = triedreBase()
|
||||||
@ -90,7 +93,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
|
|
||||||
# --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée
|
# --- 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)
|
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)
|
edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False)
|
||||||
|
|
||||||
@ -103,39 +106,39 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
lgmax = lg
|
lgmax = lg
|
||||||
imax = i
|
imax = i
|
||||||
edgemax = edges[imax]
|
edgemax = edges[imax]
|
||||||
geompy.addToStudy(edgemax, 'edgemax')
|
geomPublish(initLog.debug, edgemax, 'edgemax')
|
||||||
centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
|
centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
|
||||||
geompy.addToStudy(centreFondFiss, 'centreFondFiss')
|
geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss')
|
||||||
tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
|
tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
|
||||||
geompy.addToStudy(tangentFondFiss, 'tangentFondFiss')
|
geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss')
|
||||||
|
|
||||||
bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
|
bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
|
||||||
geompy.addToStudy(bord1FondFiss, 'bord1FondFiss')
|
geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss')
|
||||||
tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
|
tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
|
||||||
geompy.addToStudy(tangentBord1FondFiss, 'tangentBord1FondFiss')
|
geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss')
|
||||||
|
|
||||||
bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
|
bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
|
||||||
geompy.addToStudy(bord2FondFiss, 'bord2FondFiss')
|
geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss')
|
||||||
tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
|
tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
|
||||||
geompy.addToStudy(tangentBord2FondFiss, 'tangentBord2FondFiss')
|
geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss')
|
||||||
|
|
||||||
planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
|
planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
|
||||||
planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
|
planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
|
||||||
geompy.addToStudy(planBord1, 'planBord1')
|
geomPublish(initLog.debug, planBord1, 'planBord1')
|
||||||
geompy.addToStudy(planBord2, 'planBord2')
|
geomPublish(initLog.debug, planBord2, 'planBord2')
|
||||||
|
|
||||||
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
|
[edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
|
||||||
[facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
|
[facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
|
||||||
|
|
||||||
# --- partition peau -face fissure - pipe fond de fissure prolongé
|
# --- partition peau -face fissure - pipe fond de fissure prolongé
|
||||||
partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
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
|
# --- identification face de peau
|
||||||
[facesPeauFissInside, facesPeauFissOutside, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
|
[facesPeauFissInside, facesPeauFissOutside, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
|
||||||
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
|
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
|
||||||
facePeau = facesPeauSorted[-1] # la plus 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
|
# --- identification edges de bord face peau
|
||||||
edgesBords = []
|
edgesBords = []
|
||||||
@ -144,7 +147,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
edgesBords.append(edgepeau)
|
edgesBords.append(edgepeau)
|
||||||
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgesBordPeau, edgesBords)
|
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
|
# --- identification face fissure externe au pipe et edge commune peau fissure
|
||||||
for face in facesPeauFissInside:
|
for face in facesPeauFissInside:
|
||||||
@ -153,9 +156,9 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
if sharedEdges is not None:
|
if sharedEdges is not None:
|
||||||
faceFiss = face
|
faceFiss = face
|
||||||
edgePeauFiss = sharedEdges[0]
|
edgePeauFiss = sharedEdges[0]
|
||||||
geompy.addToStudyInFather(partitionPeauFissByPipe, faceFiss, "faceFiss")
|
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss")
|
||||||
geompy.addToStudyInFather(faceFiss, edgePeauFiss, "edgePeauFiss")
|
geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss")
|
||||||
geompy.addToStudyInFather(facePeau, edgePeauFiss, "edgePeauFiss")
|
geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss")
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -168,16 +171,16 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
verticesDemiCerclesPeau = []
|
verticesDemiCerclesPeau = []
|
||||||
for i, edge in enumerate(demiCerclesPeau):
|
for i, edge in enumerate(demiCerclesPeau):
|
||||||
name = "demiCerclePeau_%d"%i
|
name = "demiCerclePeau_%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, edge, name)
|
geomPublishInFather(initLog.debug,facePeau, edge, name)
|
||||||
verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
|
verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
|
||||||
verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
|
verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
|
||||||
for i, vertex in enumerate(verticesDemiCerclesPeau):
|
for i, vertex in enumerate(verticesDemiCerclesPeau):
|
||||||
name = "verticesDemiCerclesPeau_%d"%i
|
name = "verticesDemiCerclesPeau_%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, vertex, name)
|
geomPublishInFather(initLog.debug,facePeau, vertex, name)
|
||||||
verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
|
verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
|
||||||
for i, vertex in enumerate(verticesOutCercles):
|
for i, vertex in enumerate(verticesOutCercles):
|
||||||
name = "verticesOutCercles_%d"%i
|
name = "verticesOutCercles_%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, vertex, name)
|
geomPublishInFather(initLog.debug,facePeau, vertex, name)
|
||||||
|
|
||||||
# --- demi cercles regroupés
|
# --- demi cercles regroupés
|
||||||
groupsDemiCerclesPeau = []
|
groupsDemiCerclesPeau = []
|
||||||
@ -189,7 +192,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(group, demis)
|
geompy.UnionList(group, demis)
|
||||||
name = "Cercle%d"%i
|
name = "Cercle%d"%i
|
||||||
geompy.addToStudyInFather(facePeau, group , name)
|
geomPublishInFather(initLog.debug,facePeau, group , name)
|
||||||
groupsDemiCerclesPeau.append(group)
|
groupsDemiCerclesPeau.append(group)
|
||||||
|
|
||||||
# --- identification edges commune pipe face fissure externe au pipe
|
# --- identification edges commune pipe face fissure externe au pipe
|
||||||
@ -200,10 +203,10 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
|
if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
|
||||||
edgesFaceFissPipe.append(edge)
|
edgesFaceFissPipe.append(edge)
|
||||||
name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
|
name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
|
||||||
geompy.addToStudyInFather(faceFiss, edge, name)
|
geomPublishInFather(initLog.debug,faceFiss, edge, name)
|
||||||
groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
|
groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
|
geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
|
||||||
geompy.addToStudyInFather(faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
|
geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- pipe de fond de fissure
|
# --- pipe de fond de fissure
|
||||||
@ -240,29 +243,29 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
#pipeFondFiss = pipesSorted[-1]
|
#pipeFondFiss = pipesSorted[-1]
|
||||||
#pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
|
#pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
|
||||||
|
|
||||||
geompy.addToStudy( disque, 'disque')
|
geomPublish(initLog.debug, disque, 'disque')
|
||||||
geompy.addToStudy( wireFondFiss, 'wireFondFiss')
|
geomPublish(initLog.debug, wireFondFiss, 'wireFondFiss')
|
||||||
geompy.addToStudy( pipeFondFiss, 'pipeFondFiss')
|
geomPublish(initLog.debug, pipeFondFiss, 'pipeFondFiss')
|
||||||
|
|
||||||
VerticesEndFondFiss = findWireEndVertices(wireFondFiss)
|
VerticesEndFondFiss = findWireEndVertices(wireFondFiss)
|
||||||
for i, v in enumerate(VerticesEndFondFiss):
|
for i, v in enumerate(VerticesEndFondFiss):
|
||||||
name = "vertexEndFondFiss_%d"%i
|
name = "vertexEndFondFiss_%d"%i
|
||||||
geompy.addToStudyInFather(wireFondFiss, v, name)
|
geomPublishInFather(initLog.debug,wireFondFiss, v, name)
|
||||||
VerticesEndPipeFiss = []
|
VerticesEndPipeFiss = []
|
||||||
for v in VerticesEndFondFiss:
|
for v in VerticesEndFondFiss:
|
||||||
VerticesEndPipeFiss.append(geompy.GetInPlace(pipeFondFiss, v))
|
VerticesEndPipeFiss.append(geompy.GetInPlace(pipeFondFiss, v))
|
||||||
for i, v in enumerate(VerticesEndPipeFiss):
|
for i, v in enumerate(VerticesEndPipeFiss):
|
||||||
name = "vertexEndPipeFiss_%d"%i
|
name = "vertexEndPipeFiss_%d"%i
|
||||||
geompy.addToStudyInFather(pipeFondFiss, v, name)
|
geomPublishInFather(initLog.debug,pipeFondFiss, v, name)
|
||||||
|
|
||||||
geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
|
geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[0], "PFOR")
|
||||||
geompy.addToStudyInFather(pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
|
geomPublishInFather(initLog.debug,pipeFondFiss, VerticesEndPipeFiss[1], "PFEX")
|
||||||
if geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[0]) > geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[1]):
|
if geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[0]) > geompy.MinDistance(VerticesEndPipeFiss[0], verticesOutCercles[1]):
|
||||||
a = verticesOutCercles[0]
|
a = verticesOutCercles[0]
|
||||||
verticesOutCercles[0] = verticesOutCercles[1]
|
verticesOutCercles[0] = verticesOutCercles[1]
|
||||||
verticesOutCercles[1] = a
|
verticesOutCercles[1] = a
|
||||||
geompy.addToStudyInFather(facePeau, verticesOutCercles[0], "THOR")
|
geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[0], "THOR")
|
||||||
geompy.addToStudyInFather(facePeau, verticesOutCercles[1], "THEX")
|
geomPublishInFather(initLog.debug,facePeau, verticesOutCercles[1], "THEX")
|
||||||
|
|
||||||
[facesPipeInside, facesPipeOutside, facesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "FACE", 0.1, "pipe_bord_")
|
[facesPipeInside, facesPipeOutside, facesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "FACE", 0.1, "pipe_bord_")
|
||||||
[edgesPipeInside, edgesPipeOutside, edgesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "EDGE", 0.1, "pipe_bord_")
|
[edgesPipeInside, edgesPipeOutside, edgesPipeOnside] = extractionOrientee(fillingFaceExterne, pipeFondFiss, centreFondFiss, "EDGE", 0.1, "pipe_bord_")
|
||||||
@ -275,7 +278,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
|
|
||||||
centre = geompy.MakeVertexOnSurface(planfiss, 0.5, 0.5)
|
centre = geompy.MakeVertexOnSurface(planfiss, 0.5, 0.5)
|
||||||
refpoint = geompy.MakeTranslationVector(centre, geompy.GetNormal(planfiss,centre))
|
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_")
|
[facesPipeInplan, facesPipeOutplan, facesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "FACE", 0.1, "pipe_plan_")
|
||||||
[edgesPipeInplan, edgesPipeOutplan, edgesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "EDGE", 0.1, "pipe_plan_")
|
[edgesPipeInplan, edgesPipeOutplan, edgesPipeOnplan] = extractionOrientee(planfiss, pipeFondFiss, refpoint, "EDGE", 0.1, "pipe_plan_")
|
||||||
|
|
||||||
@ -315,7 +318,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
generFiss.append(edge)
|
generFiss.append(edge)
|
||||||
groupGenerFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
|
groupGenerFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupGenerFiss, generFiss)
|
geompy.UnionList(groupGenerFiss, generFiss)
|
||||||
geompy.addToStudyInFather(pipeFondFiss, groupGenerFiss, "GenFiss")
|
geomPublishInFather(initLog.debug,pipeFondFiss, groupGenerFiss, "GenFiss")
|
||||||
|
|
||||||
# --- demi cercles externes regroupés
|
# --- demi cercles externes regroupés
|
||||||
groupsDemiCerclesPipe = []
|
groupsDemiCerclesPipe = []
|
||||||
@ -327,7 +330,7 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
group = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
|
group = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(group, demis)
|
geompy.UnionList(group, demis)
|
||||||
name = "Cercle%d"%i
|
name = "Cercle%d"%i
|
||||||
geompy.addToStudyInFather(pipeFondFiss, group , name)
|
geomPublishInFather(initLog.debug,pipeFondFiss, group , name)
|
||||||
groupsDemiCerclesPipe.append(group)
|
groupsDemiCerclesPipe.append(group)
|
||||||
|
|
||||||
# --- faces fissure dans le pipe
|
# --- faces fissure dans le pipe
|
||||||
@ -344,12 +347,12 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
logging.debug("face found")
|
logging.debug("face found")
|
||||||
facesFissinPipe.append(face)
|
facesFissinPipe.append(face)
|
||||||
name = "faceFissInPipe_%d"%i
|
name = "faceFissInPipe_%d"%i
|
||||||
geompy.addToStudyInFather(pipeFondFiss, face, name)
|
geomPublishInFather(initLog.debug,pipeFondFiss, face, name)
|
||||||
break
|
break
|
||||||
groupFaceFissInPipe = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["FACE"])
|
groupFaceFissInPipe = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["FACE"])
|
||||||
geompy.UnionList(groupFaceFissInPipe, facesFissinPipe)
|
geompy.UnionList(groupFaceFissInPipe, facesFissinPipe)
|
||||||
name = "FaceFissInPipe"
|
name = "FaceFissInPipe"
|
||||||
geompy.addToStudyInFather(pipeFondFiss, groupFaceFissInPipe , name)
|
geomPublishInFather(initLog.debug,pipeFondFiss, groupFaceFissInPipe , name)
|
||||||
|
|
||||||
# --- edges de fond de fissure
|
# --- edges de fond de fissure
|
||||||
|
|
||||||
@ -359,11 +362,11 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
logging.debug(" edge %s ", anEdge)
|
logging.debug(" edge %s ", anEdge)
|
||||||
edgesFondFiss.append(anEdge)
|
edgesFondFiss.append(anEdge)
|
||||||
name ="edgeFondFissure_%d"%i
|
name ="edgeFondFissure_%d"%i
|
||||||
geompy.addToStudyInFather(pipeFondFiss, anEdge, name)
|
geomPublishInFather(initLog.debug,pipeFondFiss, anEdge, name)
|
||||||
groupEdgeFondFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
|
groupEdgeFondFiss = geompy.CreateGroup(pipeFondFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgeFondFiss, edgesFondFiss)
|
geompy.UnionList(groupEdgeFondFiss, edgesFondFiss)
|
||||||
name = "FONDFISS"
|
name = "FONDFISS"
|
||||||
geompy.addToStudyInFather(pipeFondFiss, groupEdgeFondFiss , name)
|
geomPublishInFather(initLog.debug,pipeFondFiss, groupEdgeFondFiss , name)
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# --- maillage
|
# --- maillage
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from geomsmesh import smesh
|
from geomsmesh import smesh
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
import SMESH
|
import SMESH
|
||||||
@ -34,7 +37,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
|
|||||||
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
||||||
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
|
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
|
||||||
geompy.addToStudyInFather(filling, groupEdgesBordPeau , "EdgesBords")
|
geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
|
||||||
|
|
||||||
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
|
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- partition du bloc defaut par generatrice, tore et plan fissure
|
# --- partition du bloc defaut par generatrice, tore et plan fissure
|
||||||
@ -29,10 +32,10 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
faceFissure = geompy.GetInPlaceByHistory(volDefautPart, facefis)
|
faceFissure = geompy.GetInPlaceByHistory(volDefautPart, facefis)
|
||||||
#ellipsoidep =geompy.GetInPlaceByHistory(volDefautPart, ellipsoide)
|
#ellipsoidep =geompy.GetInPlaceByHistory(volDefautPart, ellipsoide)
|
||||||
|
|
||||||
geompy.addToStudy( volDefautPart, 'volDefautPart' )
|
geomPublish(initLog.debug, volDefautPart, 'volDefautPart' )
|
||||||
geompy.addToStudyInFather( volDefautPart, tore, 'tore' )
|
geomPublishInFather(initLog.debug, volDefautPart, tore, 'tore' )
|
||||||
geompy.addToStudyInFather( volDefautPart, faceFissure, 'FACE1' )
|
geomPublishInFather(initLog.debug, volDefautPart, faceFissure, 'FACE1' )
|
||||||
#geompy.addToStudyInFather( volDefautPart, gencnt, 'generatrice' )
|
#geomPublishInFather(initLog.debug, volDefautPart, gencnt, 'generatrice' )
|
||||||
|
|
||||||
solids = geompy.ExtractShapes(blocp, geompy.ShapeType["SOLID"], True)
|
solids = geompy.ExtractShapes(blocp, geompy.ShapeType["SOLID"], True)
|
||||||
vols = []
|
vols = []
|
||||||
@ -47,13 +50,13 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
imaxvol = vols.index(maxvol)
|
imaxvol = vols.index(maxvol)
|
||||||
ellipsoidep = solids[imaxvol]
|
ellipsoidep = solids[imaxvol]
|
||||||
|
|
||||||
geompy.addToStudyInFather( volDefautPart, blocp, 'bloc' )
|
geomPublishInFather(initLog.debug, volDefautPart, blocp, 'bloc' )
|
||||||
geompy.addToStudyInFather( volDefautPart, ellipsoidep, 'ellipsoide' )
|
geomPublishInFather(initLog.debug, volDefautPart, ellipsoidep, 'ellipsoide' )
|
||||||
|
|
||||||
sharedFaces = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["FACE"])
|
sharedFaces = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["FACE"])
|
||||||
for i in range(len(sharedFaces)):
|
for i in range(len(sharedFaces)):
|
||||||
name = "faceCommuneEllipsoideBloc_%d"%i
|
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"])
|
#sharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
|
||||||
allSharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
|
allSharedEdges = geompy.GetSharedShapesMulti([blocp, ellipsoidep], geompy.ShapeType["EDGE"])
|
||||||
@ -63,7 +66,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
sharedEdges.append(allSharedEdges[i])
|
sharedEdges.append(allSharedEdges[i])
|
||||||
for i in range(len(sharedEdges)):
|
for i in range(len(sharedEdges)):
|
||||||
name = "edgeCommuneEllipsoideBloc_%d"%i
|
name = "edgeCommuneEllipsoideBloc_%d"%i
|
||||||
geompy.addToStudyInFather(blocp, sharedEdges[i], name)
|
geomPublishInFather(initLog.debug,blocp, sharedEdges[i], name)
|
||||||
|
|
||||||
facesExternes = []
|
facesExternes = []
|
||||||
facesExtBloc = []
|
facesExtBloc = []
|
||||||
@ -75,14 +78,14 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
faceExt = geompy.GetInPlace(ellipsoidep, faces[i])
|
faceExt = geompy.GetInPlace(ellipsoidep, faces[i])
|
||||||
if faceExt is not None:
|
if faceExt is not None:
|
||||||
name = "faceExterne_e%d"%i
|
name = "faceExterne_e%d"%i
|
||||||
geompy.addToStudyInFather(ellipsoidep, faceExt, name)
|
geomPublishInFather(initLog.debug,ellipsoidep, faceExt, name)
|
||||||
facesExternes.append(faceExt)
|
facesExternes.append(faceExt)
|
||||||
facesExtElli.append(faceExt)
|
facesExtElli.append(faceExt)
|
||||||
|
|
||||||
faceExt = geompy.GetInPlace(blocp, faces[i])
|
faceExt = geompy.GetInPlace(blocp, faces[i])
|
||||||
if faceExt is not None:
|
if faceExt is not None:
|
||||||
name = "faceExterne_b%d"%i
|
name = "faceExterne_b%d"%i
|
||||||
geompy.addToStudyInFather(blocp, faceExt, name)
|
geomPublishInFather(initLog.debug,blocp, faceExt, name)
|
||||||
facesExternes.append(faceExt)
|
facesExternes.append(faceExt)
|
||||||
facesExtBloc.append(faceExt)
|
facesExtBloc.append(faceExt)
|
||||||
else:
|
else:
|
||||||
@ -93,12 +96,12 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
#extrusionFace = geompy.MakePrismVecH2Ways(faces[i], normal, 0.1)
|
#extrusionFace = geompy.MakePrismVecH2Ways(faces[i], normal, 0.1)
|
||||||
#extrusionFace = geompy.MakeScaleTransform(extrusionFace, vertex, 1.01)
|
#extrusionFace = geompy.MakeScaleTransform(extrusionFace, vertex, 1.01)
|
||||||
name = "extrusionFace_b%d"%i
|
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_ONIN)
|
||||||
facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
facesExt = geompy.GetShapesOnShape(extrusionFace, blocp, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
||||||
for j in range(len(facesExt)):
|
for j in range(len(facesExt)):
|
||||||
name = "faceExterne_b%d_%d"%(i,j)
|
name = "faceExterne_b%d_%d"%(i,j)
|
||||||
geompy.addToStudyInFather(blocp, facesExt[j], name)
|
geomPublishInFather(initLog.debug,blocp, facesExt[j], name)
|
||||||
facesExternes.append(facesExt[j])
|
facesExternes.append(facesExt[j])
|
||||||
facesExtBloc.append(facesExt[j])
|
facesExtBloc.append(facesExt[j])
|
||||||
|
|
||||||
@ -120,7 +123,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
pass
|
pass
|
||||||
if len(allSharedEdges) > 0:
|
if len(allSharedEdges) > 0:
|
||||||
name = "faceExterne_b%d_%d"%(i,j)
|
name = "faceExterne_b%d_%d"%(i,j)
|
||||||
geompy.addToStudyInFather(blocp, facesBloc[i], name)
|
geomPublishInFather(initLog.debug,blocp, facesBloc[i], name)
|
||||||
facesExternes.append(facesBloc[i])
|
facesExternes.append(facesBloc[i])
|
||||||
facesExtBloc.append(facesBloc[i])
|
facesExtBloc.append(facesBloc[i])
|
||||||
|
|
||||||
@ -136,7 +139,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
aretesInternes += shared
|
aretesInternes += shared
|
||||||
for i in range(len(aretesInternes)):
|
for i in range(len(aretesInternes)):
|
||||||
name = "aretesInternes_%d"%i
|
name = "aretesInternes_%d"%i
|
||||||
geompy.addToStudyInFather(blocp, aretesInternes[i], name)
|
geomPublishInFather(initLog.debug,blocp, aretesInternes[i], name)
|
||||||
|
|
||||||
edgesBords = []
|
edgesBords = []
|
||||||
for faceExtB in facesExtBloc:
|
for faceExtB in facesExtBloc:
|
||||||
@ -150,7 +153,7 @@ def partitionBlocDefaut(volDefaut, facesDefaut, gener, pipe,
|
|||||||
if not isInterne:
|
if not isInterne:
|
||||||
edgesBords.append(edges[i])
|
edgesBords.append(edges[i])
|
||||||
name = "edgeBord%d"%i
|
name = "edgeBord%d"%i
|
||||||
geompy.addToStudyInFather(blocp,edges[i] , name)
|
geomPublishInFather(initLog.debug,blocp,edges[i] , name)
|
||||||
group = None
|
group = None
|
||||||
if len(edgesBords) > 0:
|
if len(edgesBords) > 0:
|
||||||
group = geompy.CreateGroup(blocp, geompy.ShapeType["EDGE"])
|
group = geompy.CreateGroup(blocp, geompy.ShapeType["EDGE"])
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
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
|
# --- partition volume sain et bloc, face du bloc recevant la fissure
|
||||||
@ -26,8 +29,8 @@ def partitionVolumeSain(volumeSain,boiteDefaut):
|
|||||||
partieSaine = b
|
partieSaine = b
|
||||||
faceBloc = geompy.GetShapesOnShapeAsCompound(volumeSain, volDefaut, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
faceBloc = geompy.GetShapesOnShapeAsCompound(volumeSain, volDefaut, geompy.ShapeType["FACE"], GEOM.ST_ON)
|
||||||
|
|
||||||
geompy.addToStudy( volumeSainPart, 'volumeSainPart' )
|
geomPublish(initLog.debug, volumeSainPart, 'volumeSainPart' )
|
||||||
geompy.addToStudyInFather( volumeSainPart, partieSaine, 'partieSaine' )
|
geomPublishInFather(initLog.debug, volumeSainPart, partieSaine, 'partieSaine' )
|
||||||
geompy.addToStudyInFather( volumeSainPart, volDefaut, 'volDefaut' )
|
geomPublishInFather(initLog.debug, volumeSainPart, volDefaut, 'volDefaut' )
|
||||||
geompy.addToStudyInFather( volDefaut, faceBloc, 'faceBloc' )
|
geomPublishInFather(initLog.debug, volDefaut, faceBloc, 'faceBloc' )
|
||||||
return volumeSainPart, partieSaine, volDefaut, faceBloc
|
return volumeSainPart, partieSaine, volDefaut, faceBloc
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import math
|
import math
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from findWireEndVertices import findWireEndVertices
|
from findWireEndVertices import findWireEndVertices
|
||||||
from prolongeWire import prolongeWire
|
from prolongeWire import prolongeWire
|
||||||
|
|
||||||
@ -21,41 +24,41 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
|
|||||||
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
|
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
|
||||||
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
|
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
|
||||||
geompy.addToStudy(shapeDefaut, 'shapeDefaut_coupe')
|
geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
|
||||||
#geompy.addToStudyInFather(shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
|
#geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
|
||||||
|
|
||||||
extrem, norms = findWireEndVertices(fondFiss, True)
|
extrem, norms = findWireEndVertices(fondFiss, True)
|
||||||
logging.debug("extrem: %s, norm: %s",extrem, norms)
|
logging.debug("extrem: %s, norm: %s",extrem, norms)
|
||||||
cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
|
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
|
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)
|
fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
|
||||||
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
|
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
|
||||||
geompy.addToStudy(pipeFiss, 'pipeFiss')
|
geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
|
||||||
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
||||||
geompy.addToStudy(partFissPipe, 'partFissPipe')
|
geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
|
||||||
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
|
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
|
||||||
geompy.addToStudy(fissPipe, 'fissPipe')
|
geomPublish(initLog.debug, fissPipe, 'fissPipe')
|
||||||
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
|
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
|
||||||
geompy.addToStudy(partPipe, 'partPipe')
|
geomPublish(initLog.debug, partPipe, 'partPipe')
|
||||||
|
|
||||||
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
|
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
|
||||||
for i, edge in enumerate(edgesPipeFiss):
|
for i, edge in enumerate(edgesPipeFiss):
|
||||||
name = "edgePipe%d"%i
|
name = "edgePipe%d"%i
|
||||||
geompy.addToStudyInFather(fissPipe, edge, name)
|
geomPublishInFather(initLog.debug,fissPipe, edge, name)
|
||||||
try:
|
try:
|
||||||
wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
|
wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
|
||||||
except:
|
except:
|
||||||
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
|
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
|
||||||
logging.debug("wirePipeFiss construit sous forme de compound")
|
logging.debug("wirePipeFiss construit sous forme de compound")
|
||||||
geompy.addToStudy(wirePipeFiss, "wirePipeFiss")
|
geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
|
||||||
|
|
||||||
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
|
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
|
||||||
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
|
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
|
||||||
for i, edge in enumerate(edgesFondFiss):
|
for i, edge in enumerate(edgesFondFiss):
|
||||||
name = "edgeFondFiss%d"%i
|
name = "edgeFondFiss%d"%i
|
||||||
geompy.addToStudyInFather(fissPipe, edge, name)
|
geomPublishInFather(initLog.debug,fissPipe, edge, name)
|
||||||
wireFondFiss = geompy.MakeWire(edgesFondFiss)
|
wireFondFiss = geompy.MakeWire(edgesFondFiss)
|
||||||
geompy.addToStudy(wireFondFiss,"wireFondFiss")
|
geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
|
||||||
|
|
||||||
return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)
|
return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- recherche et classement des edges du tore par propagate
|
# --- recherche et classement des edges du tore par propagate
|
||||||
@ -18,7 +21,7 @@ def propagateTore(tore):
|
|||||||
lencomp = []
|
lencomp = []
|
||||||
compounds = geompy.Propagate(tore)
|
compounds = geompy.Propagate(tore)
|
||||||
for i in range(len(compounds)):
|
for i in range(len(compounds)):
|
||||||
#geompy.addToStudyInFather( tore, compounds[i], 'edges' )
|
#geomPublishInFather(initLog.debug, tore, compounds[i], 'edges' )
|
||||||
props = geompy.BasicProperties(compounds[i])
|
props = geompy.BasicProperties(compounds[i])
|
||||||
lencomp.append(props[0])
|
lencomp.append(props[0])
|
||||||
pass
|
pass
|
||||||
@ -35,10 +38,10 @@ def propagateTore(tore):
|
|||||||
else:
|
else:
|
||||||
circles.append(compounds[i])
|
circles.append(compounds[i])
|
||||||
|
|
||||||
geompy.addToStudyInFather( tore, diams[0], 'diams0' )
|
geomPublishInFather(initLog.debug, tore, diams[0], 'diams0' )
|
||||||
geompy.addToStudyInFather( tore, diams[1], 'diams1' )
|
geomPublishInFather(initLog.debug, tore, diams[1], 'diams1' )
|
||||||
geompy.addToStudyInFather( tore, circles[0], 'circles0' )
|
geomPublishInFather(initLog.debug, tore, circles[0], 'circles0' )
|
||||||
geompy.addToStudyInFather( tore, circles[1], 'circles1' )
|
geomPublishInFather(initLog.debug, tore, circles[1], 'circles1' )
|
||||||
geompy.addToStudyInFather( tore, geners[0], 'geners' )
|
geomPublishInFather(initLog.debug, tore, geners[0], 'geners' )
|
||||||
|
|
||||||
return diams, circles, geners
|
return diams, circles, geners
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -225,23 +228,23 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
if i == 0:
|
if i == 0:
|
||||||
noeudsBords[0].append(node)
|
noeudsBords[0].append(node)
|
||||||
#name = "bord0_%d"%k
|
#name = "bord0_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
if i == (nbLignes -1):
|
if i == (nbLignes -1):
|
||||||
noeudsBords[2].append(node)
|
noeudsBords[2].append(node)
|
||||||
#name = "bord2_%d"%k
|
#name = "bord2_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
if j == 0:
|
if j == 0:
|
||||||
noeudsBords[1].append(node)
|
noeudsBords[1].append(node)
|
||||||
#name = "bord1_%d"%k
|
#name = "bord1_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
if j == (nbCols -1):
|
if j == (nbCols -1):
|
||||||
noeudsBords[3].append(node)
|
noeudsBords[3].append(node)
|
||||||
#name = "bord3_%d"%k
|
#name = "bord3_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
k += 1
|
k += 1
|
||||||
curve = geompy.MakeInterpol(nodeList, False, False)
|
curve = geompy.MakeInterpol(nodeList, False, False)
|
||||||
#name = "curve_%d"%i
|
#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
|
if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe
|
||||||
curvconts.append(nodeList)
|
curvconts.append(nodeList)
|
||||||
curves.append(curve)
|
curves.append(curve)
|
||||||
@ -291,11 +294,11 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
vecteurDefaut = geompy.MakeVector(vertex, cdg)
|
vecteurDefaut = geompy.MakeVector(vertex, cdg)
|
||||||
|
|
||||||
if vecteurDefaut is not None:
|
if vecteurDefaut is not None:
|
||||||
geompy.addToStudy(normal, "normFillOrig%d"%iface)
|
geomPublish(initLog.debug, normal, "normFillOrig%d"%iface)
|
||||||
geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface)
|
geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface)
|
||||||
if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
|
if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
|
||||||
filling = geompy.ChangeOrientation(filling)
|
filling = geompy.ChangeOrientation(filling)
|
||||||
geompy.addToStudy( filling, "filling%d"%iface )
|
geomPublish(initLog.debug, filling, "filling%d"%iface )
|
||||||
#geompy.ExportBREP(filling, "filling.brep")
|
#geompy.ExportBREP(filling, "filling.brep")
|
||||||
iface = iface+1
|
iface = iface+1
|
||||||
fillings.append(filling)
|
fillings.append(filling)
|
||||||
@ -315,7 +318,7 @@ def quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
curve = geompy.MakeInterpol(nodes, False, False)
|
curve = geompy.MakeInterpol(nodes, False, False)
|
||||||
curves.append(curve)
|
curves.append(curve)
|
||||||
fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
|
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)
|
fillconts.append(fillcont)
|
||||||
icont = icont+1
|
icont = icont+1
|
||||||
pass # --- loop while there are remaining nodes
|
pass # --- loop while there are remaining nodes
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -40,6 +43,7 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
|
|
||||||
allNodeIds = meshQuad.GetNodesId()
|
allNodeIds = meshQuad.GetNodesId()
|
||||||
while len(allNodeIds):
|
while len(allNodeIds):
|
||||||
|
logging.debug("len(allNodeIds): %s ", len(allNodeIds))
|
||||||
nodeIds = allNodeIds
|
nodeIds = allNodeIds
|
||||||
for idNode in nodeIds: # rechercher un coin
|
for idNode in nodeIds: # rechercher un coin
|
||||||
elems = meshQuad.GetNodeInverseElements(idNode)
|
elems = meshQuad.GetNodeInverseElements(idNode)
|
||||||
@ -227,23 +231,23 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
if i == 0:
|
if i == 0:
|
||||||
noeudsBords[0].append(node)
|
noeudsBords[0].append(node)
|
||||||
#name = "bord0_%d"%k
|
#name = "bord0_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
if i == (nbLignes -1):
|
if i == (nbLignes -1):
|
||||||
noeudsBords[2].append(node)
|
noeudsBords[2].append(node)
|
||||||
#name = "bord2_%d"%k
|
#name = "bord2_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
if j == 0:
|
if j == 0:
|
||||||
noeudsBords[1].append(node)
|
noeudsBords[1].append(node)
|
||||||
#name = "bord1_%d"%k
|
#name = "bord1_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
if j == (nbCols -1):
|
if j == (nbCols -1):
|
||||||
noeudsBords[3].append(node)
|
noeudsBords[3].append(node)
|
||||||
#name = "bord3_%d"%k
|
#name = "bord3_%d"%k
|
||||||
#geompy.addToStudy( node, name )
|
#geomPublish(initLog.debug, node, name )
|
||||||
k += 1
|
k += 1
|
||||||
curve = geompy.MakeInterpol(nodeList, False, False)
|
curve = geompy.MakeInterpol(nodeList, False, False)
|
||||||
#name = "curve_%d"%i
|
#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
|
if len(curvconts) == 0 or len(curves) > 0: # éliminer les doublons de la surface sans découpe
|
||||||
curvconts.append(nodeList)
|
curvconts.append(nodeList)
|
||||||
curves.append(curve)
|
curves.append(curve)
|
||||||
@ -293,11 +297,11 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
vecteurDefaut = geompy.MakeVector(vertex, cdg)
|
vecteurDefaut = geompy.MakeVector(vertex, cdg)
|
||||||
|
|
||||||
if vecteurDefaut is not None:
|
if vecteurDefaut is not None:
|
||||||
geompy.addToStudy(normal, "normFillOrig%d"%iface)
|
geomPublish(initLog.debug, normal, "normFillOrig%d"%iface)
|
||||||
geompy.addToStudy(vecteurDefaut, "fromInterieur%d"%iface)
|
geomPublish(initLog.debug, vecteurDefaut, "fromInterieur%d"%iface)
|
||||||
if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
|
if geompy.GetAngleRadians(vecteurDefaut, normal) > math.pi/2.0:
|
||||||
filling = geompy.ChangeOrientation(filling)
|
filling = geompy.ChangeOrientation(filling)
|
||||||
geompy.addToStudy( filling, "filling%d"%iface )
|
geomPublish(initLog.debug, filling, "filling%d"%iface )
|
||||||
#geompy.ExportBREP(filling, "filling.brep")
|
#geompy.ExportBREP(filling, "filling.brep")
|
||||||
iface = iface+1
|
iface = iface+1
|
||||||
fillings.append(filling)
|
fillings.append(filling)
|
||||||
@ -318,7 +322,7 @@ def quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss):
|
|||||||
curve = geompy.MakeInterpol(nodes, False, False)
|
curve = geompy.MakeInterpol(nodes, False, False)
|
||||||
curves.append(curve)
|
curves.append(curve)
|
||||||
fillcont = geompy.MakeFilling(geompy.MakeCompound(curves), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
|
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)
|
fillconts.append(fillcont)
|
||||||
icont = icont+1
|
icont = icont+1
|
||||||
pass # --- loop while there are remaining nodes
|
pass # --- loop while there are remaining nodes
|
||||||
|
@ -7,6 +7,9 @@ Created on Tue Jun 24 09:14:13 2014
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
|
|
||||||
from listOfExtraFunctions import createNewMeshesFromCorner
|
from listOfExtraFunctions import createNewMeshesFromCorner
|
||||||
@ -62,7 +65,7 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent
|
|||||||
# A partir des lignes de chaque face,
|
# A partir des lignes de chaque face,
|
||||||
# on recrée un objet GEOM temporaire par filling.
|
# 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)
|
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)
|
tmpFillings.append(filling)
|
||||||
|
|
||||||
for face in setOfNodes:
|
for face in setOfNodes:
|
||||||
@ -81,10 +84,10 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent
|
|||||||
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
|
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
|
||||||
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
|
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
|
||||||
if len(tmpExplodeRef) == len(tmpExplodeNum):
|
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)
|
facesNonCoupees.append(filling)
|
||||||
else:
|
else:
|
||||||
geompy.addToStudy(filling, "faceCoupee_{0}".format(i + 1))
|
geomPublish(initLog.debug, filling, "faceCoupee_{0}".format(i + 1))
|
||||||
facesCoupees.append(filling)
|
facesCoupees.append(filling)
|
||||||
fillings = facesCoupees, facesNonCoupees
|
fillings = facesCoupees, facesNonCoupees
|
||||||
|
|
||||||
@ -93,21 +96,21 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, shapeFissureParams, cent
|
|||||||
tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True)
|
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)
|
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True)
|
||||||
if len(tmpExplodeRef) == len(tmpExplodeNum):
|
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)
|
aretesNonCoupees.append(filling)
|
||||||
else:
|
else:
|
||||||
geompy.addToStudy(filling, "areteCoupee_{0}".format(i + 1))
|
geomPublish(initLog.debug, filling, "areteCoupee_{0}".format(i + 1))
|
||||||
aretesCoupees.append(filling)
|
aretesCoupees.append(filling)
|
||||||
bords_Partages = aretesCoupees, aretesNonCoupees
|
bords_Partages = aretesCoupees, aretesNonCoupees
|
||||||
|
|
||||||
# TODO: A enlever
|
# TODO: A enlever
|
||||||
# for i, face in enumerate(setOfLines):
|
# for i, face in enumerate(setOfLines):
|
||||||
# for j, line in enumerate(face):
|
# 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
|
#TODO: A enlever
|
||||||
# for i, filling in enumerate(fillings[0]):
|
# 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]):
|
# for j, line in enumerate(setOfLines[i]):
|
||||||
# geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1))
|
# geompy.addToStudyInFather(filling, line, 'line_{0}'.format(j + 1))
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
from sortFaces import sortFaces
|
from sortFaces import sortFaces
|
||||||
|
|
||||||
def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
|
def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
|
||||||
@ -11,7 +14,7 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
|
|||||||
"""
|
"""
|
||||||
logging.info('start')
|
logging.info('start')
|
||||||
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
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)
|
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
|
||||||
if pointInterne is not None:
|
if pointInterne is not None:
|
||||||
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
|
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
|
||||||
@ -23,5 +26,5 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
|
|||||||
logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
|
logging.debug("surfaces faces fissure étendue, min %s, max %s", minSurf, maxSurf)
|
||||||
facesPortFissure = facesPartShapeDefautSorted[-1]
|
facesPortFissure = facesPartShapeDefautSorted[-1]
|
||||||
|
|
||||||
geompy.addToStudy(facesPortFissure, "facesPortFissure")
|
geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
|
||||||
return facesPortFissure
|
return facesPortFissure
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import math
|
import math
|
||||||
from triedreBase import triedreBase
|
from triedreBase import triedreBase
|
||||||
O, OX, OY, OZ = triedreBase()
|
O, OX, OY, OZ = triedreBase()
|
||||||
@ -48,9 +51,9 @@ def rotTrans(objet, orientation, point, normal, trace = False):
|
|||||||
logging.debug("alpha",alpha)
|
logging.debug("alpha",alpha)
|
||||||
logging.debug("beta",beta)
|
logging.debug("beta",beta)
|
||||||
if trace:
|
if trace:
|
||||||
geompy.addToStudy( rot1, 'rot1' )
|
geomPublish(initLog.debug, rot1, 'rot1' )
|
||||||
geompy.addToStudy( axe2, 'axe2' )
|
geomPublish(initLog.debug, axe2, 'axe2' )
|
||||||
geompy.addToStudy( rot2, 'rot2' )
|
geomPublish(initLog.debug, rot2, 'rot2' )
|
||||||
|
|
||||||
xyz = geompy.PointCoordinates(point)
|
xyz = geompy.PointCoordinates(point)
|
||||||
trans = geompy.MakeTranslation(rot2, xyz[0], xyz[1], xyz[2])
|
trans = geompy.MakeTranslation(rot2, xyz[0], xyz[1], xyz[2])
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
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)
|
# --- 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)
|
||||||
@ -30,6 +33,6 @@ def shapeSurFissure(facesFissure):
|
|||||||
normal = geompy.GetNormal(face, vertex)
|
normal = geompy.GetNormal(face, vertex)
|
||||||
extrusionFaceFissure = geompy.MakePrismVecH(facesFissure, normal, 100)
|
extrusionFaceFissure = geompy.MakePrismVecH(facesFissure, normal, 100)
|
||||||
|
|
||||||
geompy.addToStudy(extrusionFaceFissure, "extrusionFaceFissure")
|
geomPublish(initLog.debug, extrusionFaceFissure, "extrusionFaceFissure")
|
||||||
return extrusionFaceFissure, normal
|
return extrusionFaceFissure, normal
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- tri par longueur des 3 generatrices
|
# --- tri par longueur des 3 generatrices
|
||||||
@ -36,8 +39,8 @@ def sortGeneratrices(tore, geners):
|
|||||||
gencnt= genx[i]
|
gencnt= genx[i]
|
||||||
pass
|
pass
|
||||||
|
|
||||||
geompy.addToStudyInFather( tore, genext, 'genext' )
|
geomPublishInFather(initLog.debug, tore, genext, 'genext' )
|
||||||
geompy.addToStudyInFather( tore, genint, 'genint' )
|
geomPublishInFather(initLog.debug, tore, genint, 'genint' )
|
||||||
geompy.addToStudyInFather( tore, gencnt, 'gencnt' )
|
geomPublishInFather(initLog.debug, tore, gencnt, 'gencnt' )
|
||||||
|
|
||||||
return genext, genint, gencnt
|
return genext, genint, gencnt
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
import math
|
import math
|
||||||
from triedreBase import triedreBase
|
from triedreBase import triedreBase
|
||||||
|
|
||||||
@ -28,11 +31,11 @@ def toreFissure(minRad,allonge,rayTore):
|
|||||||
Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3)
|
Arc_1 = geompy.MakeArc(Vertex_1, Vertex_2, Vertex_3)
|
||||||
generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1)
|
generatrice = geompy.MakeScaleAlongAxes(Arc_1, O, 1, allonge, 1)
|
||||||
|
|
||||||
#geompy.addToStudy( Vertex_1, 'Vertex_1' )
|
#geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
|
||||||
#geompy.addToStudy( Vertex_2, 'Vertex_2' )
|
#geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
|
||||||
#geompy.addToStudy( Vertex_3, 'Vertex_3' )
|
#geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
|
||||||
#geompy.addToStudy( Arc_1, 'Arc_1' )
|
#geomPublish(initLog.debug, Arc_1, 'Arc_1' )
|
||||||
#geompy.addToStudy( generatrice, 'generatrice' )
|
#geomPublish(initLog.debug, generatrice, 'generatrice' )
|
||||||
|
|
||||||
# --- face circulaire sur la generatrice, pour extrusion
|
# --- face circulaire sur la generatrice, pour extrusion
|
||||||
|
|
||||||
@ -41,10 +44,10 @@ def toreFissure(minRad,allonge,rayTore):
|
|||||||
Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0)
|
Translation_1 = geompy.MakeTranslation(Rotation_1, minRad, 0, 0)
|
||||||
FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1)
|
FaceGenFiss = geompy.MakeFaceWires([Translation_1], 1)
|
||||||
|
|
||||||
#geompy.addToStudy( Circle_1, 'Circle_1' )
|
#geomPublish(initLog.debug, Circle_1, 'Circle_1' )
|
||||||
#geompy.addToStudy( Rotation_1, 'Rotation_1' )
|
#geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
|
||||||
#geompy.addToStudy( Translation_1, 'Translation_1' )
|
#geomPublish(initLog.debug, Translation_1, 'Translation_1' )
|
||||||
#geompy.addToStudy( FaceGenFiss, 'FaceGenFiss' )
|
#geomPublish(initLog.debug, FaceGenFiss, 'FaceGenFiss' )
|
||||||
|
|
||||||
# --- tore extrude
|
# --- tore extrude
|
||||||
|
|
||||||
@ -56,14 +59,14 @@ def toreFissure(minRad,allonge,rayTore):
|
|||||||
Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3)
|
Line_1 = geompy.MakeLineTwoPnt(Vertex_1, Scale_1_vertex_3)
|
||||||
FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1)
|
FaceFissure = geompy.MakeFaceWires([generatrice, Line_1], 1)
|
||||||
|
|
||||||
#geompy.addToStudyInFather( generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
|
#geomPublishInFather(initLog.debug, generatrice, Scale_1_vertex_3, 'Scale_1:vertex_3' )
|
||||||
#geompy.addToStudy( Line_1, 'Line_1' )
|
#geomPublish(initLog.debug, Line_1, 'Line_1' )
|
||||||
#geompy.addToStudy( FaceFissure, 'FaceFissure' )
|
#geomPublish(initLog.debug, FaceFissure, 'FaceFissure' )
|
||||||
|
|
||||||
# --- tore coupe en 2 demi tore de section 1/2 disque
|
# --- tore coupe en 2 demi tore de section 1/2 disque
|
||||||
|
|
||||||
Plane_1 = geompy.MakePlane(O, OZ, 2000)
|
Plane_1 = geompy.MakePlane(O, OZ, 2000)
|
||||||
Pipe1Part = geompy.MakePartition([Pipe_1], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
|
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
|
return generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
# --- origine et vecteurs de base
|
# --- origine et vecteurs de base
|
||||||
|
|
||||||
@ -24,9 +27,9 @@ def triedreBase():
|
|||||||
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||||
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||||
|
|
||||||
geompy.addToStudy( O, 'O' )
|
geomPublish(initLog.debug, O, 'O' )
|
||||||
geompy.addToStudy( OX, 'OX' )
|
geomPublish(initLog.debug, OX, 'OX' )
|
||||||
geompy.addToStudy( OY, 'OY' )
|
geomPublish(initLog.debug, OY, 'OY' )
|
||||||
geompy.addToStudy( OZ, 'OZ' )
|
geomPublish(initLog.debug, OZ, 'OZ' )
|
||||||
|
|
||||||
return O, OX, OY, OZ
|
return O, OX, OY, OZ
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from geomsmesh import geompy
|
from geomsmesh import geompy
|
||||||
|
from geomsmesh import geomPublish
|
||||||
|
from geomsmesh import geomPublishInFather
|
||||||
|
import initLog
|
||||||
|
|
||||||
def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau):
|
def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, partitionPeauFissFond, edgesFissExtPeau):
|
||||||
"""
|
"""
|
||||||
@ -24,6 +27,6 @@ def trouveEdgesFissPeau(facesInside, facesOnside, edgesPipeIn, edgesFondIn, part
|
|||||||
if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
|
if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0):
|
||||||
edgesFissExtPeau.append(edgesPeauFis[0])
|
edgesFissExtPeau.append(edgesPeauFis[0])
|
||||||
name="edgesFissExtPeau%d"%j
|
name="edgesFissExtPeau%d"%j
|
||||||
geompy.addToStudyInFather(partitionPeauFissFond, edgesPeauFis[0], name)
|
geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesPeauFis[0], name)
|
||||||
j += 1
|
j += 1
|
||||||
return edgesFissExtPeau
|
return edgesFissExtPeau
|
Loading…
Reference in New Issue
Block a user