curve.tcl

This example shows how to build surface approximating curves with constant real numbers. Here is the image of the resulting surface:

surface from curves

Pic 1. Surface approximates curves with constant values

This result was obtained with "examples/surfit/curvs/curve.tcl" script.

00001 #
00002 # This script was generated with funner v2.1beta (www.gridding.info)
00003 
00004 # 
00005 # load plugins
00006 # 
00007 load libsurfit[info sharedlibextension]
00008 
00009 # remove all previous data and gridding rules
00010 clear_data 
00011 
00012 # set name of surface
00013 set map_name "map_curve" 
00014 
00015 # set solver
00016 set_solver "cg" 
00017 
00018 # set tolerance for solver
00019 set tol 1e-005 
00020 
00021 ##
00022 ## load initial data 
00023 ##
00024  
00025 # load curve from text file 
00026 curv_read "iso1.xy" "iso1"  
00027  
00028 # load curve from text file 
00029 curv_read "iso2.xy" "iso2"  
00030  
00031 # load curve from text file 
00032 curv_read "iso3.xy" "iso3"  
00033  
00034 # load curve from text file 
00035 curv_read "iso4.xy" "iso4"  
00036  
00037 ##
00038 ## construct grid 
00039 ##
00040 grid 10 10 
00041  
00042 ##
00043 ## create gridding rules
00044 ##
00045 
00046 # resulting surface at curve = value... 
00047 curve 10 "iso1"  
00048 
00049 # resulting surface at curve = value... 
00050 curve 50 "iso3"  
00051 
00052 # resulting surface at curve = value... 
00053 curve 30 "iso4"  
00054 
00055 # resulting surface should tend to be constant or plane 
00056 completer 1 1.6  
00057 
00058 # resulting add "surface at curve = value..." with weight 
00059 curve_add 40 0.5 "iso2"  
00060 
00061 ##
00062 ## run gridding algorithm
00063 ##
00064 surfit 
00065 
00066 ##
00067 ## save results 
00068 ##
00069 
00070 # unload grid from memory
00071 grid_unload 
00072 
00073 # save surface to surfit datafile 
00074 surf_save "curve.dat" "map_curve"



surfit: open source gridding and contouring software.