Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from V5_1_3_BR branch (07/12/09)
[modules/geom.git]
/
src
/
GEOM_SWIG
/
GEOM_Partition2.py
diff --git
a/src/GEOM_SWIG/GEOM_Partition2.py
b/src/GEOM_SWIG/GEOM_Partition2.py
index db8ce8ec6f8960611992fd20412909fa8acfdf5e..2f1d4730496d8c6593bf2a4a924bf5543e3f1c7d 100755
(executable)
--- a/
src/GEOM_SWIG/GEOM_Partition2.py
+++ b/
src/GEOM_SWIG/GEOM_Partition2.py
@@
-1,24
+1,40
@@
-# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
#
-# Copyright (C) 2003 CEA/DEN, EDF R&D
+# 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
+# version 2.1 of the License.
#
#
+# 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.
#
#
+# 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
#
#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
# File : GEOM_Partition2.py
# Module : GEOM
# File : GEOM_Partition2.py
# Module : GEOM
-
-#%Make geometry (like CEA script (A2)) using Partition algorithm%
# import callovo_01_GEOM
# reload(callovo_01_GEOM)
# import callovo_01_GEOM
# reload(callovo_01_GEOM)
-
-
# --------------------------------------------
# Geometrie avec une galerie perpendiculaire
# --------------------------------------------
# --------------------------------------------
# Geometrie avec une galerie perpendiculaire
# --------------------------------------------
-
+#
import geompy
geom = geompy.geom
import geompy
geom = geompy.geom
+vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
+vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
+
# -- colis
colis_xmin = 05.76
# -- colis
colis_xmin = 05.76
@@
-26,8
+42,8
@@
colis_xmax = 19.83
colis_radius = 0.3
colis = geompy.MakeCylinder(
colis_radius = 0.3
colis = geompy.MakeCylinder(
- geom
.MakePointStruct
(colis_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(colis_xmin,0.,0.),
+
vecx
,
colis_radius,
colis_xmax-colis_xmin)
colis_radius,
colis_xmax-colis_xmin)
@@
-38,8
+54,8
@@
bo_xmax = colis_xmax
bo_radius = 1.23
bo = geompy.MakeCylinder(
bo_radius = 1.23
bo = geompy.MakeCylinder(
- geom
.MakePointStruct
(bo_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(bo_xmin,0.,0.),
+
vecx
,
bo_radius,
bo_xmax-bo_xmin)
bo_radius,
bo_xmax-bo_xmin)
@@
-51,8
+67,8
@@
alvRup_xmax = colis_xmax
alvRup_radius = 1.6
alvRup = geompy.MakeCylinder(
alvRup_radius = 1.6
alvRup = geompy.MakeCylinder(
- geom
.MakePointStruct
(alvRup_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(alvRup_xmin,0.,0.),
+
vecx
,
alvRup_radius,
alvRup_xmax-alvRup_xmin)
alvRup_radius,
alvRup_xmax-alvRup_xmin)
@@
-64,8
+80,8
@@
bouchon_xmax = 22.83
bouchon_radius = alvRup_radius
bouchon = geompy.MakeCylinder(
bouchon_radius = alvRup_radius
bouchon = geompy.MakeCylinder(
- geom
.MakePointStruct
(bouchon_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(bouchon_xmin,0.,0.),
+
vecx
,
bouchon_radius,
bouchon_xmax-bouchon_xmin)
bouchon_radius,
bouchon_xmax-bouchon_xmin)
@@
-75,9
+91,11
@@
galerie_xmax = 25.0
galerie_radius = 3.0
box_y = 30.0
galerie_radius = 3.0
box_y = 30.0
+pnt_galerie_xmax = geompy.MakeVertex(galerie_xmax,0.,0.)
+
galerie = geompy.MakeCylinder(
galerie = geompy.MakeCylinder(
-
geom.MakePointStruct(galerie_xmax,0.,0.)
,
-
geom.MakeDirection(geom.MakePointStruct(0.,1.,0.))
,
+
pnt_galerie_xmax
,
+
vecy
,
galerie_radius,
box_y)
galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
galerie_radius,
box_y)
galerie = geompy.MakeTranslation(galerie, 0, -box_y/2, 0)
@@
-94,8
+112,8
@@
galRup_xmax = galerie_xmax
galRup_radius = 3.9
galRup = geompy.MakeCylinder(
galRup_radius = 3.9
galRup = geompy.MakeCylinder(
-
geom.MakePointStruct(galerie_xmax,0.,0.)
,
-
geom.MakeDirection(geom.MakePointStruct(0.,1.,0.))
,
+
pnt_galerie_xmax
,
+
vecy
,
galRup_radius,
box_y)
galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
galRup_radius,
box_y)
galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
@@
-105,11
+123,7
@@
galRup = geompy.MakeTranslation(galRup, 0, -box_y/2, 0)
galEnd_xmax = galerie_xmax
galEnd_radius = 4.6
galEnd_xmax = galerie_xmax
galEnd_radius = 4.6
-galEnd = geompy.MakeCylinder(
- geom.MakePointStruct(galerie_xmax,0.,0.),
- geom.MakeDirection(geom.MakePointStruct(0.,1.,0.)),
- galEnd_radius,
- box_y)
+galEnd = geompy.MakeCylinder(pnt_galerie_xmax, vecy, galEnd_radius, box_y)
galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
# -- endommagement alveole
galEnd = geompy.MakeTranslation(galEnd, 0, -box_y/2, 0)
# -- endommagement alveole
@@
-119,30
+133,26
@@
alvEnd_xmax = galerie_xmax
alvEnd_radius = 2.46
alvEnd = geompy.MakeCylinder(
alvEnd_radius = 2.46
alvEnd = geompy.MakeCylinder(
- geom
.MakePointStruct
(alvEnd_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(alvEnd_xmin,0.,0.),
+
vecx
,
alvEnd_radius,
alvEnd_xmax-alvEnd_xmin)
# remove internal parts of galEnd intersecting alvEnd
alvEnd_radius,
alvEnd_xmax-alvEnd_xmin)
# remove internal parts of galEnd intersecting alvEnd
-galEnd_alvEnd = geompy.Partition(
- [ alvEnd._get_Name() ] , [], [], [ galEnd._get_Name() ] )
+galEnd_alvEnd = geompy.MakePartition([alvEnd], [], [], [galEnd])
-
iorL = [ colis._get_Name()
]
-
iorL += [ bo._get_Name()
]
-
iorL += [ alvRup._get_Name()
]
-#
iorL += [ galerie._get_Name()
]
-
iorL += [ galRup._get_Name()
]
-
iorL += [ galEnd_alvEnd._get_Name()
]
+
GOList = [colis
]
+
GOList += [bo
]
+
GOList += [alvRup
]
+#
GOList += [galerie
]
+
GOList += [galRup
]
+
GOList += [galEnd_alvEnd
]
# --
# remove section parts outside bo and inside bouchon
# --
# remove section parts outside bo and inside bouchon
-callovo = geompy.Partition(
- iorL, [], [ box._get_Name() ], [galerie._get_Name(), bouchon._get_Name()] )
-
-
+callovo = geompy.MakePartition(GOList, [], [box], [galerie, bouchon])
geompy.addToStudy(callovo, "callovo perp. 2")
geompy.addToStudy(callovo, "callovo perp. 2")