PR: examples adaptation to geomBuilder and smeshBuilder

This commit is contained in:
prascle 2013-03-22 00:14:23 +00:00
parent 6a253cdd1e
commit 9bb4cc82c2

View File

@ -49,7 +49,7 @@ isDone = pattern.LoadFromFace(Mesh_2.GetMesh(), Face_2, 0)
if (isDone != 1): print 'LoadFromFace :', pattern.GetErrorCode() if (isDone != 1): print 'LoadFromFace :', pattern.GetErrorCode()
# apply the pattern to a face of the first mesh # apply the pattern to a face of the first mesh
facesToSplit = Mesh_1.GetElementsByType(smesh.SMESH.FACE) facesToSplit = Mesh_1.GetElementsByType(SMESH.FACE)
print "Splitting %d rectangular face(s) to %d triangles..."%(len(facesToSplit), 2*len(facesToSplit)) print "Splitting %d rectangular face(s) to %d triangles..."%(len(facesToSplit), 2*len(facesToSplit))
pattern.ApplyToMeshFaces(Mesh_1.GetMesh(), facesToSplit, 0, 0) pattern.ApplyToMeshFaces(Mesh_1.GetMesh(), facesToSplit, 0, 0)
isDone = pattern.MakeMesh(Mesh_1.GetMesh(), 0, 0) isDone = pattern.MakeMesh(Mesh_1.GetMesh(), 0, 0)
@ -92,7 +92,7 @@ smp_hexa = """!!! Nb of points:
pattern_hexa.LoadFromFile(smp_hexa) pattern_hexa.LoadFromFile(smp_hexa)
# apply the pattern to a mesh # apply the pattern to a mesh
volsToSplit = Mesh_3.GetElementsByType(smesh.SMESH.VOLUME) volsToSplit = Mesh_3.GetElementsByType(SMESH.VOLUME)
print "Splitting %d hexa volume(s) to %d hexas..."%(len(volsToSplit), 4*len(volsToSplit)) print "Splitting %d hexa volume(s) to %d hexas..."%(len(volsToSplit), 4*len(volsToSplit))
pattern_hexa.ApplyToHexahedrons(Mesh_3.GetMesh(), volsToSplit,0,3) pattern_hexa.ApplyToHexahedrons(Mesh_3.GetMesh(), volsToSplit,0,3)
isDone = pattern_hexa.MakeMesh(Mesh_3.GetMesh(), True, True) isDone = pattern_hexa.MakeMesh(Mesh_3.GetMesh(), True, True)
@ -131,7 +131,7 @@ smp_pyra = """!!! Nb of points:
pattern_pyra.LoadFromFile(smp_pyra) pattern_pyra.LoadFromFile(smp_pyra)
# apply the pattern to a face mesh # apply the pattern to a face mesh
volsToSplit = Mesh_4.GetElementsByType(smesh.SMESH.VOLUME) volsToSplit = Mesh_4.GetElementsByType(SMESH.VOLUME)
print "Splitting %d hexa volume(s) to %d hexas..."%(len(volsToSplit), 6*len(volsToSplit)) print "Splitting %d hexa volume(s) to %d hexas..."%(len(volsToSplit), 6*len(volsToSplit))
pattern_pyra.ApplyToHexahedrons(Mesh_4.GetMesh(), volsToSplit,1,0) pattern_pyra.ApplyToHexahedrons(Mesh_4.GetMesh(), volsToSplit,1,0)
isDone = pattern_pyra.MakeMesh(Mesh_4.GetMesh(), True, True) isDone = pattern_pyra.MakeMesh(Mesh_4.GetMesh(), True, True)