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
Fix memory leaks
[modules/geom.git]
/
src
/
GEOM_SWIG
/
GEOM_Partition3.py
diff --git
a/src/GEOM_SWIG/GEOM_Partition3.py
b/src/GEOM_SWIG/GEOM_Partition3.py
index d325f848ee7875d11d016b8100e76e0fe2e46186..b0e85c9721423ea7fbbee8c60ce5e5d717d620a6 100755
(executable)
--- a/
src/GEOM_SWIG/GEOM_Partition3.py
+++ b/
src/GEOM_SWIG/GEOM_Partition3.py
@@
-1,19
+1,39
@@
-# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2015 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, or (at your option) any later version.
#
#
+# 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_Partition3.py
# Module : GEOM
# File : GEOM_Partition3.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)
+#
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
-
-import geompy
-geom = geompy.geom
+vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
# -- colis
# -- colis
@@
-22,12
+42,12
@@
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)
-
iorL = [colis._get_Name()
]
+
GOList = [colis
]
# -- bo
# -- bo
@@
-36,12
+56,12
@@
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)
-
iorL.append(bo._get_Name()
)
+
GOList.append(bo
)
# -- rupture alveole
# -- rupture alveole
@@
-50,12
+70,12
@@
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)
-
iorL.append(alvRup._get_Name()
)
+
GOList.append(alvRup
)
# bouchon
# bouchon
@@
-64,12
+84,12
@@
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)
-#
iorL.append(bouchon._get_Name()
)
+#
GOList.append(bouchon
)
# -- endommagement alveole
# -- endommagement alveole
@@
-78,12
+98,12
@@
alvEnd_xmax = 20.66
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)
alvEnd_radius,
alvEnd_xmax-alvEnd_xmin)
-
iorL.append(alvEnd._get_Name()
)
+
GOList.append(alvEnd
)
# galerie
# galerie
@@
-92,12
+112,12
@@
galerie_xmax = 25.0
galerie_radius = 2.17
galerie = geompy.MakeCylinder(
galerie_radius = 2.17
galerie = geompy.MakeCylinder(
- geom
.MakePointStruct
(galerie_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(galerie_xmin,0.,0.),
+
vecx
,
galerie_radius,
galerie_xmax-galerie_xmin)
galerie_radius,
galerie_xmax-galerie_xmin)
-
iorL.append(galerie._get_Name()
)
+
GOList.append(galerie
)
# -- rupture galerie
# -- rupture galerie
@@
-106,12
+126,12
@@
galRup_xmax = galerie_xmax
galRup_radius = 2.82
galRup = geompy.MakeCylinder(
galRup_radius = 2.82
galRup = geompy.MakeCylinder(
- geom
.MakePointStruct
(galRup_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(galRup_xmin,0.,0.),
+
vecx
,
galRup_radius,
galRup_xmax-galRup_xmin)
galRup_radius,
galRup_xmax-galRup_xmin)
-
iorL.append(galRup._get_Name()
)
+
GOList.append(galRup
)
# -- endom. galerie
# -- endom. galerie
@@
-120,12
+140,12
@@
galEnd_xmax = galerie_xmax
galEnd_radius = 4.34
galEnd = geompy.MakeCylinder(
galEnd_radius = 4.34
galEnd = geompy.MakeCylinder(
- geom
.MakePointStruct
(galEnd_xmin,0.,0.),
-
geom.MakeDirection(geom.MakePointStruct(1.,0.,0.))
,
+ geom
py.MakeVertex
(galEnd_xmin,0.,0.),
+
vecx
,
galEnd_radius,
galEnd_xmax-galEnd_xmin)
galEnd_radius,
galEnd_xmax-galEnd_xmin)
-
iorL.append(galEnd._get_Name()
)
+
GOList.append(galEnd
)
# --
# --
@@
-133,9
+153,9
@@
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)
box = geompy.MakeBox(0., 0., 0., galerie_xmax, box_y, box_y)
box = geompy.MakeTranslation(box, 0.0, -box_y/2, -box_y/2)
-
iorL.append(box._get_Name()
)
+
GOList.append(box
)
# --
# --
-callovo = geompy.
Partition(iorL,[],[], [bouchon._get_Name()
])
+callovo = geompy.
MakePartition(GOList, [], [], [bouchon
])
geompy.addToStudy(callovo, "callovo 2")
geompy.addToStudy(callovo, "callovo 2")