Back to index

salome-geom  6.5.0
GEOM_Spanner.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 #  GEOM GEOM_SWIG : binding of C++ implementaion with Python
00025 #  File   : GEOM_Spanner.py
00026 #  Author : Julia DOROVSKIKH
00027 #  Module : GEOM
00028 #  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/GEOM_SWIG/GEOM_Spanner.py,v 1.8.2.2.10.3.14.1 2012-04-13 05:48:08 vsr Exp $
00029 # ! Please, if you edit this example file, update also
00030 # ! GEOM_SRC/doc/salome/gui/GEOM/input/tui_test_spanner.doc
00031 # ! as some sequences of symbols from this example are used during
00032 # ! documentation generation to identify certain places of this file
00033 ############# MakeSpanner #############
00034 #
00035 def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
00036 
00037   ### Variables ###
00038 
00039   th = 4.0
00040 
00041   ### BlocksOp ###
00042 
00043   BlocksOp = geompy.BlocksOp
00044 
00045   ### Basic points and directions ###
00046 
00047   p0  = geompy.MakeVertex(0., 0., 0.)
00048   pth = geompy.MakeVertex(0., 0., th)
00049 
00050   vx = geompy.MakeVectorDXDYDZ(1., 0., 0.)
00051   vy = geompy.MakeVectorDXDYDZ(0., 1., 0.)
00052   vz = geompy.MakeVectorDXDYDZ(0., 0., 1.)
00053 
00054   vxy = geompy.MakeVectorDXDYDZ(1., 1., 0.)
00055 
00056   ### Block 1 ###
00057 
00058   p_10_0  = geompy.MakeVertex(10.,  0., 0.)
00059   p_10_25 = geompy.MakeVertex(10., 25., 0.)
00060   p_0_35  = geompy.MakeVertex( 0., 35., 0.)
00061   p_0_10  = geompy.MakeVertex( 0., 10., 0.)
00062 
00063   Face11 = geompy.MakeQuad4Vertices(p_10_0, p_10_25, p_0_10, p_0_35);
00064   id_face11 = geompy.addToStudy(Face11, "1 Face for Block 1")
00065 
00066   Face12 = geompy.MakeTranslationTwoPoints(Face11, p0, pth)
00067   id_face12 = geompy.addToStudy(Face12, "2 Face for Block 1")
00068 
00069   Block1 = geompy.MakeHexa2Faces(Face11, Face12)
00070   id_block1 = geompy.addToStudy(Block1, "Block 1")
00071 
00072   ### Block 2 ###
00073 
00074   p_15_0  = geompy.MakeVertex(15.,  0., 0.)
00075   p_15_20 = geompy.MakeVertex(15., 20., 0.)
00076 
00077   Edge21 = geompy.MakeEdge(p_15_0, p_15_20)
00078   id_edge21 = geompy.addToStudy(Edge21, "1 Edge for Block 2")
00079 
00080   Edge22 = geompy.GetEdge(Block1, p_10_0, p_10_25)
00081   id_edge22 = geompy.addToStudy(Edge22, "2 Edge for Block 2")
00082 
00083   Face21 = geompy.MakeQuad2Edges(Edge21, Edge22);
00084   id_face21 = geompy.addToStudy(Face21, "1 Face for Block 2")
00085 
00086   Face22 = geompy.MakeTranslationTwoPoints(Face21, p0, pth)
00087   id_face22 = geompy.addToStudy(Face22, "2 Face for Block 2")
00088 
00089   Block2 = geompy.MakeHexa2Faces(Face21, Face22)
00090   id_block2 = geompy.addToStudy(Block2, "Block 2")
00091 
00092   ### Block 3 ###
00093 
00094   p_15_10_1 = geompy.MakeVertex(15., 10., 1.)
00095 
00096   Face31 = geompy.GetFaceNearPoint(Block2, p_15_10_1)
00097   id_face31 = geompy.addToStudy(Face31, "1 Face for Block 3")
00098 
00099   Prism1 = geompy.MakePrismVecH(Face31, vx, 5);
00100   id_prism1 = geompy.addToStudy(Prism1, "Prism to be Block 3")
00101 
00102   nbFaces = geompy.ShapesOp.NumberOfFaces(Prism1)
00103   if nbFaces == 6:
00104     print "Prism 1 is a hexahedral solid"
00105   else:
00106     print "Prism 1 is not a hexahedral solid"
00107 
00108   Prism1_faces = geompy.SubShapeAllSortedCentres(Prism1, geompy.ShapeType["FACE"])
00109   ii = 1
00110   for aFace in  Prism1_faces:
00111     name = geompy.SubShapeName(aFace, Prism1)
00112     Id_Face = geompy.addToStudyInFather(Prism1, aFace, name)
00113     ii = ii + 1
00114 
00115   Block3 = geompy.MakeHexa(Prism1_faces[0], Prism1_faces[1],
00116                            Prism1_faces[2], Prism1_faces[3],
00117                            Prism1_faces[4], Prism1_faces[5]);
00118   id_block3 = geompy.addToStudy(Block3, "Block 3")
00119 
00120   ### Block 4 ###
00121 
00122   Face41 = geompy.GetOppositeFace(Block3, Face31)
00123   id_face41 = geompy.addToStudy(Face41, "1 Face for Block 4")
00124 
00125   p_25_5  = geompy.MakeVertex(25.,  5., 0.)
00126   p_25_20 = geompy.MakeVertex(25., 20., 0.)
00127 
00128   Edge41 = geompy.MakeEdge(p_25_5, p_25_20)
00129   id_edge41 = geompy.addToStudy(Edge41, "1 Edge for Block 4")
00130 
00131   p_25_5_2  = geompy.MakeVertex(25.,  5., th)
00132   p_25_20_2 = geompy.MakeVertex(25., 20., th)
00133 
00134   Edge42 = geompy.MakeEdge(p_25_5_2, p_25_20_2)
00135   id_edge42 = geompy.addToStudy(Edge42, "2 Edge for Block 4")
00136 
00137   Edge43 = geompy.MakeEdge(p_25_5, p_25_5_2)
00138   id_edge43 = geompy.addToStudy(Edge43, "3 Edge for Block 4")
00139 
00140   Edge44 = geompy.MakeEdge(p_25_20, p_25_20_2)
00141   id_edge44 = geompy.addToStudy(Edge44, "4 Edge for Block 4")
00142 
00143   Face42 = geompy.MakeQuad(Edge41, Edge42, Edge43, Edge44)
00144   id_face42 = geompy.addToStudy(Face42, "2 Face for Block 4")
00145 
00146   Block4 = geompy.MakeHexa2Faces(Face41, Face42)
00147   id_block4 = geompy.addToStudy(Block4, "Block 4")
00148 
00149   ### Block 5 ###
00150 
00151   p_25_30   = geompy.MakeVertex(25., 30., 0.)
00152   p_25_30_1 = geompy.MakeVertex(25., 30., 1)
00153   axis_rot = geompy.MakeVector(p_25_30, p_25_30_1)
00154 
00155   Face51 = Face42
00156   Face52 = geompy.MakeRotation(Face51, axis_rot, math.pi/2.)
00157   id_face52 = geompy.addToStudy(Face52, "2 Face for Block 5")
00158 
00159   Block5 = geompy.MakeHexa2Faces(Face51, Face52)
00160   id_block5 = geompy.addToStudy(Block5, "Block 5")
00161 
00162   ### Compound of blocks 1 - 4 ###
00163 
00164   Comp1234 = geompy.MakeCompound([Block1, Block2, Block3, Block4])
00165   Glue1234 = geompy.MakeGlueFaces(Comp1234, 1e-5)
00166   id_glue1234 = geompy.addToStudy(Glue1234, "Glue 1234")
00167 
00168   plane_mirror = geompy.MakePlane(p_25_30, vxy, 100.)
00169   #id_plane_mirror = geompy.addToStudy(plane_mirror, "Plane for mirror")
00170 
00171   Mirror1 = geompy.MakeMirrorByPlane(Glue1234, plane_mirror)
00172   id_mirror1 = geompy.addToStudy(Mirror1, "Mirror 1")
00173 
00174   ### The second end ###
00175 
00176   p_18_0 = geompy.MakeVertex(18., 0., 0.)
00177   p_20_0 = geompy.MakeVertex(20., 0., 0.)
00178   p_40_0 = geompy.MakeVertex(40., 0., 0.)
00179 
00180   Edge1s = geompy.MakeEdge(p_20_0, p_40_0)
00181   id_edge1s = geompy.addToStudy(Edge1s, "1 Edge for Block 1s")
00182 
00183   Edge2s = geompy.MakeRotation(Edge1s, vz, math.pi/12.)
00184   id_edge2s = geompy.addToStudy(Edge2s, "2 Edge for Block 1s")
00185 
00186   p_18_0_r = geompy.MakeRotation(p_18_0, vz, math.pi/24.)
00187   p_20_0_r = geompy.MakeRotation(p_20_0, vz, math.pi/12.)
00188   p_40_0_r = geompy.MakeRotation(p_40_0, vz, math.pi/12.)
00189 
00190   Edge3s = geompy.MakeEdge(p_40_0, p_40_0_r)
00191   id_edge3s = geompy.addToStudy(Edge3s, "3 Edge for Block 1s")
00192 
00193   Edge4s = geompy.MakeArc(p_20_0, p_18_0_r, p_20_0_r)
00194   id_edge4s = geompy.addToStudy(Edge4s, "4 Edge for Block 1s")
00195 
00196   Face1s = geompy.MakeQuad(Edge1s, Edge2s, Edge3s, Edge4s)
00197   id_face1s = geompy.addToStudy(Face1s, "1 Face for Block 1s")
00198 
00199   Block1s = geompy.MakePrismVecH(Face1s, vz, th);
00200   id_block1s = geompy.addToStudy(Block1s, "Block 1s")
00201 
00202   p_30_0_1 = geompy.MakeVertex(30., 0., 1.)
00203 
00204   Face2s = geompy.GetFaceNearPoint(Block1s, p_30_0_1)
00205   id_face2s = geompy.addToStudy(Face2s, "2 Face of Block 1s")
00206 
00207   f2s_ind = geompy.LocalOp.GetSubShapeIndex(Block1s, Face2s)
00208 
00209   Block1s_tr1 = geompy.MakeMultiTransformation1D(Block1s, f2s_ind, 0, 24)
00210   id_block1s_tr1 = geompy.addToStudy(Block1s_tr1, "Multi-transformed Block 1s")
00211 
00212   p_60_150_0 = geompy.MakeVertex(60., -150., 0.)
00213   Gear = geompy.MakeTranslationTwoPoints(Block1s_tr1, p0, p_60_150_0)
00214   id_gear = geompy.addToStudy(Gear, "Gear")
00215 
00216   ### Link two parts ###
00217 
00218   ### Linking Block 1 ###
00219 
00220   p_55_0_1 = geompy.MakeVertex(55., 0., 1.)
00221   p_55_110_1 = geompy.MakeVertex(55., -110., 1.)
00222 
00223   Face11l = geompy.GetFaceNearPoint(Block5, p_55_0_1)
00224   id_face11l = geompy.addToStudy(Face11l, "1 Face for Linking Block 1")
00225 
00226   Face12l = geompy.GetFaceNearPoint(Gear, p_55_110_1)
00227   id_face12l = geompy.addToStudy(Face12l, "2 Face for Linking Block 1")
00228 
00229   Block1l = geompy.MakeHexa2Faces(Face11l, Face12l)
00230   id_block1l = geompy.addToStudy(Block1l, "Linking Block 1")
00231 
00232   ### Linking Block 2 ###
00233 
00234   p_25_0_1 = geompy.MakeVertex(25., 0., 1.)
00235   p_45_110_1 = geompy.MakeVertex(45., -110., 1.)
00236 
00237   Face21l = geompy.GetFaceNearPoint(Block4, p_25_0_1)
00238   id_face21l = geompy.addToStudy(Face21l, "1 Face for Linking Block 2")
00239 
00240   Face22l = geompy.GetFaceNearPoint(Gear, p_45_110_1)
00241   id_face22l = geompy.addToStudy(Face22l, "2 Face for Linking Block 2")
00242 
00243   Block2l = geompy.MakeHexa2Faces(Face21l, Face22l)
00244   id_block2l = geompy.addToStudy(Block2l, "Linking Block 2")
00245 
00246   ### Linking Block 3 ###
00247 
00248   p_55_30_1 = geompy.MakeVertex(55., 30., 1.)
00249   p_65_110_1 = geompy.MakeVertex(65., -110., 1.)
00250 
00251   Face31l = geompy.GetFaceNearPoint(Mirror1, p_55_30_1)
00252   id_face31l = geompy.addToStudy(Face31l, "1 Face for Linking Block 3")
00253 
00254   Face32l = geompy.GetFaceNearPoint(Gear, p_65_110_1)
00255   id_face32l = geompy.addToStudy(Face32l, "2 Face for Linking Block 3")
00256 
00257   Block3l = geompy.MakeHexa2Faces(Face31l, Face32l)
00258   id_block3l = geompy.addToStudy(Block3l, "Linking Block 3")
00259 
00260   ### Handle ###
00261 
00262   CompLB = geompy.MakeCompound([Block1l, Block2l, Block3l])
00263   Handle = geompy.MakeGlueFaces(CompLB, 1e-5)
00264   id_handle = geompy.addToStudy(Handle, "Handle")
00265 
00266   Block1h = geompy.GetBlockNearPoint(Handle, p_45_110_1)
00267   id_block1h = geompy.addToStudyInFather(Handle, Block1h, "Block 1 of Handle")
00268 
00269   Block2h = geompy.GetBlockNearPoint(Handle, p_65_110_1)
00270   id_block2h = geompy.addToStudyInFather(Handle, Block2h, "Block 2 of Handle")
00271 
00272   Face11h = geompy.GetFaceByNormale(Block1h, vx)
00273   id_face11h = geompy.addToStudyInFather(Block1h, Face11h, "Face 1")
00274 
00275   Face12h = geompy.GetOppositeFace(Block1h, Face11h)
00276   id_face12h = geompy.addToStudyInFather(Block1h, Face12h, "Face 2")
00277 
00278   Face21h = geompy.GetFaceByNormale(Block2h, vx)
00279   id_face21h = geompy.addToStudyInFather(Block2h, Face21h, "Face 1")
00280 
00281   Face22h = geompy.GetOppositeFace(Block2h, Face21h)
00282   id_face22h = geompy.addToStudyInFather(Block2h, Face22h, "Face 2")
00283 
00284   Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face21h])
00285   if BlocksOp.IsDone() == 0:
00286     Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face22h])
00287     if BlocksOp.IsDone() == 0:
00288         Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face21h])
00289         if BlocksOp.IsDone() == 0:
00290             Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face22h])
00291   if BlocksOp.IsDone() == 0:
00292     print "ERROR: BlocksOp.GetBlockByParts() failed : ", BlocksOp.GetErrorCode()
00293   else:
00294     id_block3h = geompy.addToStudyInFather(Handle, Block3h, "Block 3 of Handle")
00295 
00296   ### The whole shape ###
00297 
00298   CompALL = geompy.MakeCompound([Glue1234, Block5, Mirror1, Handle, Gear])
00299   Spanner = geompy.MakeGlueFaces(CompALL, 1e-5)
00300   id_glueALL = geompy.addToStudy(Spanner, "The Spanner")
00301 
00302   ### Check the Spanner ###
00303 
00304   isCompOfBlocks6 = BlocksOp.CheckCompoundOfBlocks(Spanner)
00305   if isCompOfBlocks6 == 0:
00306     print "Spanner is not a compound of hexahedral solids"
00307   else:
00308     print "Spanner is a compound of hexahedral solids"
00309 
00310   if isBlocksTest == 1:
00311 
00312     print "##################### Test More #####################"
00313 
00314     ### Get Blocks 4 and 5 from the spanner ###
00315 
00316     Face42_sp = geompy.GetFaceByEdges(Spanner, Edge41, Edge42)
00317     id_face42_sp = geompy.addToStudyInFather(Spanner, Face42_sp, "Face 4_2")
00318 
00319     Blocks_f4_sp = geompy.GetBlocksByParts(Spanner, [Face42_sp])
00320 
00321     isMRot2D = 0
00322 
00323     for aBlock in Blocks_f4_sp:
00324       name = geompy.SubShapeName(aBlock, Spanner)
00325       Id_block = geompy.addToStudyInFather(Spanner, aBlock, name)
00326 
00327       f42_sp_ind = geompy.LocalOp.GetSubShapeIndex(aBlock, Face42_sp)
00328 
00329       Face_5_horiz = geompy.GetFaceByNormale(aBlock, vz)
00330       f_5_horiz_ind = geompy.LocalOp.GetSubShapeIndex(aBlock, Face_5_horiz)
00331 
00332       MRot = None
00333       is2Dok = True
00334       try:
00335         MRot = geompy.MakeMultiTransformation2D(aBlock, f42_sp_ind, 0, 3, f_5_horiz_ind, 0, 5)
00336       except:
00337         is2Dok = False
00338       if is2Dok and MRot is not None:
00339         isMRot2D = 1
00340         p_z100 = geompy.MakeVertex(0., 0., 100.)
00341         MRot_tr = geompy.MakeTranslationTwoPoints(MRot, p0, p_z100)
00342         id_MRot_tr = geompy.addToStudy(MRot_tr, "Multi-rotated block 5")
00343 
00344     if isMRot2D == 0:
00345       print "2D Multi Transformation failed"
00346 
00347     ### Get one face of the Gear ###
00348 
00349     p_20_0_tr   = geompy.MakeTranslationTwoPoints(p_20_0  , p0, p_60_150_0)
00350     p_20_0_r_tr = geompy.MakeTranslationTwoPoints(p_20_0_r, p0, p_60_150_0)
00351     p_40_0_tr   = geompy.MakeTranslationTwoPoints(p_40_0  , p0, p_60_150_0)
00352     p_40_0_r_tr = geompy.MakeTranslationTwoPoints(p_40_0_r, p0, p_60_150_0)
00353 
00354     Face_g_1 = geompy.GetFaceByPoints(Gear, p_20_0_tr, p_20_0_r_tr, p_40_0_tr, p_40_0_r_tr)
00355     id_face_g_1 = geompy.addToStudyInFather(Gear, Face_g_1, "Face of Gear by four points")
00356 
00357     edgesNb = geompy.ShapesOp.NumberOfEdges(Face_g_1)
00358     print "Face of Gear has ", edgesNb, " edges"
00359 
00360     Face_g_1_tr = geompy.MakeTranslationTwoPoints(Face_g_1, p0, pth)
00361     id_face_g_1_tr = geompy.addToStudyInFather(Gear, Face_g_1_tr, "Face of Gear by four points, translated")
00362 
00363     ### equivalent of Block1s, but made as block
00364 
00365     Block_new = geompy.MakeHexa2Faces(Face_g_1, Face_g_1_tr)
00366     id_block_new = geompy.addToStudy(Block_new, "Block New")
00367 
00368   if isMeshTest == 1 and smesh is not None:
00369 
00370     print "##################### Build Mesh #####################"
00371 
00372 
00373     # ---- add a middle block of spanner handle in study
00374 
00375     p_45_0_1 = geompy.MakeVertex(45., 0., 1.)
00376     BlockMh = geompy.GetBlockNearPoint(Spanner, p_45_0_1)
00377     id_blockMh = geompy.addToStudyInFather(Spanner, BlockMh, "Middle Block of Spanner Handle")
00378 
00379     # ---- add the top face of the middle block in study
00380 
00381     FaceTop = geompy.GetFaceByNormale(BlockMh, vz)
00382     id_facetop = geompy.addToStudyInFather(BlockMh, FaceTop, "Top Face")
00383 
00384     # ---- add long edges of the top face in study
00385 
00386     FaceTop_edges = geompy.SubShapeAllSortedCentres(FaceTop, geompy.ShapeType["EDGE"])
00387     Edge1 = FaceTop_edges[0]
00388     Edge2 = FaceTop_edges[3]
00389     Id_Edge1 = geompy.addToStudyInFather(FaceTop, Edge1, "Edge 1")
00390     Id_Edge2 = geompy.addToStudyInFather(FaceTop, Edge2, "Edge 2")
00391 
00392     print "-------------------------- Algorithm and Hypothesis"
00393 
00394     print "---- Init a Mesh with the Spanner"
00395 
00396     mesh = smesh.Mesh(Spanner, "Meshed Spanner")
00397 
00398     print "-------------------------- add hypothesis to Spanner"
00399 
00400     print "-------------------------- NumberOfSegments"
00401     algoReg = mesh.Segment()
00402     listHyp = algoReg.GetCompatibleHypothesis()
00403     for hyp in listHyp:
00404       print hyp
00405     print algoReg.GetName()
00406     print algoReg.GetId()
00407     algoReg.SetName("Regular_1D")
00408 
00409 
00410     hypNbSeg3 = algoReg.NumberOfSegments(3)
00411     print hypNbSeg3.GetName()
00412     print hypNbSeg3.GetId()
00413     print hypNbSeg3.GetNumberOfSegments()
00414     smesh.SetName(hypNbSeg3, "NumberOfSegments_3")
00415 
00416     print "-------------------------- Quadrangle_2D"
00417 
00418     algoQuad = mesh.Quadrangle()
00419     listHyp = algoQuad.GetCompatibleHypothesis()
00420     for hyp in listHyp:
00421         print hyp
00422     print algoQuad.GetName()
00423     print algoQuad.GetId()
00424     algoQuad.SetName("Quadrangle_2D")
00425 
00426     print "-------------------------- add hypothesis to the Middle Block"
00427 
00428     print "-------------------------- LocalLength"
00429     algoRegMb = mesh.Segment(BlockMh)
00430     hypLen1 = algoRegMb.LocalLength(10)
00431     print hypLen1.GetName()
00432     print hypLen1.GetId()
00433     print hypLen1.GetLength()
00434     smesh.SetName(hypLen1, "Local_Length_10")
00435 
00436     print "-------------------------- add hypothesis to the long edges of the Top Face of the Middle Block"
00437 
00438     algoRegE1 = mesh.Segment(Edge1)
00439     hypPropE1 = algoRegE1.Propagation()
00440     print hypPropE1.GetName()
00441     print hypPropE1.GetId()
00442     smesh.SetName(hypPropE1, "Propagation hypothesis")
00443     smesh.SetName(algoRegE1.GetSubMesh(), "SubMesh Edge 1 of Top Face")
00444 
00445     algoRegE2 = mesh.Segment(Edge2)
00446     hypPropE2 = algoRegE2.Propagation()
00447     print hypPropE2.GetName()
00448     print hypPropE2.GetId()
00449     smesh.SetName(hypPropE2, "Propagation hypothesis")
00450     smesh.SetName(algoRegE2.GetSubMesh(), "SubMesh Edge 2 of Top Face")
00451 
00452     print "-------------------------- compute the mesh"
00453     mesh.Compute()
00454 
00455     print "Information about the Mesh:"
00456     print "Number of nodes       : ", mesh.NbNodes()
00457     print "Number of edges       : ", mesh.NbEdges()
00458     print "Number of faces       : ", mesh.NbFaces()
00459     print "Number of triangles   : ", mesh.NbTriangles()
00460     print "Number of quadrangles : ", mesh.NbQuadrangles()
00461     print "Number of volumes     : ", mesh.NbVolumes()
00462     print "Number of tetrahedrons: ", mesh.NbTetras()
00463 
00464   return Spanner