<s> import math <EOL> import salome <EOL> import collections <EOL> salome . salome_init ( ) <EOL> theStudy = salome . myStudy <EOL> from salome . geom import geomBuilder <EOL> geompy = geomBuilder . New ( theStudy ) <EOL> O = geompy . MakeVertex ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> OX = geompy . MakeVectorDXDYDZ ( <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> OY = geompy . MakeVectorDXDYDZ ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> OZ = geompy . MakeVectorDXDYDZ ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> Plane_X = geompy . MakePlane ( O , OX , <NUM_LIT:1> ) <EOL> Plane_Y = geompy . MakePlane ( O , OY , <NUM_LIT:1> ) <EOL> Plane_Z = geompy . MakePlane ( O , OZ , <NUM_LIT:1> ) <EOL> geompy . addToStudy ( O , '<STR_LIT:O>' ) <EOL> geompy . addToStudy ( OX , '<STR_LIT>' ) <EOL> geompy . addToStudy ( OY , '<STR_LIT>' ) <EOL> geompy . addToStudy ( OZ , '<STR_LIT>' ) <EOL> geompy . addToStudy ( Plane_X , '<STR_LIT>' ) <EOL> geompy . addToStudy ( Plane_Y , '<STR_LIT>' ) <EOL> geompy . addToStudy ( Plane_Z , '<STR_LIT>' ) <EOL> vertCounter = <NUM_LIT:0> <EOL> lineCounter = <NUM_LIT:0> <EOL> curveCounter = <NUM_LIT:0> <EOL> revolutionCounter = <NUM_LIT:0> <EOL> extrusionCounter = <NUM_LIT:0> <EOL> compoundCounter = <NUM_LIT:0> <EOL> mirrorCounter = <NUM_LIT:0> <EOL> shellCounter = <NUM_LIT:0> <EOL> supressHolesCounter = <NUM_LIT:0> <EOL> multiRotationCounter = <NUM_LIT:0> <EOL> v = { } <EOL> li = { } <EOL> c = { } <EOL> r = { } <EOL> e = { } <EOL> co = { } <EOL> fi = { } <EOL> mi = { } <EOL> sh = { } <EOL> sp = { } <EOL> mr = { } <EOL> zList = [ ] <EOL> xCapList = [ ] <EOL> RMAX = <NUM_LIT> <EOL> XB = <NUM_LIT> <EOL> XM = <NUM_LIT> <EOL> XA = <NUM_LIT> <EOL> XC = <NUM_LIT> <EOL> def linspace ( a , b , n = <NUM_LIT:50> ) : <EOL> '''<STR_LIT>''' <EOL> if n < <NUM_LIT:2> : <EOL> return b <EOL> diff = ( float ( b ) - a ) / ( n - <NUM_LIT:1> ) <EOL> return [ diff * i + a for i in range ( n ) ] <EOL> def createPoint ( x , y , z , showInStudy = False ) : <EOL> global vertCounter <EOL> v [ "<STR_LIT>" . format ( vertCounter ) ] = geompy . MakeVertex ( x , y , z ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( v [ "<STR_LIT>" . format ( vertCounter ) ] , '<STR_LIT>' + str ( vertCounter ) ) <EOL> vertCounter += <NUM_LIT:1> <EOL> def createLine ( obj1 , obj2 , showInStudy = False ) : <EOL> global lineCounter <EOL> li [ "<STR_LIT>" . format ( lineCounter ) ] = geompy . MakeLineTwoPnt ( v [ "<STR_LIT>" . format ( obj1 ) ] , v [ "<STR_LIT>" . format ( obj2 ) ] ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( v [ "<STR_LIT>" . format ( lineCounter ) ] , '<STR_LIT>' + str ( lineCounter ) ) <EOL> lineCounter += <NUM_LIT:1> <EOL> def createCurve ( start , end , showInStudy = False ) : <EOL> global curveCounter <EOL> vertexList = [ ] <EOL> od = collections . OrderedDict ( sorted ( v . items ( ) ) ) <EOL> for x in xrange ( start , end ) : <EOL> vertexList . append ( od [ "<STR_LIT>" . format ( x ) ] ) <EOL> c [ "<STR_LIT>" . format ( curveCounter ) ] = geompy . MakeInterpol ( vertexList , False , False ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( c [ "<STR_LIT>" . format ( curveCounter ) ] , '<STR_LIT>' + str ( curveCounter ) ) <EOL> curveCounter += <NUM_LIT:1> <EOL> def createRevolution ( curve , showInStudy = False ) : <EOL> global revolutionCounter <EOL> r [ "<STR_LIT>" . format ( revolutionCounter ) ] = geompy . MakeRevolution ( curve , OX , <NUM_LIT> * math . pi / <NUM_LIT> ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( r [ "<STR_LIT>" . format ( revolutionCounter ) ] , '<STR_LIT>' + str ( revolutionCounter ) ) <EOL> revolutionCounter += <NUM_LIT:1> <EOL> def createExtrusion ( curve , showInStudy = False ) : <EOL> global extrusionCounter <EOL> e [ "<STR_LIT>" . format ( extrusionCounter ) ] = geompy . MakePrismVecH ( curve , OY , - <NUM_LIT:1> ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( e [ "<STR_LIT>" . format ( extrusionCounter ) ] , '<STR_LIT>' + str ( extrusionCounter ) ) <EOL> extrusionCounter += <NUM_LIT:1> <EOL> def createFilling ( start , end , showInStudy = False ) : <EOL> global compoundCounter <EOL> curveList = [ ] <EOL> od = collections . OrderedDict ( sorted ( c . items ( ) ) ) <EOL> for x in xrange ( start , end ) : <EOL> curveList . append ( od [ "<STR_LIT>" . format ( x ) ] ) <EOL> co [ "<STR_LIT>" . format ( compoundCounter ) ] = geompy . MakeCompound ( curveList ) <EOL> fi [ "<STR_LIT>" . format ( compoundCounter ) ] = geompy . MakeFilling ( co [ "<STR_LIT>" . format ( compoundCounter ) ] , theMinDeg = <NUM_LIT:3> , theMaxDeg = <NUM_LIT:6> , theNbIter = <NUM_LIT:1> ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( co [ "<STR_LIT>" . format ( compoundCounter ) ] , '<STR_LIT>' + str ( compoundCounter ) ) <EOL> geompy . addToStudy ( fi [ "<STR_LIT>" . format ( compoundCounter ) ] , '<STR_LIT>' + str ( compoundCounter ) ) <EOL> compoundCounter += <NUM_LIT:1> <EOL> def createMirror ( face , showInStudy = False ) : <EOL> global mirrorCounter <EOL> mi [ "<STR_LIT>" . format ( mirrorCounter ) ] = geompy . MakeMirrorByPlane ( face , Plane_Z ) <EOL> if showInStudy == True : <EOL> geompy . addToStudy ( mi [ "<STR_LIT>" . format ( mirrorCounter ) ] , '<STR_LIT>' + str ( mirrorCounter ) ) <EOL> mirrorCounter += <NUM_LIT:1> <EOL> def createShell ( shellList , name = None , showInStudy = False ) : <EOL> global shellCounter <EOL> sh [ "<STR_LIT>" . format ( shellCounter ) ] = geompy . MakeShell ( shellList ) <EOL> if showInStudy == True : <EOL> if name != None : <EOL> geompy . addToStudy ( sh [ "<STR_LIT>" . format ( shellCounter ) ] , name ) <EOL> else : <EOL> geompy . addToStudy ( sh [ "<STR_LIT>" . format ( shellCounter ) ] , '<STR_LIT>' + str ( shellCounter ) ) <EOL> shellCounter += <NUM_LIT:1> <EOL> def createSupressHoles ( obj , name = None , showInStudy = False ) : <EOL> global supressHolesCounter <EOL> sp [ "<STR_LIT>" . format ( supressHolesCounter ) ] = geompy . SuppressHoles ( obj , [ ] ) <EOL> if showInStudy == True : <EOL> if name != None : <EOL> geompy . addToStudy ( sp [ "<STR_LIT>" . format ( supressHolesCounter ) ] , name ) <EOL> else : <EOL> geompy . addToStudy ( sp [ "<STR_LIT>" . format ( supressHolesCounter ) ] , '<STR_LIT>' + str ( supressHolesCounter ) ) <EOL> supressHolesCounter += <NUM_LIT:1> <EOL> def createMultiRotation ( obj , name = None , showInStudy = False ) : <EOL> global multiRotationCounter <EOL> mr [ "<STR_LIT>" . format ( multiRotationCounter ) ] = geompy . MultiRotate1DNbTimes ( obj , OX , <NUM_LIT:4> ) <EOL> if showInStudy == True : <EOL> if name != None : <EOL> geompy . addToStudy ( mr [ "<STR_LIT>" . format ( multiRotationCounter ) ] , name ) <EOL> else : <EOL> geompy . addToStudy ( mr [ "<STR_LIT>" . format ( multiRotationCounter ) ] , '<STR_LIT>' + str ( multiRotationCounter ) ) <EOL> multiRotationCounter += <NUM_LIT:1> <EOL> def makeBow ( ) : <EOL> listStart = vertCounter <EOL> rang = linspace ( <NUM_LIT:0> , XB ) <EOL> for x in rang : <EOL> y = RMAX * math . pow ( ( <NUM_LIT> * x * math . pow ( ( <NUM_LIT> * x - <NUM_LIT:1.> ) , <NUM_LIT:4> ) + <NUM_LIT> * math . pow ( x , <NUM_LIT:2> ) * math . pow ( ( <NUM_LIT> * x - <NUM_LIT:1.> ) , <NUM_LIT:3> ) + <NUM_LIT:1> - math . pow ( ( <NUM_LIT> * x - <NUM_LIT:1.> ) , <NUM_LIT:4> ) * ( <NUM_LIT> * x + <NUM_LIT:1.> ) ) , ( <NUM_LIT:1.> / <NUM_LIT> ) ) <EOL> createPoint ( x , y , <NUM_LIT:0> ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> createRevolution ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> def makeMiddle ( ) : <EOL> listStart = vertCounter <EOL> rang = linspace ( XB , XM ) <EOL> for x in rang : <EOL> y = RMAX <EOL> createPoint ( x , y , <NUM_LIT:0> ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> createRevolution ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> def makeAfterBody ( ) : <EOL> rh = <NUM_LIT> <EOL> k0 = <NUM_LIT:10> <EOL> k1 = <NUM_LIT> <EOL> listStart = vertCounter <EOL> rang = linspace ( XM , XA ) <EOL> for x in rang : <EOL> e = ( <NUM_LIT> - x ) / <NUM_LIT> <EOL> y = RMAX * math . pow ( ( math . pow ( rh , <NUM_LIT:2> ) + rh * k0 * math . pow ( e , <NUM_LIT:2> ) + ( <NUM_LIT:20> - <NUM_LIT:20> * math . pow ( rh , <NUM_LIT:2> ) - <NUM_LIT:4> * rh * k0 - <NUM_LIT:1.0> / <NUM_LIT> * k1 ) * math . pow ( e , <NUM_LIT:3> ) + ( - <NUM_LIT> + <NUM_LIT> * math . pow ( rh , <NUM_LIT:2> ) + <NUM_LIT:6> * rh * k0 + k1 ) * math . pow ( e , <NUM_LIT:4> ) + ( <NUM_LIT> - <NUM_LIT> * math . pow ( rh , <NUM_LIT:2> ) - <NUM_LIT:4> * rh * k0 - k1 ) * math . pow ( e , <NUM_LIT:5> ) + ( - <NUM_LIT:10> + <NUM_LIT:10> * math . pow ( rh , <NUM_LIT:2> ) + rh * k0 + ( <NUM_LIT:1.> / <NUM_LIT> ) * k1 ) * math . pow ( e , <NUM_LIT:6> ) ) , ( <NUM_LIT:1.> / <NUM_LIT> ) ) <EOL> createPoint ( x , y , <NUM_LIT:0> ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> createRevolution ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> def makeAfterBodyCap ( ) : <EOL> listStart = vertCounter <EOL> rang = linspace ( XA , XC ) <EOL> for x in rang : <EOL> try : <EOL> yint = <NUM_LIT:1.> - math . pow ( ( <NUM_LIT> * x - <NUM_LIT> ) , <NUM_LIT:2> ) <EOL> y = <NUM_LIT> * RMAX * math . pow ( yint , <NUM_LIT:0.5> ) <EOL> except : <EOL> y = <NUM_LIT:0> <EOL> createPoint ( x , y , <NUM_LIT:0> ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> createRevolution ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> def makeSailForemostbody ( ) : <EOL> Zmax = <NUM_LIT> <EOL> rang = linspace ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:10> ) <EOL> y = <NUM_LIT> <EOL> for x in rang : <EOL> D = <NUM_LIT> * ( x - <NUM_LIT> ) <EOL> C = <NUM_LIT:1> - math . pow ( ( D - <NUM_LIT:1> ) , <NUM_LIT:4> ) * ( <NUM_LIT:4> * D + <NUM_LIT:1> ) <EOL> B = <NUM_LIT:1.> / <NUM_LIT> * ( D ) ** <NUM_LIT:2> * ( D - <NUM_LIT:1> ) ** <NUM_LIT:3> <EOL> A = <NUM_LIT:2> * D * ( D - <NUM_LIT:1> ) ** <NUM_LIT:4> <EOL> z = Zmax * math . pow ( ( <NUM_LIT> * A + <NUM_LIT> * B + C ) , <NUM_LIT:0.5> ) <EOL> zList . append ( z ) <EOL> xCapList . append ( x ) <EOL> createPoint ( x , y , z ) <EOL> def makeSailForebody ( ) : <EOL> Zmax = <NUM_LIT> <EOL> rang = linspace ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:10> ) <EOL> y = <NUM_LIT> <EOL> for x in rang : <EOL> D = <NUM_LIT> * ( x - <NUM_LIT> ) <EOL> C = <NUM_LIT:1> - math . pow ( ( D - <NUM_LIT:1> ) , <NUM_LIT:4> ) * ( <NUM_LIT:4> * D + <NUM_LIT:1> ) <EOL> B = <NUM_LIT:1.> / <NUM_LIT> * ( D ) ** <NUM_LIT:2> * ( D - <NUM_LIT:1> ) ** <NUM_LIT:3> <EOL> A = <NUM_LIT:2> * D * ( D - <NUM_LIT:1> ) ** <NUM_LIT:4> <EOL> z = Zmax * math . pow ( ( <NUM_LIT> * A + <NUM_LIT> * B + C ) , <NUM_LIT:0.5> ) <EOL> if x == <NUM_LIT> : <EOL> continue <EOL> createPoint ( x , y , z ) <EOL> xCapList . append ( x ) <EOL> zList . append ( z ) <EOL> def makeSailMiddlebody ( ) : <EOL> Zmax = <NUM_LIT> <EOL> rang = linspace ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:10> ) <EOL> y = <NUM_LIT> <EOL> for x in rang : <EOL> z = Zmax <EOL> if x == <NUM_LIT> : <EOL> continue <EOL> createPoint ( x , y , z ) <EOL> xCapList . append ( x ) <EOL> zList . append ( z ) <EOL> def makeSailAfterbody ( ) : <EOL> Zmax = <NUM_LIT> <EOL> rang = linspace ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:10> ) <EOL> y = <NUM_LIT> <EOL> for x in rang : <EOL> E = ( <NUM_LIT> - x ) / <NUM_LIT> <EOL> F = E - <NUM_LIT:1> <EOL> G = <NUM_LIT> * E * F ** <NUM_LIT:4> <EOL> H = <NUM_LIT> * ( E ** <NUM_LIT:2> ) * ( F ** <NUM_LIT:3> ) <EOL> P = <NUM_LIT:1> - ( F ** <NUM_LIT:4> ) * ( <NUM_LIT:4> * E + <NUM_LIT:1> ) <EOL> z = Zmax * ( G + H + P ) <EOL> if x == <NUM_LIT> : <EOL> continue <EOL> createPoint ( x , y , z ) <EOL> xCapList . append ( x ) <EOL> zList . append ( z ) <EOL> def makeSailCap ( ) : <EOL> xlist = [ ] <EOL> ylist = [ ] <EOL> zlist = [ ] <EOL> curveListStart = curveCounter <EOL> for i , x in enumerate ( xCapList ) : <EOL> z1 = zList [ i ] <EOL> xlist . append ( x ) <EOL> yrang = linspace ( <NUM_LIT> , ( z1 / <NUM_LIT:2> ) + <NUM_LIT> , <NUM_LIT:10> ) <EOL> for y in yrang : <EOL> value = z1 ** <NUM_LIT:2> - ( <NUM_LIT:2> * ( y - <NUM_LIT> ) ) ** <NUM_LIT:2> <EOL> try : <EOL> z = math . sqrt ( value ) <EOL> except : <EOL> z = <NUM_LIT:0.> <EOL> ylist . append ( y ) <EOL> zlist . append ( z ) <EOL> for i in xrange ( <NUM_LIT:0> , <NUM_LIT:10> ) : <EOL> listStart = vertCounter <EOL> counter = i <EOL> for x in xlist : <EOL> y = ylist [ counter ] <EOL> z = zlist [ counter ] <EOL> counter += <NUM_LIT:10> <EOL> createPoint ( x , y , z ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> curveListEnd = curveCounter <EOL> createFilling ( curveListStart , curveListEnd ) <EOL> createMirror ( fi [ "<STR_LIT>" . format ( compoundCounter - <NUM_LIT:1> ) ] ) <EOL> def makeHull ( ) : <EOL> makeBow ( ) <EOL> makeMiddle ( ) <EOL> makeAfterBody ( ) <EOL> makeAfterBodyCap ( ) <EOL> createShell ( [ r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:1> ) ] , r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:2> ) ] , r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:3> ) ] , r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:4> ) ] ] , showInStudy = True , name = "<STR_LIT>" ) <EOL> def makeSail ( ) : <EOL> listStart = vertCounter <EOL> makeSailForemostbody ( ) <EOL> makeSailForebody ( ) <EOL> makeSailMiddlebody ( ) <EOL> makeSailAfterbody ( ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> createExtrusion ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> createMirror ( e [ "<STR_LIT>" . format ( extrusionCounter - <NUM_LIT:1> ) ] ) <EOL> makeSailCap ( ) <EOL> createShell ( [ e [ "<STR_LIT>" . format ( extrusionCounter - <NUM_LIT:1> ) ] , fi [ "<STR_LIT>" . format ( compoundCounter - <NUM_LIT:1> ) ] , mi [ "<STR_LIT>" . format ( mirrorCounter - <NUM_LIT:1> ) ] , mi [ "<STR_LIT>" . format ( mirrorCounter - <NUM_LIT:2> ) ] ] ) <EOL> createSupressHoles ( sh [ "<STR_LIT>" . format ( shellCounter - <NUM_LIT:1> ) ] , showInStudy = True , name = "<STR_LIT>" ) <EOL> def makeSternAppendage ( ) : <EOL> H = [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> DELR = <NUM_LIT> <EOL> RR = <NUM_LIT> <EOL> XXI = [ <NUM_LIT:0.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.> ] <EOL> for nu , h in enumerate ( H ) : <EOL> curveListStart = curveCounter <EOL> for i in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> CY = - <NUM_LIT> * RR + <NUM_LIT> <EOL> listStart = vertCounter <EOL> for j in XXI : <EOL> XXX = ( j - <NUM_LIT:1> ) * CY + h <EOL> a = <NUM_LIT> * math . sqrt ( j ) <EOL> b = <NUM_LIT> * j <EOL> c = <NUM_LIT> * j * j <EOL> d = <NUM_LIT> * j ** <NUM_LIT:3> <EOL> e = <NUM_LIT> * j ** <NUM_LIT:4> <EOL> value = a - b - c + d - e <EOL> Z = value * CY <EOL> createPoint ( XXX , RR , Z ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> RR = RR + DELR <EOL> curveListEnd = curveCounter <EOL> createFilling ( curveListStart , curveListEnd ) <EOL> createMirror ( fi [ "<STR_LIT>" . format ( compoundCounter - <NUM_LIT:1> ) ] ) <EOL> createShell ( [ fi [ "<STR_LIT>" . format ( compoundCounter - <NUM_LIT:1> ) ] , mi [ "<STR_LIT>" . format ( mirrorCounter - <NUM_LIT:1> ) ] ] ) <EOL> createSupressHoles ( sh [ "<STR_LIT>" . format ( shellCounter - <NUM_LIT:1> ) ] ) <EOL> createMultiRotation ( sp [ "<STR_LIT>" . format ( supressHolesCounter - <NUM_LIT:1> ) ] , showInStudy = True , name = "<STR_LIT>" + str ( nu + <NUM_LIT:1> ) ) <EOL> RR = <NUM_LIT> <EOL> def makeRingWing ( ) : <EOL> YC = [ <NUM_LIT:0> ] <EOL> YCP = [ <NUM_LIT:0> ] <EOL> YT = [ <NUM_LIT:0> ] <EOL> XU = [ <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> YU = [ <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> XL = [ <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> YL = [ <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> XDLE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> YDLE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> XDTE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> YDTE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> XC = [ <NUM_LIT:0.> , <NUM_LIT:0.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.> ] <EOL> B = [ <NUM_LIT:0> , <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> for i in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> X = XC [ i ] <EOL> D = <NUM_LIT> - X <EOL> E = <NUM_LIT:1.0> - X <EOL> if abs ( X - <NUM_LIT:0.0> ) < <NUM_LIT> : <EOL> X = <NUM_LIT> <EOL> if abs ( D ) < <NUM_LIT> : <EOL> D = <NUM_LIT> <EOL> if abs ( E ) < <NUM_LIT> : <EOL> E = <NUM_LIT> <EOL> ycVal1 = - <NUM_LIT> * ( <NUM_LIT:0.5> * D * D * math . log ( abs ( D ) ) - <NUM_LIT:0.5> * E * E * math . log ( E ) + <NUM_LIT> * E * E - <NUM_LIT> * D * D ) <EOL> ycVal2 = ycVal1 + <NUM_LIT> * ( X * math . log ( X ) + <NUM_LIT> - <NUM_LIT> * X ) <EOL> YC . append ( ycVal2 ) <EOL> ycpVal1 = - <NUM_LIT> * ( E * math . log ( E ) - D * math . log ( abs ( D ) ) ) + <NUM_LIT> * ( math . log ( X ) + <NUM_LIT> ) <EOL> YCP . append ( ycpVal1 ) <EOL> for i in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> X = XC [ i ] <EOL> if i >= <NUM_LIT:16> : <EOL> XC1 = <NUM_LIT:1.0> - X <EOL> yVal = <NUM_LIT> + <NUM_LIT> * XC1 - <NUM_LIT> * XC1 ** <NUM_LIT:2> - <NUM_LIT> * XC1 ** <NUM_LIT:3> + <NUM_LIT> * XC1 ** <NUM_LIT:4> <EOL> YT . append ( yVal * <NUM_LIT:0.1> ) <EOL> else : <EOL> OM = math . acos ( <NUM_LIT> * X - <NUM_LIT:1.> ) <EOL> YY = <NUM_LIT:0.> <EOL> for j in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> YY = YY + ( B [ j ] * math . sin ( j * OM ) ) <EOL> YT . append ( YY * <NUM_LIT:0.1> ) <EOL> for i in xrange ( <NUM_LIT:2> , <NUM_LIT> ) : <EOL> TH = math . atan ( YCP [ i ] ) <EOL> SINTH = math . sin ( TH ) <EOL> COSTH = math . cos ( TH ) <EOL> XU . append ( XC [ i ] - YT [ i ] * SINTH ) <EOL> YU . append ( YC [ i ] + YT [ i ] * COSTH ) <EOL> XL . append ( XC [ i ] + YT [ i ] * SINTH ) <EOL> YL . append ( YC [ i ] - YT [ i ] * COSTH ) <EOL> for k in xrange ( <NUM_LIT:0> , <NUM_LIT:2> ) : <EOL> PHI = math . atan2 ( ( YDTE [ k ] - YDLE [ k ] ) , ( XDTE [ k ] - XDLE [ k ] ) ) <EOL> CS = math . cos ( PHI ) <EOL> SN = math . sin ( PHI ) <EOL> CHORD = math . sqrt ( ( YDTE [ k ] - YDLE [ k ] ) ** <NUM_LIT:2> + ( XDTE [ k ] - XDLE [ k ] ) ** <NUM_LIT:2> ) <EOL> listStart = vertCounter <EOL> for i in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> x = XDLE [ k ] + ( CHORD * ( XU [ i ] * CS - YU [ i ] * SN ) ) <EOL> y = YDLE [ k ] + ( CHORD * ( XU [ i ] * SN + YU [ i ] * CS ) ) <EOL> createPoint ( x , y , <NUM_LIT:0> ) <EOL> lp1 = vertCounter - <NUM_LIT:1> <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> createRevolution ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> listStart = vertCounter <EOL> for i in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> x = XDLE [ k ] + ( CHORD * ( XL [ i ] * CS - YL [ i ] * SN ) ) <EOL> y = YDLE [ k ] + ( CHORD * ( XL [ i ] * SN + YL [ i ] * CS ) ) <EOL> createPoint ( x , y , <NUM_LIT:0> ) <EOL> listEnd = vertCounter <EOL> lp2 = vertCounter - <NUM_LIT:1> <EOL> createCurve ( listStart , listEnd ) <EOL> createRevolution ( c [ "<STR_LIT>" . format ( curveCounter - <NUM_LIT:1> ) ] ) <EOL> createLine ( lp1 , lp2 ) <EOL> createRevolution ( li [ "<STR_LIT>" . format ( lineCounter - <NUM_LIT:1> ) ] ) <EOL> createShell ( [ r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:1> ) ] , r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:2> ) ] , r [ "<STR_LIT>" . format ( revolutionCounter - <NUM_LIT:3> ) ] ] , showInStudy = True , name = "<STR_LIT>" + str ( k + <NUM_LIT:1> ) ) <EOL> def makeRingWingStrut ( ) : <EOL> XHLE = <NUM_LIT> <EOL> XHTE = <NUM_LIT> <EOL> YHLE = <NUM_LIT> <EOL> YHTE = <NUM_LIT> <EOL> XDLE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> YDLE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> XDTE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> YDTE = [ <NUM_LIT> , <NUM_LIT> ] <EOL> XC = [ <NUM_LIT:0.> , <NUM_LIT:0.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1.> ] <EOL> for k in xrange ( <NUM_LIT:0> , <NUM_LIT:2> ) : <EOL> R1 = YHLE <EOL> R2 = YDLE [ k ] <EOL> DELR = ( R2 - R1 ) / <NUM_LIT> <EOL> R = R2 + DELR * <NUM_LIT> <EOL> curveListStart = curveCounter <EOL> for l in xrange ( <NUM_LIT:1> , <NUM_LIT> ) : <EOL> X0 = <NUM_LIT> * R + <NUM_LIT> <EOL> listStart = vertCounter <EOL> for i in xrange ( <NUM_LIT:1> , len ( XC ) ) : <EOL> XI = XC [ i ] <EOL> x = ( X0 + <NUM_LIT> * XI ) <EOL> y = ( R - <NUM_LIT> * XI ) <EOL> z = <NUM_LIT> * ( <NUM_LIT> * math . sqrt ( XI ) - <NUM_LIT> * XI - <NUM_LIT> * XI ** <NUM_LIT:2> + <NUM_LIT> * XI ** <NUM_LIT:3> - <NUM_LIT> * XI ** <NUM_LIT:4> ) <EOL> createPoint ( x , y , z ) <EOL> listEnd = vertCounter <EOL> createCurve ( listStart , listEnd ) <EOL> R = R - DELR <EOL> curveListEnd = curveCounter <EOL> createFilling ( curveListStart , curveListEnd ) <EOL> createMirror ( fi [ "<STR_LIT>" . format ( compoundCounter - <NUM_LIT:1> ) ] ) <EOL> createShell ( [ fi [ "<STR_LIT>" . format ( compoundCounter - <NUM_LIT:1> ) ] , mi [ "<STR_LIT>" . format ( mirrorCounter - <NUM_LIT:1> ) ] ] ) <EOL> createSupressHoles ( sh [ "<STR_LIT>" . format ( shellCounter - <NUM_LIT:1> ) ] ) <EOL> createMultiRotation ( sp [ "<STR_LIT>" . format ( supressHolesCounter - <NUM_LIT:1> ) ] , showInStudy = True , name = "<STR_LIT>" + str ( k + <NUM_LIT:1> ) ) <EOL> geompy . Rotate ( mr [ "<STR_LIT>" . format ( multiRotationCounter - <NUM_LIT:1> ) ] , OX , <NUM_LIT> * math . pi / <NUM_LIT> ) <EOL> def main ( ) : <EOL> makeHull ( ) <EOL> makeSail ( ) <EOL> makeSternAppendage ( ) <EOL> makeRingWing ( ) <EOL> makeRingWingStrut ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
