<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> __all__ = [ '<STR_LIT>' ] <EOL> def cylinder ( width , nangles ) : <EOL> """<STR_LIT>""" <EOL> scale = width / <NUM_LIT> <EOL> angles = np . linspace ( <NUM_LIT:0> , <NUM_LIT:2> * np . pi , nangles ) <EOL> xyz = list ( ) <EOL> map_2dgrid_to_ptdx = np . arange ( nangles * width ) . reshape ( ( nangles , width ) ) <EOL> for a in angles : <EOL> for y in np . arange ( width ) : <EOL> xyz . append ( [ np . cos ( a ) * scale , y , np . sin ( a ) * scale ] ) <EOL> xyz = np . array ( xyz ) <EOL> tri = list ( ) <EOL> for i in xrange ( nangles ) : <EOL> for j in xrange ( width ) : <EOL> if ( j + <NUM_LIT:1> < width ) : <EOL> tri . append ( [ map_2dgrid_to_ptdx [ i , j ] , <EOL> map_2dgrid_to_ptdx [ i , j + <NUM_LIT:1> ] , <EOL> map_2dgrid_to_ptdx [ ( i + <NUM_LIT:1> ) % nangles , j + <NUM_LIT:1> ] ] ) <EOL> if ( j + <NUM_LIT:1> < width ) : <EOL> tri . append ( [ map_2dgrid_to_ptdx [ i , j ] , <EOL> map_2dgrid_to_ptdx [ i - <NUM_LIT:1> , j ] , <EOL> map_2dgrid_to_ptdx [ i , j + <NUM_LIT:1> ] ] ) <EOL> tri = np . array ( tri ) <EOL> return xyz , tri </s>
