From: Renaud Nédélec Date: Mon, 3 Nov 2014 08:54:48 +0000 (+0100) Subject: first fully working version, not optimised though X-Git-Tag: V7_8_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0939da642972e2f4ed12e54ea2172b4c9f156f1f;p=modules%2Fgeom.git first fully working version, not optimised though --- diff --git a/src/Tools/t_shape_builder.py b/src/Tools/t_shape_builder.py index 95e70fd06..dfaa4a4d8 100644 --- a/src/Tools/t_shape_builder.py +++ b/src/Tools/t_shape_builder.py @@ -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"""