3 \page tui_prism_3d_algo Use 3D extrusion meshing algorithm
6 import salome, smesh, SMESH, geompy
9 smesh.SetCurrentStudy( salome.myStudy )
11 OX = geompy.MakeVectorDXDYDZ(1,0,0)
12 OY = geompy.MakeVectorDXDYDZ(0,1,0)
13 OZ = geompy.MakeVectorDXDYDZ(0,0,1)
15 # Y ^ Make geometry of a "pipe" with the following base (cross section).
16 # | Big central quadrangles will be meshed with triangles, walls
17 # of the pipe will be meshed with quadrilaterals
30 # +--+--+--+--+--+--+ X
32 quadBig = geompy.MakeFaceHW( 20,20, 1 )
33 quadBig = geompy.MakeTranslation( quadBig, 15,15,0 )
34 quadSmall = geompy.MakeFaceHW( 10,10, 1 )
35 smallQuads1 = geompy.MakeMultiTranslation1D( quadSmall, OX, 10, 3 )
36 smallQuads2 = geompy.MakeMultiTranslation1D( quadSmall, OY, 10, 3 )
37 smallQuads2 = geompy.SubShapeAllSortedCentres( smallQuads2, geompy.ShapeType["FACE"])[1:]
39 base = geompy.MakeCompound( smallQuads2 + [smallQuads1, quadBig])
40 axis = geompy.MakeLine( geompy.MakeVertex( 25,25,0), OZ )
41 base = geompy.MultiRotate1DNbTimes( base, axis, 4)
42 base = geompy.MakePartition( [base], theName="base")
43 path = geompy.MakeSketcher("Sketcher:F 0 0:TT 0 100:R 0:C -90 180:T 0 -150",[0,0,0, 0,-1,0, 1,0,0])
45 # Make the pipe, each quadrangle of the base turns into a prism with composite wall faces
46 pipe = geompy.MakePipe( base, path )
47 prisms = geompy.MakePartition( [pipe], theName="prisms")
50 # get base faces of the prism to define sub-mesh on them
51 smallQuad = geompy.GetFaceNearPoint( prisms, geompy.MakeVertex( 0,0,0 ), "smallQuad")
52 bigQuad = geompy.GetFaceNearPoint( prisms, geompy.MakeVertex( 15,15,0 ), "bigQuad")
55 mesh = smesh.Mesh( prisms )
58 mesh.Segment().NumberOfSegments(15)
63 # mesh smallQuad with quadrilaterals
64 mesh.Segment(smallQuad).LocalLength( 3 )
65 mesh.Quadrangle(smallQuad)
67 # mesh bigQuad with triangles
68 mesh.Segment(bigQuad).LocalLength( 3 )
69 mesh.Triangle(bigQuad)
75 The result mesh id shown below
76 \image html prism_tui_sample.png