# Project prisms from one meshed box to another mesh on the same box
-from smesh import *
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New()
# Prepare geometry
f1 = faces[2]
f2 = faces[0]
# face opposite to f2
-f2opp = faces[1]
+f2opp = geompy.GetOppositeFace( box, f2 )
# Get vertices used to specify how to associate sides of faces at projection
[v1F1, v2F1] = geompy.SubShapeAll(f1, geompy.ShapeType["VERTEX"])[:2]
# Make the source mesh with prisms
-src_mesh = Mesh(box, "Source mesh")
+src_mesh = smesh.Mesh(box, "Source mesh")
src_mesh.Segment().NumberOfSegments(9,10)
src_mesh.Quadrangle()
src_mesh.Hexahedron()
-src_mesh.Triangle(f1) # triangular sumbesh
+src_mesh.Triangle(f1) # triangular sub-mesh
src_mesh.Compute()
-# Mesh the box using projection algoritms
+# Mesh the box using projection algorithms
# Define the same global 1D and 2D hypotheses
-tgt_mesh = Mesh(box, "Target mesh")
+tgt_mesh = smesh.Mesh(box, "Target mesh")
tgt_mesh.Segment().NumberOfSegments(9,10,UseExisting=True)
tgt_mesh.Quadrangle()
tgt_mesh.Compute()
# Move the source mesh to visualy compare the two meshes
-src_mesh.TranslateObject( src_mesh, MakeDirStruct( 210, 0, 0 ), Copy=False)
+src_mesh.TranslateObject( src_mesh, smesh.MakeDirStruct( 210, 0, 0 ), Copy=False)