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