first fully working version, not optimised though

This commit is contained in:
Renaud Nédélec 2014-11-03 09:54:48 +01:00
parent 8d2d6670c4
commit 0939da6429

View File

@ -131,11 +131,12 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0):
"""
# --- creation des faces de la jonction
[faci, sect45, arc1, l1, lord90, lord45, edges] = jonction(study, r1, r2,\
h1, h2, a1)
[faci, sect45, arc1, l1, lord90, lord45, edges, arcextru] = jonction(study, r1, r2,\
h1, h2, a1)
if with_solid:
[faci_ext, sect45_ext, arc1_ext, l1_ext, lord90_ext, lord45_ext, edges_ext] = jonction(study, r1 + solid_thickness, r2 + solid_thickness,\
h1, h2, a1)
[faci_ext, sect45_ext, arc1_ext, l1_ext, \
lord90_ext, lord45_ext, edges_ext, arcextru_ext] = jonction(study, r1 + solid_thickness, r2 + solid_thickness,\
h1, h2, a1)
faces_jonction_ext = []
for i,l in enumerate(lord90):
faces_jonction_ext.append(geompy.MakeQuad2Edges(lord90[i],lord90_ext[i]))
@ -150,7 +151,10 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0):
# --- extrusion droite des faces de jonction, pour reconstituer les demi cylindres
# TODO : ajouter les faces nécessaires à sect45 dans le cas avec solide
if with_solid:
sect45 = geompy.MakePartition([sect45]+faces_jonction_ext[-7:])
sect45 = geompy.MakeCompound([sect45]+faces_jonction_ext[-3:])
sect45 = geompy.MakeGlueEdges(sect45, 1e-7)
#return sect45, faces_jonction_ext[-3:]
extru1 = geompy.MakePrismVecH(sect45, OX, h1+10)
#base2 = geompy.MakeCompound(faci[5:])
@ -179,7 +183,7 @@ def build_shape(study, r1, r2, h1, h2, solid_thickness=0):
faces_coupe = faci[:5]
if with_solid:
faces_coupe.extend(faces_jonction_ext[-7:])
raccord = geompy.MakePartition([garder], faces_coupe, [], [], geompy.ShapeType["SOLID"], 0, [], 0, True)
raccord = geompy.MakePartition([garder], faces_coupe + [arcextru], [], [], geompy.ShapeType["SOLID"], 0, [], 0, True)
assemblage = geompy.MakeCompound([raccord, extru1, extru2])
assemblage = geompy.MakeGlueFaces(assemblage, 1e-7)
# RNC : perf
@ -363,7 +367,7 @@ def jonction(study, r1, r2, h1, h2, a1):
for i,f in enumerate(faci):
geompy.addToStudy(f, "faci_%d"%i)
return faci, sect45, arc1, l1, lord90, lord45, edges
return faci, sect45, arc1, l1, lord90, lord45, edges, arcextru
if __name__=="__main__":
"""For testing purpose"""