mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
arguments inutiles
This commit is contained in:
parent
6cdcd4fb15
commit
19f671efb9
@ -24,7 +24,6 @@ import logging
|
|||||||
from . import initLog
|
from . import initLog
|
||||||
|
|
||||||
import salome
|
import salome
|
||||||
from salome.smesh import smeshBuilder
|
|
||||||
|
|
||||||
from .geomsmesh import geompy
|
from .geomsmesh import geompy
|
||||||
from .geomsmesh import geomPublishInFather
|
from .geomsmesh import geomPublishInFather
|
||||||
@ -160,8 +159,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
|||||||
# --- recherche des points en trop (externes au volume à remailler)
|
# --- recherche des points en trop (externes au volume à remailler)
|
||||||
# - on associe chaque extrémité du pipe à une face filling
|
# - on associe chaque extrémité du pipe à une face filling
|
||||||
# - on part des disques aux extrémités du pipe
|
# - on part des disques aux extrémités du pipe
|
||||||
# - pour chaque disque, on prend les vertices de géométrie,
|
# - pour chaque disque, on prend les vertices de géométrie on marque leur position relative à la face.
|
||||||
# on marque leur position relative à la face.
|
|
||||||
# - on s'arrete quand tous les noeuds sont dedans
|
# - on s'arrete quand tous les noeuds sont dedans
|
||||||
|
|
||||||
(idFillingFromBout, idisklim, idiskout) = elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle)
|
(idFillingFromBout, idisklim, idiskout) = elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle)
|
||||||
@ -173,7 +171,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
|||||||
|
|
||||||
# --- 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
|
||||||
|
|
||||||
(gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \
|
gptsdisks = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \
|
||||||
ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
|
ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
|
||||||
|
|
||||||
# --- ajustement precis des points sur edgesPipeFissureExterneC
|
# --- ajustement precis des points sur edgesPipeFissureExterneC
|
||||||
|
@ -35,6 +35,9 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
|||||||
nro_cas=None):
|
nro_cas=None):
|
||||||
"""maillage effectif du pipe"""
|
"""maillage effectif du pipe"""
|
||||||
logging.info('start')
|
logging.info('start')
|
||||||
|
logging.info("nbsegCercle = %d, nbsegRad = %d", nbsegCercle, nbsegRad)
|
||||||
|
logging.info("idisklim[0] = %d, idisklim[1] = %d", idisklim[0], idisklim[1])
|
||||||
|
|
||||||
meshPipe = smesh.Mesh(None, "meshPipe")
|
meshPipe = smesh.Mesh(None, "meshPipe")
|
||||||
putName(meshPipe, "meshPipe", i_pref=nro_cas)
|
putName(meshPipe, "meshPipe", i_pref=nro_cas)
|
||||||
|
|
||||||
@ -55,14 +58,14 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
|||||||
mVols = list() # identifiants volumes maillage pipe
|
mVols = list() # identifiants volumes maillage pipe
|
||||||
|
|
||||||
for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
|
for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
|
||||||
#print ("\nidisk = {}".format(idisk))
|
#logging.info(". Prise en compte du disque n°%d", idisk)
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# --- Les points
|
# --- Les points
|
||||||
|
|
||||||
oldmpts = mptdsk
|
oldmpts = mptdsk
|
||||||
mptdsk = construitMaillagePipe_a(idisk, \
|
mptdsk = construitMaillagePipe_a(idisk, \
|
||||||
gptsdisks, idisklim, nbsegCercle, \
|
gptsdisks, nbsegCercle, \
|
||||||
meshPipe, mptsdisks)
|
meshPipe, mptsdisks)
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
from .geomsmesh import geompy
|
from .geomsmesh import geompy
|
||||||
|
|
||||||
def construitMaillagePipe_a(idisk, \
|
def construitMaillagePipe_a(idisk, \
|
||||||
gptsdisks, idisklim, nbsegCercle, \
|
gptsdisks, nbsegCercle, \
|
||||||
meshPipe, mptsdisks):
|
meshPipe, mptsdisks):
|
||||||
"""Les points"""
|
"""Les points"""
|
||||||
#logging.info('start')
|
#logging.info('start')
|
||||||
|
@ -33,33 +33,38 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
logging.info('start')
|
logging.info('start')
|
||||||
|
|
||||||
for n_edges, edges in enumerate(listEdges):
|
for n_edges, edges in enumerate(listEdges):
|
||||||
|
|
||||||
idf = idFacesDebouchantes[n_edges] # indice de face débouchante (facesPipePeau)
|
idf = idFacesDebouchantes[n_edges] # indice de face débouchante (facesPipePeau)
|
||||||
|
logging.info("idf: %d", idf)
|
||||||
if idf >= 0:
|
if idf >= 0:
|
||||||
gptdsk = list()
|
gptdsk = list()
|
||||||
if idf > 0: # idf vaut 0 ou 1
|
if idf > 0: # idf vaut 0 ou 1
|
||||||
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[n_edges]][idf]
|
centre = ptEdgeFond[idFillingFromBout[n_edges]][idf]
|
||||||
name = "centre%d"%idf
|
name = "centre_{}".format(idf)
|
||||||
geomPublish(initLog.debug, centre, name)
|
geomPublish(initLog.debug, centre, name)
|
||||||
vertPipePeau = ptFisExtPi[idFillingFromBout[n_edges]][idf]
|
vertPipePeau = ptFisExtPi[idFillingFromBout[n_edges]][idf]
|
||||||
geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau")
|
geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau")
|
||||||
grpsEdgesCirc = edCircPeau[idFillingFromBout[n_edges]] # liste de groupes
|
grpsEdgesCirc = edCircPeau[idFillingFromBout[n_edges]] # liste de groupes
|
||||||
|
|
||||||
edgesCirc = list()
|
edgesCirc = list()
|
||||||
for grpEdgesCirc in grpsEdgesCirc:
|
for grpEdgesCirc in grpsEdgesCirc:
|
||||||
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
||||||
for k, edge in enumerate(edges):
|
logging.info("edgesCirc: %s", edgesCirc)
|
||||||
|
|
||||||
|
for i_aux, edge in enumerate(edges):
|
||||||
extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
|
extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
|
||||||
if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]):
|
if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]):
|
||||||
bout = extrems[1]
|
bout = extrems[1]
|
||||||
else:
|
else:
|
||||||
bout = extrems[0]
|
bout = extrems[0]
|
||||||
# ajustement du point extrémité (bout) sur l'edge circulaire en face de peau
|
# ajustement du point extrémité (bout) sur l'edge circulaire en face de peau
|
||||||
logging.debug("edgesCirc: %s", edgesCirc)
|
|
||||||
distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)]
|
distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)]
|
||||||
distEdgeCirc.sort()
|
distEdgeCirc.sort()
|
||||||
logging.debug("distEdgeCirc: %s", distEdgeCirc)
|
logging.debug("distEdgeCirc: %s", distEdgeCirc)
|
||||||
dist = projettePointSurCourbe(bout, distEdgeCirc[0][2])
|
dist = projettePointSurCourbe(bout, distEdgeCirc[0][2])
|
||||||
if (abs(dist) < 0.02) or (abs(1.-dist) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément.
|
# les points très proches d'une extrémité doivent y être mis précisément.
|
||||||
|
if (abs(dist) < 0.02) or (abs(1.-dist) < 0.02):
|
||||||
extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True)
|
extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True)
|
||||||
if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]):
|
if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]):
|
||||||
bout = extrCircs[0]
|
bout = extrCircs[0]
|
||||||
@ -67,7 +72,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
bout = extrCircs[1]
|
bout = extrCircs[1]
|
||||||
else:
|
else:
|
||||||
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], dist)
|
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], dist)
|
||||||
name ="bout%d"%k
|
name = "bout_{}";format(i_aux)
|
||||||
geomPublishInFather(initLog.debug, centre, bout, name)
|
geomPublishInFather(initLog.debug, centre, bout, name)
|
||||||
# enregistrement des points dans la structure
|
# enregistrement des points dans la structure
|
||||||
points = list()
|
points = list()
|
||||||
@ -78,6 +83,8 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
points[0] = centre
|
points[0] = centre
|
||||||
points[-1] = bout
|
points[-1] = bout
|
||||||
gptdsk.append(points)
|
gptdsk.append(points)
|
||||||
|
|
||||||
|
# Enregistrement des extrémités
|
||||||
if n_edges == 0:
|
if n_edges == 0:
|
||||||
gptsdisks[idisklim[0] -1] = gptdsk
|
gptsdisks[idisklim[0] -1] = gptdsk
|
||||||
idisklim[0] = idisklim[0] -1
|
idisklim[0] = idisklim[0] -1
|
||||||
@ -85,4 +92,4 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
gptsdisks[idisklim[1] +1] = gptdsk
|
gptsdisks[idisklim[1] +1] = gptdsk
|
||||||
idisklim[1] = idisklim[1] +1
|
idisklim[1] = idisklim[1] +1
|
||||||
|
|
||||||
return (gptsdisks, idisklim)
|
return gptsdisks
|
||||||
|
Loading…
Reference in New Issue
Block a user