# -*- coding: iso-8859-1 -*-

###
### This file is generated automatically by SALOME v6.6.0 with dump python functionality
###

import sys
import salome

salome.salome_init()
theStudy = salome.myStudy

###
### GEOM component
###

import GEOM
import geompy
import math
import SALOMEDS


geompy.init_geom(theStudy)

Sphere_1           = geompy.MakeSphereR(100)
[Face_1]           = geompy.ExtractShapes(Sphere_1, geompy.ShapeType["FACE"], True)
Box_1              = geompy.MakeBoxDXDYDZ(400, 400, 400)
geompy.TranslateDXDYDZ(Box_1, 0, -150, -150)
Cut_1              = geompy.MakeCut(Face_1, Box_1)
Divided_Cylinder_1 = geompy.MakeDividedCylinder(100, 300, GEOM.SQUARE)
Vector_1           = geompy.MakeVectorDXDYDZ(0, 200, 0)
geompy.Rotate(Divided_Cylinder_1, Vector_1, -90*math.pi/180.0)
Partition_1        = geompy.MakePartition([Cut_1], [Divided_Cylinder_1], Limit=geompy.ShapeType["FACE"])

geompy.addToStudy( Sphere_1, 'Sphere_1' )
geompy.addToStudyInFather( Sphere_1, Face_1, 'Face_1' )
geompy.addToStudy( Box_1, 'Box_1' )
geompy.addToStudy( Cut_1, 'Cut_1' )
geompy.addToStudy( Divided_Cylinder_1, 'Divided Cylinder_1' )
geompy.addToStudy( Vector_1, 'Vector_1' )
geompy.addToStudy( Partition_1, 'Partition_1' )

###
### SMESH component
###

import smesh, SMESH, SALOMEDS

smesh.SetCurrentStudy(theStudy)

Mesh_1 = smesh.Mesh(Partition_1)
Regular_1D_1_1 = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D_1_1.NumberOfSegments(15)
Quadrangle_2D_3_4 = Mesh_1.Quadrangle(algo=smesh.QUADRANGLE)
isDone = Mesh_1.Compute()

if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser(1)
