surface_ineq.tcl

This example shows how to build resulting surface using inequalities on surfaces.

Here is the image of the resulting surface:

surface_ineq1

Pic 1. surface obtained from surface inequalities

surface_ineq2

Pic 2. surface obtained from surface inequalities

This result was obtained with "examples/surfit/surfs/surface_ineq.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_surface_ineq" 
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 surface from surfit datafile 
00026 surf_load "func.func" "test_func"  
00027 surf_plus_value 80 "test_func"
00028 surf_setName "test_func_geq" "test_func"
00029 
00030 # load surface from surfit datafile 
00031 surf_load "func.func" "test_func"  
00032 surf_plus_value 90 "test_func"
00033 surf_setName "test_func_leq" "test_func"
00034  
00035 # load points from text file 
00036 pnts_read "7points.txt" "7points"  
00037  
00038 ##
00039 ## construct grid 
00040 ##
00041 grid_get -10 10 0.2 -10 10 0.2 
00042  
00043 ##
00044 ## create gridding rules
00045 ##
00046 
00047 # resulting surface >= surface values 
00048 surface_geq "test_func_geq" 
00049 
00050 # resulting surface at points = points values 
00051 points "7points" 
00052 
00053 # resulting surface should tend to be constant or plane 
00054 completer 2 1  
00055 
00056 ##
00057 ## run gridding algorithm
00058 ##
00059 surfit 
00060 
00061 ##
00062 ## save results 
00063 ##
00064 
00065 # unload grid from memory
00066 grid_unload 
00067 
00068 # save surface to surfit datafile 
00069 surf_save "surface_ineq.dat" "map_surface_ineq" 



surfit: open source gridding and contouring software.