$
&dimen -save -dimen meters m-tons
&device  -mecho n -g_default screen
&title EXAMPLE OF SEMI-SUBMERSIBLE MODELING
$
$*********************************************      control parameters
$
$ The variable DEMO is to be set to .true. if one wants to follow
$ the progress of the work on the screen
$
$
&set demo   = .false.
$
$$$$$$$$$$$$$$$$$$$$
$ MACROS
$$$$$$$$$$$$$$$$$$$$
$
   &MACRO su_show NAMES
    &SELEC :N -SEL %NAMES
    &IF %DEMO &THEN
     &DEVICE -g_default SCREEN
     &SUBTITLE %SUBT PICTURE ISO
     &PICT ISO -parent :N
     &LOCAL DUM = &GET(YES/NO )
     &IF &STRING(MATCH %DUM% YES) &THEN
     &ENDIF
     &SUBTITLE %SUBT PICTURE TOP
     &PICT TOP
     &LOCAL DUM = &GET(YES/NO )
     &IF &STRING(MATCH %DUM% YES) &THEN
     &ENDIF
     &SUBTITLE %SUBT PICTURE BOW
     &PICT BOW
     &LOCAL DUM = &GET(YES/NO )
     &IF &STRING(MATCH %DUM% YES) &THEN
     &ENDIF
     &SUBTITLE %SUBT PICTURE STARB
     &PICT STARB
     &LOCAL DUM = &GET(YES/NO )
     &IF &STRING(MATCH %DUM% YES) &THEN
     &ENDIF
    &ELSE
     &DEVICE -g_default DEVICE
     &SUBTITLE %SUBT PICTURE ISO
     &PICT ISO -parent :N
     &SUBTITLE %SUBT PICTURE TOP
     &PICT TOP
     &SUBTITLE %SUBT PICTURE BOW
     &PICT BOW
     &SUBTITLE %SUBT PICTURE STARB
     &PICT STARB
    &ENDIF
   &ENDMACRO
$
$
$$$$$$$$$$$$$$$$$$$$
$ GENERATE
$$$$$$$$$$$$$$$$$$$$
$
&surface
$
$ Defining blocks
$
$---------- Simple Column
$
 block column -location 0 0 0 2 -90 0
  plane -0.5 0.1 3.7 19.45 23.239  -circ 0 0 5.335 0 30 7
 end
$
$---------- Useful blocks
$
 block block2 -location 0 0 0 2 -90 10
  plane  -0.3  0.1 3.7 19.324  -circ 0 0 7.296  0 30 7
 end
 block block3 -location 0 0 0 2 -90 5
  plane -0.8  19.800  -circ 0 0 5  0 30 7
 end
 block block4 -location 0 -6.5  0 0 0 0
  plane -8 0 8   -rect -0.5 19.50 15
 end
$
$---------- Brace
$
 block brace -location 0 0 0 0 0 0
  plane -17 -16 0 16 17  -circ 0 0 1.385 0 30 7
 end
$
$--------------------------------------       Pontoon
$
block pontoon
 &set cur_status = 6.500 16.558-7.3 16.558 16.558+7.3 43.990-7.3 43.990 \
                 43.990+7.3 71.422-7.3 71.422 \
                 71.422+7.3 98.854-5.5 98.854 103.022
$
 plane 0          -cart    0      1.525    \
                           2.62   1.526    \
                           2.62   6.100    \
                           0      6.101
 plane 0.659      -cart    0      0.270    \
                           5.472  0.271    \
                           5.472  6.100    \
                           0      6.101
 plane 1.318      -cart    0      0.014    \
                           6.544  0.015    \
                           6.544  6.100    \
                           0      6.101
 plane 2.842      -cart    0      0.000    \
                           7.595  0.001    \
                           8.760  0.541    \
                           8.760  5.473    \
                           7.595  6.100    \
                           0      6.101
 plane %cur_stat% -cart    0      0.000    \
                           7.595  0.001    \
                           8.673  0.447    \
                           9.120  1.525    \
                           9.120  4.575    \
                           8.673  5.653    \
                           7.595  6.100    \
                           5.060  6.1003   \
                           2.530  6.1006   \
                           0      6.101
 plane 106.680    -cart    0      0.000    \
                           7.595  0.001    \
                           8.760  0.541    \
                           8.760  5.473    \
                           7.595  6.100    \
                           0      6.101
 plane 108.204    -cart    0      0.014    \
                           6.544  0.015    \
                           6.544  6.100    \
                           0      6.101
 plane 108.863    -cart    0      0.270    \
                           5.472  0.271    \
                           5.472  6.100    \
                           0      6.101
 plane 109.522    -cart    0      1.525    \
                           2.62   1.526    \
                           2.62   6.100    \
                           0      6.101
end
$
$ Generate columns with blister
$
  &set subt = CREATION OF TUBE FOR COLUMN BLISTER
 su_show block2 block3
 diff block2 block3 cyl
  &set subt = TUBE FOR BLISTER COMPLETED
 su_show cyl
 delete_block block2 block3
  &set subt = TUBE FOR BLISTER AND BLOCK TO CUT
 su_show cyl block4
 diff cyl block4 cut
  &set subt = BLISTER COMPLETED
 su_show cut
 delete_block cyl block4
  &set subt = BLISTER AND COLUMN ASSEMBLED
 su_show cut column
 union cut column col
  &set subt = COLUMN COMPLETED
 su_show col
 delete_block cut
$
$ Moving all columns and bracings in position
$
move_block col col_A  16.558 0.485 6.100 0 0 0
move_block col col_B  43.990 0.485 6.100 0 0 0
move_block col col_C  71.422 0.485 6.100 0 0 0
del col
move_block column col_D 98.854 0.485 6.100 0 0 0
delete_block column
move_block brace brace4 16.558 0 8.2 0 0 90
move_block brace brace3 43.990 0 8.1 0 0 90
move_block brace brace2 71.422 0 8.1 0 0 90
delete_block brace
$
$ Assembling the different blocks together
$
&subtitle
union col_B col_A tempo4
delete_block col_B col_A
&set subt = UNION OF COLUMNS 3 and 4
su_show tempo4
union col_C col_D tempo3
&set subt = UNION OF COLUMNS 1 and 2
su_show tempo3
delete_block col_C col_D
union tempo3 tempo4 cols
&set subt = UNION OF ALL COLUMNS
su_show cols
delete_block tempo3 tempo4
union pontoon cols element
&set subt = UNION OF COLUMNS AND ONE PONTOON
su_show element
delete_block pontoon cols
move_block element stbd 0 21.375 0 0 0 0
delete_block element
reflect_block stbd port y
&set subt = REFLECTION PORTSIDE - STARBOARD
su_show port stbd
union port stbd hull
delete_block port stbd
&set subt = END OF HULL
su_show hull
union brace4 brace3 brace
delete_block brace4 brace3
&set subt = UNION OF TRANSVERSE BRACES 4 AND 3
su_show brace
union brace brace2 braces
delete_block brace brace2
&set subt = UNION OF ALL TRANSVERSE BRACES
su_show braces
union hull braces semisub
&set subt = UNION OF TRANSVERSE BRACES AND HULL
su_show semisub
$
$ Emitting the meshing
$
rename semisub
&set subt = FINAL HULL
su_show semisub
emit semisub -part semisub
emit semisub -piece ' -diftyp 3ddif'
$
$ Finishing
$
&dimen -remember
&finish
