geom/src/GEOM_SWIG/GEOM_Partition3.py

162 lines
3.4 KiB
Python
Raw Normal View History

2012-08-09 13:58:02 +06:00
# -*- coding: iso-8859-1 -*-
2014-02-18 12:44:41 +06:00
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
2009-02-13 17:16:39 +05:00
#
2012-08-09 13:58:02 +06:00
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
2012-08-09 13:58:02 +06:00
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
2014-02-18 12:44:41 +06:00
# version 2.1 of the License, or (at your option) any later version.
2003-07-09 20:33:44 +06:00
#
2012-08-09 13:58:02 +06:00
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
2003-07-09 20:33:44 +06:00
#
2012-08-09 13:58:02 +06:00
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2003-07-09 20:33:44 +06:00
#
2012-08-09 13:58:02 +06:00
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
2012-08-09 13:58:02 +06:00
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
2003-07-09 20:33:44 +06:00
# File : GEOM_Partition3.py
# Module : GEOM
2003-05-12 21:24:23 +06:00
# import callovo_01_GEOM
# reload(callovo_01_GEOM)
2009-02-13 17:16:39 +05:00
#
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
2003-05-12 21:24:23 +06:00
2004-12-01 15:39:14 +05:00
vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
2003-05-12 21:24:23 +06:00
# -- colis
colis_xmin = 05.76
colis_xmax = 19.83
colis_radius = 0.3
colis = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(colis_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
colis_radius,
colis_xmax-colis_xmin)
2004-12-01 15:39:14 +05:00
GOList = [colis]
2003-05-12 21:24:23 +06:00
# -- bo
bo_xmin = 04.83
bo_xmax = colis_xmax
bo_radius = 1.23
bo = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(bo_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
bo_radius,
bo_xmax-bo_xmin)
2004-12-01 15:39:14 +05:00
GOList.append(bo)
2003-05-12 21:24:23 +06:00
# -- rupture alveole
alvRup_xmin = 04.46
alvRup_xmax = colis_xmax
alvRup_radius = 1.6
alvRup = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(alvRup_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
alvRup_radius,
alvRup_xmax-alvRup_xmin)
2004-12-01 15:39:14 +05:00
GOList.append(alvRup)
2003-05-12 21:24:23 +06:00
# bouchon
bouchon_xmin = colis_xmax
bouchon_xmax = 22.83
bouchon_radius = alvRup_radius
bouchon = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(bouchon_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
bouchon_radius,
bouchon_xmax-bouchon_xmin)
2004-12-01 15:39:14 +05:00
#GOList.append(bouchon)
2003-05-12 21:24:23 +06:00
# -- endommagement alveole
alvEnd_xmin = 03.6
alvEnd_xmax = 20.66
alvEnd_radius = 2.46
alvEnd = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(alvEnd_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
alvEnd_radius,
alvEnd_xmax-alvEnd_xmin)
2004-12-01 15:39:14 +05:00
GOList.append(alvEnd)
2003-05-12 21:24:23 +06:00
# galerie
galerie_xmin = bouchon_xmax
galerie_xmax = 25.0
galerie_radius = 2.17
galerie = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(galerie_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
galerie_radius,
galerie_xmax-galerie_xmin)
2004-12-01 15:39:14 +05:00
GOList.append(galerie)
2003-05-12 21:24:23 +06:00
# -- rupture galerie
galRup_xmin = 22.18
galRup_xmax = galerie_xmax
galRup_radius = 2.82
galRup = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(galRup_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
galRup_radius,
galRup_xmax-galRup_xmin)
2004-12-01 15:39:14 +05:00
GOList.append(galRup)
2003-05-12 21:24:23 +06:00
# -- endom. galerie
galEnd_xmin = alvEnd_xmax
galEnd_xmax = galerie_xmax
galEnd_radius = 4.34
galEnd = geompy.MakeCylinder(
2004-12-01 15:39:14 +05:00
geompy.MakeVertex(galEnd_xmin,0.,0.),
vecx,
2003-05-12 21:24:23 +06:00
galEnd_radius,
galEnd_xmax-galEnd_xmin)
2004-12-01 15:39:14 +05:00
GOList.append(galEnd)
2003-05-12 21:24:23 +06:00
# --
box_y = 30.0
box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
2004-12-01 15:39:14 +05:00
GOList.append(box)
2003-05-12 21:24:23 +06:00
# --
2004-12-01 15:39:14 +05:00
callovo = geompy.MakePartition(GOList, [], [], [bouchon])
2003-05-12 21:24:23 +06:00
geompy.addToStudy(callovo, "callovo 2")