A reserved word in surf's language is either a command or a global variable. A command is invoked mostly without parameters. Global variables are either constant or may be altered. The commands correspond to pushbuttons of surf's GUI, global variables correspond to other panel items.
res. word | type | description -------------------------------------------------------------------------- clear_screen | command | erase the image clear_pixmap | command | erase the image in memory (useful for | | real-time-animations of algebraic curves) draw_curve | command | draw the curve defined by the global | | polynomial curve draw_surface | command | draw the surfaces defined by the global | | polynomials surface, surface2, ... cut_with_plane | command | draw the hyperplane section defined | | defined by the linear polynomial plane dither_surface | command | convert color image to a dithered | | black and white image dither_curve | command | convert color image to a dithered | | black and white image (for curves only) save_color_image | command | save color image in file defined by the | | global string filename save_dithered_image | command | save dithered black and white image in | | file defined by the global string filename set_size | command | not needed any more (still there for | | compatibility issues)
res. word | type | range | default | description ------------------------------------------------------------------------- curve | poly | any | 0 | polynomial of curve surface | poly | any | 0 | polynomial of surface surface2 | poly | any | 0 | polynomial of surface2 ... | ... | ... | ... | ... surface9 | poly | any | 0 | polynomial of surface9 plane | poly | linear | 0 | equation of hyperplane width | int | {64,...,3000} | 200 | width of surface image height | int | {64,...,3000} | 200 | height of surface image filename | string | any | "" | filename used in | | | | save_color_image, | | | | save_dithered_image surf_nr | int | {1,...,9} | 1 | surface which is used | | | | for cut_with_plane
width=400; // Set image width height=300; // and height surface=x^2+y^2+z^2-81; // Set global variable surface to a sphere draw_surface; // Draw the sphere onto the screen plane=x+y+z; // Choose a hyperplane cut_with_plane; // Draw the hyperplane section filename="sphere.ras"; save_color_image; // Save the color image in file sphere.xwd dither_surface; // Perform dithering on the color image filename="sphere.ps"; save_dithered_image; // Save the dithered image in sphere.ps
res. word | type | range | def. | description ------------------------------------------------------------------------- origin_x | double | ]-9999,9999[ | 0 | \ origin_y | double | ]-9999,9999[ | 0 | > position of origin origin_z | double | ]-9999,9999[ | 0 | / spec_z | double | ]0,9999[ | 100 | spectator dist. from origin rot_x | double | ]-9999,9999[ | 0 | rotation angle of surface | | | | about the x-axis rot_y | double | ]-9999,9999[ | 0 | rotation of surface | | | | about the y-axis rot_z | double | ]-9999,9999[ | 0 | rotation of surface | | | | about the z-axis scale_x | double | ]-9999,9999[ | 1 | ratio surface is scaled in | | | | direction of the x-axis scale_y | double | ]-9999,9999[ | 1 | ratio surface is scaled in | | | | direction of the y-axis scale_z | double | ]-9999,9999[ | 1 | ratio surface is scaled in | | | | direction of the z-axis perspective | int | {0,1} | 0 | perspective to use parallel | int | 0 | 0 | constant central | int | 1 | 1 | constant first | int | {0,1,2} | 0 | first performed \ second | int | {0,1,2} | 1 | second performed > action third | int | {0,1,2} | 2 | third performed / translate | int | 0 | 0 | constant rotate | int | 1 | 1 | constant scale | int | 2 | 2 | constant
double Pi=2*arccos(0); origin_x = -3; origin_y = -4; // Set origin to point (-3,-4,2) origin_z = 2; spec_z = 25; // Spectator is now at (-3,-4,27) rot_x = Pi/2; // Rotate 90 degrees about x-axis rot_y = Pi/4; // Rotate 45 degrees about y-axis rot_z = Pi; // Rotate 180 degrees about z-axis scale_x = 1.0; // Don't scale in x-direction scale_y = 1.5; // Shrink surface in y-direction scale_z = 1/2; // Oversize surface in z-direction first = rotate; // rotate first second = scale; // then scale third = translate; // then translate
res. word | type | range | def. | description ------------------------------------------------------------------------- dither_colors | int | {yes,no} | yes | color dithering dither_steps | double | [5,...,255] | 20.0 | steps of dithering normalize | int | {yes,no} | no | normalize image normalize_factor | double | ]0,...,5] | 1.0 | multiply with antialiasing | int | {1,..,8} | 1 | level of | | | | antialiasing antialiasing_threshold | double | ]0,1[ | 0.1 | threshold antialiasing_radius | double | [0.5,...,2] | 2.0 | radius depth_cueing | int | {yes,no} | no | use depth cueing depth_value | double | [-1000,10[ | -14.0 | depth of mist stereo_eye | double | [-100,100] | 0.0 | eye distance stereo_z | double | [-30,30] | 5.0 | dist. from screen stereo_red | double | [0,1] | 1.0 | left eye red stereo_green | double | [0,1] | 0.7 | right eye green stereo_blue | double | [0,1] | 0.0 | right eye blue
dither_colors = yes; // perform color dithering dither_steps = 60.0; // use soft dithering normalize = yes; normalize_factor = 1.5; // light up image antialiasing = 4; // do 4 fold antialiasing antialiasing_threshold = 0.05; // with a low threshold antialiasing_radius = 1.5; // and a small radius depth_cueing = yes; // perform depth cueing depth_value = -11.0;// from -11 on everythin is dark stereo_eye = 5.0; // make a red-blue image stereo_z = 2.0; // object 2 units before screen stereo_red = 1.0; stereo_green = 0.0; stereo_blue = 1.0;
res. word | cat. | range | def. | description ------------------------------------------------------------------------- illumination | int | {0,..15} | 7 | illumination model ambient_light | int | 1 | 1 | constant diffuse_light | int | 2 | 2 | constant reflected_light | int | 4 | 4 | constant transmitted_light | int | 8 | 8 | constant surface_red | int | {0,...,255} | 123 | \ outside surface_green | int | {0,...,255} | 104 | > color of surface surface_blue | int | {0,...,255} | 238 | / (medium slate blue) inside_red | int | {0,...,255} | 230 | \ inside inside_green | int | {0,...,255} | 180 | > color of surface inside_blue | int | {0,...,255} | 30 | / (golden) surface2_red | int | {0,...,255} | 123 | \ outside surface2_green | int | {0,...,255} | 104 | > color of surface2 surface2_blue | int | {0,...,255} | 238 | / (medium slate blue) inside2_red | int | {0,...,255} | 230 | \ inside inside2_green | int | {0,...,255} | 180 | > color of surface2 inside2_blue | int | {0,...,255} | 30 | / (golden) ... | ... | ... | ... | ... ... | ... | ... | ... | ... ... | ... | ... | ... | ... surface9_red | int | {0,...,255} | 123 | \ outside surface9_green | int | {0,...,255} | 104 | > color of surface9 surface9_blue | int | {0,...,255} | 238 | / (medium slate blue) inside9_red | int | {0,...,255} | 230 | \ inside inside9_green | int | {0,...,255} | 180 | > color of surface9 inside9_blue | int | {0,...,255} | 30 | / (golden) ambient | int | {0,...,100} | 35 | amount of ambient light diffuse | int | {0,...,100} | 60 | diffuse reflected light reflected | int | {0,...,100} | 60 | specular reflected light transmitted | int | {0,...,100} | 60 | spec. transmitted light smoothness | int | {0,...,100} | 13 | roughness of surface transparency | int | {0,...,100} | 80 | transparency of surface ambient2 | int | {0,...,100} | 35 | amount of ambient light diffuse2 | int | {0,...,100} | 60 | diffuse reflected light reflected2 | int | {0,...,100} | 60 | specular reflected light transmitted2 | int | {0,...,100} | 60 | spec. transmitted light smoothness2 | int | {0,...,100} | 13 | roughness of surface2 transparency2 | int | {0,...,100} | 80 | transparency of surface2 ... | ... | ... | ... | ... ... | ... | ... | ... | ... ... | ... | ... | ... | ... ambient9 | int | {0,...,100} | 35 | amount of ambient light diffuse9 | int | {0,...,100} | 60 | diffuse reflected light reflected9 | int | {0,...,100} | 60 | specular reflected light transmitted9 | int | {0,...,100} | 60 | spec. transmitted light smoothness9 | int | {0,...,100} | 13 | roughness of surface9 transparency9 | int | {0,...,100} | 80 | transparency of surface9 light1_x | double | [-9999,9999] | -100 | \ light1_y | double | [-9999,9999] | 100 | \ position and volume light1_z | double | [-9999,9999] | 100 | / of the first light light1_vol | int | {0,...,100} | 50 | / source light1_red | int | {0,..,255} | 255 | \ light1_green | int | {0,..,255} | 255 | > color of first light1_blue | int | {0,..,255} | 255 | / light source light2_x | double | [-9999,9999] | 0 | \ light2_y | double | [-9999,9999] | 100 | \ position and volume light2_z | double | [-9999,9999] | 100 | / of the second light light2_vol | int | {0,...,100} | 0 | / source light2_red | int | {0,..,255} | 255 | \ light2_green | int | {0,..,255} | 255 | > color of second light2_blue | int | {0,..,255} | 255 | / light source ... | ... | ... | ... | ... ... | ... | ... | ... | ... ... | ... | ... | ... | ... light9_x | double | [-9999,9999] | 100 | \ light9_y | double | [-9999,9999] | -100 | \ position and volume light9_z | double | [-9999,9999] | 100 | / of the ninteh light light9_vol | int | {0,...,100} | 0 | / source light9_red | int | {0,..,255} | 255 | \ light9_green | int | {0,..,255} | 255 | > color of nineth light9_blue | int | {0,..,255} | 255 | / light source
illumination = ambient_light + diffuse_light + reflected_light + transmitted_light; // Select illumination surface_red = 205; surface_green = 92; surface_blue = 92; // Select indian red for surface outside inside_red = surface_red; inside_green = surface_green; inside_blue = surface_blue; // Select indian red for surface inside ambient = 10; // 40% ambient light diffuse = 60; // 60% diffuse light reflected = 60; // 60% reflected light transmitted = 70; // 60% reflected light smoothness = 50; // make surface shiny transparence = 90; // very transparent thickness = 20; // but also very thick light2_x = 100; light2_y = 0; light2_z = 200; light2_volume = 100; // turn on light no. 2 red at (100,0,200) light2_red = 255; light2_green = 0; light2_blue = 0;
reserved word | cat. | range | def. | description ------------------------------------------------------------------------- clip | int | {0,...,5} | 0 | clipping area ball | int | 0 | 0 | constant cylinder_xaxis | int | 1 | 1 | constant cylinder_yaxis | int | 2 | 2 | constant cylinder_zaxis | int | 3 | 3 | constant cube | int | 4 | 4 | constant none | int | 5 | 5 | constant clip_front | double | [-9999,9999] | 10 | \ additional clip region clip_back | double | [-9999,9999] | -10 | / radius | double | ]0,9999] | 10 | radius of clip region center_x | double | [-9999,9999] | 0 | \ center_y | double | [-9999,9999] | 0 | > center of clip region center_z | double | [-9999,9999] | 0 | /
clip = cube; radius = 7; center_x = -3; // Set clipping area to cube with center at center_y = 2; // (-3,2,1) and edge length 14 center_z = 1; clip_front = 4; // Clip off points with z > 4 clip_back = -10; // Clip off points with z > -10
reserved word | cat. | range | def. | description ------------------------------------------------------------------------- dithering_method | int | {0,...,6} | 1 | dithering method floyd_steinberg_filter | int | 0 | 0 | constant jarvis_judis_ninke_filter | int | 1 | 1 | constant stucki_filter | int | 2 | 2 | constant clustered_dot_ordered_dither | int | 3 | 3 | constant dispersed_dot_ordered_dither | int | 4 | 4 | constant dot_diffusion | int | 5 | 5 | constant smooth_dot_diffusion | int | 6 | 6 | constant
reserved word | cat. | range | def. | description ------------------------------------------------------------------------- serpentine_raster | int | {yes,no} | yes | use of serpentine raster random_weights | int | {yes,no} | yes | use of random weights weight | double | [0,1] | 0.5 | amount of random weights barons | int | {0,1} | 1 | number of barons one_baron | int | 0 | 0 | constant two_baron | int | 1 | 1 | constant pattern_size | int | {0,1,2} | 1 | size of dithering tile pattern_4x4 | int | 0 | 0 | constant pattern_8x8 | int | 1 | 1 | constant pattern_16x16 | int | 2 | 2 | constant enhance_edges | int | {yes,no} | yes | enhance edges of b w image alpha | double | [0,1] | 0.9 | filter coefficient used in | | | | for enhancing the edges background | double | [0,1] | 1.0 | background intensity of | | | | b w image tone_scale_adjustment | int | {yes,no} | yes | perform tone scale adjust. gamma | double | ]0,oo[ | 1.3 | gamma-correction pixel_size | int | ]50,100] | 73 | correction for printers | | | | that produce too fat pixels
dithering_method = stucki_filter; // select stucki filter serpentine_raster = yes; // turn on serpentine raster random_weights = yes; // turn on random weights weight = 0.5; // select 50% weights enhance_edges = yes; // turn on enhancing edges alpha = 0.8; // edges less visible than default background = 0.5; // gray background for b w image tone_scale_adjustment = yes; // perform tone scale adjustment gamma = 1.5; // more gamma-correction than default dithering_method = dispersed_dot; // select dispersed dot ordered dither pattern_size = pattern_16x16; // select a 16x16-tile dithering_method = dot_diffusion; // select dot-diffusion barons = two_barons; // select a 2-barons tile
reserved word | type | range | def. | description ------------------------------------------------------------------------- color_file_format | int | {0,1} | 1 | file format xwd | int | 0 | 0 | constant sun | int | 1 | 1 | constant color_file_colormap | int | {0,1,2} | 0 | colormap type netscape | int | 0 | 0 | constant optimized | int | 1 | 1 | constant truecolor | int | 2 | 2 | constant
color_file_format = xwd; color_file_colormap = truecolor; // format is 24 bit XWD
reserved word | type | range | def. | description ------------------------------------------------------------------------- resolution | int | {0,...,5} | 3 | (printer) resolution res_75dpi | int | 0 | 0 | constant res_100dpi | int | 1 | 1 | constant res_150dpi | int | 2 | 2 | constant res_300dpi | int | 3 | 3 | constant res_600dpi | int | 4 | 4 | constant res_1200dpi | int | 5 | 5 | constant dithered_file_format | int | {0,...,4} | 2 | file format postscript | int | 0 | 0 | constant encapsulated | int | 1 | 1 | constant xbm | int | 2 | 2 | constant tiff | int | 3 | 3 | constant bm2font | int | 4 | 4 | constant
resolution = res_300dpi; // select 300 dpi dithered_file_format = bm2font; // TeX pk
reserved word | cat. | range | def. | description --------------------------------------------------------------------------- root_finder | int | {0,...,6} | 6 | used root finder d_chain_bisection | int | 0 | 0 | constant d_chain_regula_falsi | int | 1 | 1 | constant d_chain_pegasus | int | 2 | 2 | constant d_chain_illinois | int | 3 | 3 | constant d_chain_anderson_bjoerck | int | 4 | 4 | constant d_chain_newton | int | 5 | 5 | constant bezier_all_roots | int | 6 | 6 | constant epsilon | double | ]0,1[ | 1e-4 | precision of | | | | root finder iterations | int | [1,2000] | 200 | max. number of | | | | iterations
root_finder = d_chain_bisection; // Slow, but safe epsilon = 1.0e-7; // Work very precise iterations = 80; // max. 80 iterations on each root
reserved word | type | range | def. | description --------------------------------------------------------------------------- curve_red | int | {0,...,255} | 255 | \ curve_green | int | {0,...,255} | 255 | > curve color curve_blue | int | {0,...,255} | 255 | / curve_width | double | {1,2,...} | 1 | width of curve curve_gamma | double | ]0,oo[ | 4.0 |
curve_red =0; curve_green=255; curve_blue =0; // make the curve look green curve_width=6.0; // thick curve curve_gamma=2.0; // intensity increases slower