Sunday, 15 August 2010

How to visualize the intersection of surfaces under gnuplot -



How to visualize the intersection of surfaces under gnuplot -

is possible visualize intersection of multiple surfaces gnuplot:

set parametric set hidden3d set samples 25 set isosamples 25 splot u,v,0 replot u,0,v

the 2 surfaces trying plot in illustration 2 planes. how can visualize intersection of these 2 planes ?

numerically, can done setting samples , defining corresponding restriction interval. example, imagine want plot planes in intervals x = [-1:1], y = [-1:1] , z = [-1:1], , utilize 101 samples in each direction:

set parametric ; set hidden3d set isosamples 101 set xrange [-1:1] set yrange [-1:1] set zrange [-1:1] splot u,v,0, u,0,v

now, each of 101 samples corresponds interval has width (1 - (-1))/(101-1) = 0.02. if constrain distance between planes below half threshold plotting points, abs(u-u) < 0.01, abs(v-0) < 0.01 , abs(0-v) < 0.01 1 point sampled every interval along every direction:

set parametric ; set hidden3d set isosamples 101 set xrange [-1:1] set yrange [-1:1] set zrange [-1:1] splot (abs(u-u) < 0.01 ? u : 1/0), \ (abs(v-0.) < 0.01 ? v : 1/0), \ (abs(v-0.) < 0.01 ? 0 : 1/0)

where ? : 1/0 means if status before ? satisfied plot something else ignore point, have intersection:

gnuplot intersection

No comments:

Post a Comment