2 # -*- coding: iso-8859-1 -*-
3 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
5 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
6 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 # =======================================
33 # A small cube centered and put on a great cube build with partition
52 v_1 = MakeVertex(g_ox , g_oy , g_oz )
53 v_2 = MakeVertex(g_ox+v_arete3, g_oy+g_arete , g_oz+v_arete3)
55 v_3 = MakeVertex(g_ox+g_arete , g_oy+g_arete , g_oz+g_arete )
56 v_4 = MakeVertex(g_ox+v_arete2, g_oy+v_arete2, g_oz+v_arete2)
61 s_base = MakeBoxTwoPnt(v_1, v_2)
62 s_haut = MakeBoxTwoPnt(v_3, v_4)
67 p_dir1 = MakeVectorDXDYDZ(1, 0, 0)
68 p_dir2 = MakeVectorDXDYDZ(0, 0, 1)
69 p_dir3 = MakeVectorDXDYDZ(0, 1, 0)
73 p_tools.append(MakePlane(v_3, p_dir1, g_trim))
74 p_tools.append(MakePlane(v_4, p_dir1, g_trim))
75 p_tools.append(MakePlane(v_3, p_dir2, g_trim))
76 p_tools.append(MakePlane(v_4, p_dir2, g_trim))
77 p_tools.append(MakePlane(v_3, p_dir3, g_trim))
79 piece = MakePartition([s_base, s_haut], p_tools, [], [], ShapeType["SOLID"])
84 piece_id = addToStudy(piece, "ex03_cube2partition")
89 # Create hexahedrical mesh on piece
90 # ---------------------------------
92 hexa = smesh.Mesh(piece, "ex03_cube2partition:hexa")
95 algo.NumberOfSegments(5)