Salome HOME
Check result of Compute() in test and examples
[modules/smesh.git] / doc / examples / defining_hypotheses_ex10.py
index 0a1b3d85c8b230a7c3cedaf2495b7bbc8e7f75d7..92e0f1163f11b8349436987ec771288f83d79362 100644 (file)
@@ -47,7 +47,7 @@ src_mesh.Segment().NumberOfSegments(9,10)
 src_mesh.Quadrangle()
 src_mesh.Hexahedron()
 src_mesh.Triangle(f1) # triangular sub-mesh
-src_mesh.Compute()
+if not src_mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Mesh the box using projection algorithms
 
@@ -75,7 +75,7 @@ proj2D.SourceFace( f2 )
 # 3D hypotheses to project prisms from the source to the target mesh
 proj3D = tgt_mesh.Projection3D()
 proj3D.SourceShape3D( box, src_mesh, v1F1, v1F2, v2F1, v2F2 )
-tgt_mesh.Compute()
+if not tgt_mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Move the source mesh to visually compare the two meshes
 src_mesh.TranslateObject( src_mesh, smesh_builder.MakeDirStruct( 210, 0, 0 ), Copy=False)