Cylinders and Pipes Construction

Cylinder

Simple Cylinder

To make a simple cylinder grid in python mode, the following data are required:

  • nbR : number of hexahedra on radial.

  • nbA : number of hexahedra along the perimeter of the cylinder.

  • nbH : number of hexahedra along the axis of the cylinder.

Use the function makeCyinderTop:

elts = doc.makeCylinderTop(nbR, nbA, nbH)

GUI command: Simple Cylinder

Uniform Cylinder

The following data are required:

  • origin : origin’s coordinates of the cylinder (select a vertex).

  • vx : the base of the cylinder (select a vector).

  • vz : the axis of the cylinder (select a vector).

  • rint : the radius of the hole in the cylinder .

  • rext : the radius of the cylinder.

  • angle : angle of the cylinder around the Z axis.

  • hauteur: the height of the cylinder.

  • nbR : number of hexahedra on radial.

  • nbA : number of hexahedra along the perimeter of the cylinder.

  • nbH : number of hexahedra along the axis of the cylinder.

Use the function makeCylinderUni to make a uniform cylinder:

elts = doc.makeCylinderUni(origin, vx, vz, rint, rext, angle, hauteur, nbR, nbA, nbH)

GUI command: Uniform Cylinder

Custom Cylinder

The following data are required:

  • origin : origin’s coordinates of the cylinder (select a vertex).

  • vx : the base of the cylinder (select a vector).

  • vz : the axis of the cylinder (select a vector).

  • tr : a list of radiuses in ascendant order.

  • ta : a list of angles in ascendant order.

  • th : a list of heights in ascendant order.

Use the function makeCylinder to make a custom cylinder:

elts = doc.makeCylinder(origin, vx, vz, tr, ta, th)

GUI command: Custom Cylinder

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Make Cylinder Test ########## 
22
23import hexablock
24
25
26# Simple Cylinder -----
27
28doc  = hexablock.addDocument ("Make Cylinder Test")
29
30nbR = 8
31nbA = 10
32nbH = 8
33
34cylinder0 = doc.makeCylinderTop (nbR, nbA, nbH)
35cylinder0.saveVtk ("makeCylinderTop.vtk")
36   
37# Uniform Cylinder -----
38
39origin = doc.addVertex (0, 0, 5)
40vx     = doc.addVector (1, 0, 0)
41vz     = doc.addVector (0, 0, 1)
42rint   = 2
43rext   = 4
44angle  = 300
45hauteur = 1
46
47
48cylinder1 = doc.makeCylinderUni (origin, vx, vz, rint, rext, angle, hauteur, nbR, nbA, nbH)
49cylinder1.saveVtk ("makeCylinderUni.vtk")
50
51# Custom Cylinder
52
53origin = doc.addVertex (5, 0, 0)
54tr = [10, 20, 30, 40]
55ta = [45, 90, 135, 180, 225]
56th = [5, 30, 40, 60]
57
58cylinder2 = doc.makeCylinder(origin, vx, vz, tr, ta, th)
59cylinder2.saveVtk("makeCylinder.vtk")

Make Cylinders

To make two cylinders in T shape the following data are required for each cylinder:

  • orig : the origin of the cylinder (select a vertex).

  • vz : the axis of the cylinder (select a vector).

  • rext : the radius of the cylinder.

  • h : the height of the cylinder.

One of the two cylinders must be bigger than the other.

Use the function makeCylinders:

elts = doc.makeCylinders (orig1, vz1, rext1, h1, orig2, vz2, rext2, h2)

GUI command: Cylinders

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Make Cylinders Test ########## 
22
23import hexablock
24import math
25
26    
27doc  = hexablock.addDocument ("Make Cylinders Test")
28
29rext1 =  2*math.sqrt (2.0)
30rext2 =  3*math.sqrt (2.0)
31h1   =  16
32h2   =  16
33xl1  =  -8
34
35orig1  = doc.addVertex ( 0, 0,  xl1)
36orig2  = doc.addVertex (-8, 0,  0)
37vz1   = doc.addVector ( 0, 0,  1)
38vz2   = doc.addVector ( 1, 0,  0)
39   
40cylinders = doc.makeCylinders (orig1, vz1, rext1, h1, orig2, vz2, rext2, h2)
41cylinders.saveVtk("makeCylinders.vtk")

Pipe

Simple Pipe

To make a simple pipe grid in python mode, the following data are required:

  • nbR : number of hexahedra on radial.

  • nbA : number of hexahedra along the perimeter of the pipe.

  • nbH : number of hexahedra along the axis of the pipe.

Use the function makePipeTop:

elts = doc.makePipeTop(nbR, nbA, nbH)

GUI command: Simple Pipe

Uniform Pipe

The following data are required:

  • origin : the origin’s coordinates of the pipe (select a vertex).

  • vx : the base of the pipe (select a vector).

  • vz : the axis of the pipe (select a vector).

  • rint : the radius of the hole in the pipe .

  • rext : the radius of the pipe.

  • angle : angle of the pipe around the Z axis.

  • hauteur: the height of the pipe.

  • nbR : number of hexahedra on radial.

  • nbA : number of hexahedra along the perimeter of the pipe.

  • nbH : number of hexahedra along the axis of the pipe.

Use the function makePipeUni to make a uniform pipe:

elts = doc.makePipeUni(origin, vx, vz, rint, rext, angle, hauteur, nbR, nbA, nbH)

GUI command: Uniform Pipe

Custom Pipe

The following data are required:

  • origin : origin’s coordinates of the pipe (select a vertex).

  • vx : the base of the pipe (select a vector).

  • vz : the axis of the pipe (select a vector).

  • tr : a list of radiuses in ascendant order.

  • ta : a list of angles in ascendant order.

  • th : a list of heights in ascendant order.

Use the function makePipe to make a custom pipe:

elts = doc.makePipe(origin, vx, vz, tr, ta, th)

GUI command: Custom Pipe

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Make Pipe Test ########## 
22
23import hexablock
24        
25doc  = hexablock.addDocument ("Make Pipe Test")
26
27# Simple Pipe -----
28
29nbR = 8
30nbA = 10
31nbH = 8
32
33pipe0 = doc.makePipeTop (nbR, nbA, nbH)
34pipe0.saveVtk ("makePipeTop.vtk")
35
36# Uniform Pipe -----
37
38orig = doc.addVertex (0, 0, 0)
39vx   = doc.addVector (1, 0, 0)
40vz   = doc.addVector (0, 0, 1)
41rint = 1
42rext = 3
43angle = 360
44hauteur = 2
45
46pipe1 = doc.makePipeUni (orig, vx, vz, rint, rext, angle, hauteur, nbR, nbA, nbH)
47pipe1.saveVtk ("makePipeUni.vtk");
48   
49
50# Custom Pipe -----
51
52origin = doc.addVertex (0, 5, 0)
53tr = [10, 20, 30, 40]
54ta = [45, 90, 135, 180, 225]
55th = [5, 30, 40, 60]
56
57pipe2 = doc.makePipe(origin, vx, vz, tr, ta, th)
58pipe2.saveVtk("makePipe.vtk")

Make Pipes

To make two pipes in T shape the following data are required for each pipe:

  • orig : the origin of the pipe (select a vertex).

  • vz : the axis of the pipe (select a vector).

  • rint : the internal radius of the pipe.

  • rext : the radius of the pipe.

  • h : the height of the pipe.

One of the two pipes must be bigger than the other.

Use the function makepipes:

elts = doc.makePipes(orig1, vz1, rint1, rext1, h1, orig2, vz2, rint2, rext2, h2)

GUI command: Pipes

Operations on elts: Elements

Example

 1# -*- coding: utf-8 -*-
 2# Copyright (C) 2009-2026  CEA, EDF
 3#
 4# This library is free software; you can redistribute it and/or
 5# modify it under the terms of the GNU Lesser General Public
 6# License as published by the Free Software Foundation; either
 7# version 2.1 of the License, or (at your option) any later version.
 8#
 9# This library is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public
15# License along with this library; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17#
18# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19#
20
21####### Make Pipes Test ########## 
22
23import hexablock
24import math
25
26    
27doc  = hexablock.addDocument ("Make Pipes Test")
28
29rext1 =  2*math.sqrt (2.0)
30rext2 =  3*math.sqrt (2.0)
31rint1 =  rext1/2
32rint2 =  rext1
33h1   =  16
34h2   =  16
35xl1  =  -8
36
37orig1  = doc.addVertex ( 0, 0,  xl1)
38orig2  = doc.addVertex (-8, 0,  0)
39vz1   = doc.addVector ( 0, 0,  1)
40vz2   = doc.addVector ( 1, 0,  0)
41   
42pipes = doc.makePipes (orig1, vz1, rint1, rext1, h1, orig2, vz2, rint2, rext2, h2);
43pipes.saveVtk("makePipes.vtk")