# -*- coding: iso-8859-1 -*-
__revision__ = "V1.1"
#
import sys
import salome
salome.salome_init()
theStudy = salome.myStudy
import os
###
### GEOM component
###
import GEOM
import geompy
import math
import SALOMEDS
geompy.init_geom(theStudy)
debug = 0
#
#=======================================================
# Le repere
#=======================================================
#
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
#
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
#
#=======================================================
# profil
#=======================================================
#
print 'Creation du profil'
# Le profil generique
l_profil = []
S_0_0 = geompy.MakeVertex(0.0, 10.2792320311, 23.0)
l_profil.append( S_0_0 )
S_0_1 = geompy.MakeVertex(0.0, 9.87923203105, 22.9)
l_profil.append( S_0_1 )
S_0_2 = geompy.MakeVertex(0.0, 9.67923203105, 22.4)
l_profil.append( S_0_2 )
S_0_3 = geompy.MakeVertex(0.0, 8.87923203105, 22.3)
l_profil.append( S_0_3 )
S_0_4 = geompy.MakeVertex(0.0, 6.67923203105, 22.3)
l_profil.append( S_0_4 )
S_0_5 = geompy.MakeVertex(0.0, 6.07923203105, 22.8)
l_profil.append( S_0_5 )
S_0_6 = geompy.MakeVertex(0.0, 5.47923203105, 23.0)
l_profil.append( S_0_6 )
#
profil = geompy.MakePolyline(l_profil, False)
#
#=======================================================
# Creation de l'axe hydraulique
#=======================================================
#
print 'Creation de l axe hydraulique'
l_AXE = []
S_AXE_0 = geompy.MakeVertex(0.0, 7.87923203105, 23.0)
l_AXE.append( S_AXE_0 )
S_AXE_1 = geompy.MakeVertex(2.5, 7.87923203105, 22.9)
l_AXE.append( S_AXE_1 )
S_AXE_2 = geompy.MakeVertex(4.99048674523, 7.66134267418, 22.8)
l_AXE.append( S_AXE_2 )
S_AXE_3 = geompy.MakeVertex(7.40530131095, 7.01429506142, 22.7)
l_AXE.append( S_AXE_3 )
S_AXE_4 = geompy.MakeVertex(9.57036482041, 5.76429506142, 22.6)
l_AXE.append( S_AXE_4 )
S_AXE_5 = geompy.MakeVertex(11.1773338446, 3.84918395363, 22.5)
l_AXE.append( S_AXE_5 )
S_AXE_6 = geompy.MakeVertex(12.4273338446, 1.68412044417, 22.4)
l_AXE.append( S_AXE_6 )
S_AXE_7 = geompy.MakeVertex(14.5923973541, 0.43412044417, 22.3)
l_AXE.append( S_AXE_7 )
S_AXE_8 = geompy.MakeVertex(17.0544167366, 0.0, 22.2)
l_AXE.append( S_AXE_8 )
S_AXE_9 = geompy.MakeVertex(19.5164361192, 0.43412044417, 22.1)
l_AXE.append( S_AXE_9 )
S_AXE_10 = geompy.MakeVertex(21.7822055867, 1.49066609852, 22.0)
l_AXE.append( S_AXE_10 )
S_AXE_11 = geompy.MakeVertex(23.6973166945, 3.09763512273, 21.9)
l_AXE.append( S_AXE_11 )
S_AXE_12 = geompy.MakeVertex(25.3042857188, 5.01274623053, 21.8)
l_AXE.append( S_AXE_12 )
S_AXE_13 = geompy.MakeVertex(26.3608313731, 7.27851569812, 21.7)
l_AXE.append( S_AXE_13 )
S_AXE_14 = geompy.MakeVertex(26.7949518173, 9.74053508065, 21.6)
l_AXE.append( S_AXE_14 )
#
AXE = geompy.MakeInterpol(l_AXE, False, False)
#
geompy.addToStudy( profil, 'profil' )
geompy.addToStudyInFather( profil, S_0_0, 'S_0_0' )
geompy.addToStudyInFather( profil, S_0_1, 'S_0_1' )
geompy.addToStudyInFather( profil, S_0_2, 'S_0_2' )
geompy.addToStudyInFather( profil, S_0_3, 'S_0_3' )
geompy.addToStudyInFather( profil, S_0_4, 'S_0_4' )
geompy.addToStudyInFather( profil, S_0_5, 'S_0_5' )
geompy.addToStudyInFather( profil, S_0_6, 'S_0_6' )
#
geompy.addToStudy( AXE, 'AXE' )
geompy.addToStudyInFather( AXE, S_AXE_0, 'S_AXE_0' )
geompy.addToStudyInFather( AXE, S_AXE_1, 'S_AXE_1' )
geompy.addToStudyInFather( AXE, S_AXE_2, 'S_AXE_2' )
geompy.addToStudyInFather( AXE, S_AXE_3, 'S_AXE_3' )
geompy.addToStudyInFather( AXE, S_AXE_4, 'S_AXE_4' )
geompy.addToStudyInFather( AXE, S_AXE_5, 'S_AXE_5' )
geompy.addToStudyInFather( AXE, S_AXE_6, 'S_AXE_6' )
geompy.addToStudyInFather( AXE, S_AXE_7, 'S_AXE_7' )
geompy.addToStudyInFather( AXE, S_AXE_8, 'S_AXE_8' )
geompy.addToStudyInFather( AXE, S_AXE_9, 'S_AXE_9' )
geompy.addToStudyInFather( AXE, S_AXE_10, 'S_AXE_10' )
geompy.addToStudyInFather( AXE, S_AXE_11, 'S_AXE_11' )
geompy.addToStudyInFather( AXE, S_AXE_12, 'S_AXE_12' )
geompy.addToStudyInFather( AXE, S_AXE_13, 'S_AXE_13' )
geompy.addToStudyInFather( AXE, S_AXE_14, 'S_AXE_14' )
#
#=======================================================
# Extrusion des sommets exterieurs du profil
#=======================================================
#
print 'Extrusion des sommets exterieurs du profil'
#
RIVE_GAUCHE = geompy.MakePipe(S_0_0, AXE)
geompy.addToStudy( RIVE_GAUCHE, 'RIVE_GAUCHE' )
RIVE_DROITE = geompy.MakePipe(S_0_6, AXE)
geompy.addToStudy( RIVE_DROITE, 'RIVE_DROITE' )
#
#
#=======================================================
# Creation de la surface du fonds
#=======================================================
#
print 'Creation de la surface du fonds'
#
fonds = geompy.MakePipe(profil, AXE)
geompy.addToStudy( fonds, 'fonds' )
#
