Tuesday, 15 February 2011

Hide a portion of a patch surface in MATLAB figure -



Hide a portion of a patch surface in MATLAB figure -

here problem: have matlab patch surface in 3d plot , i'd hide portion of it.

the patch created follows:

%% setting parameters alfa=1; beta=1; vth=1; %% initalize tridimensional grid [x,y,z]=meshgrid(0:1:beta+1, 0:1:beta+1, -1/alfa:0.1:beta/alfa); %% evaluate sigma, function of x,y , z sigma = (beta-y)/(vth)+lambertw(-alfa*z/(vth).*exp((y-beta)/(vth)))-... (1-x)/(vth)-lambertw(alfa*z/(vth).*exp((x-1)/(vth))); %% create patch isosurface sigma=0 patch(isosurface(x,y,z,sigma,0),'facecolor','blue','edgecolor','none'); hold on

note "lambertw" lambert w function. 1 time patch has been created, plot on 3d figure tetrahedron of given vertices:

%% tetrahedron t fv.vertices=[ 0 0 -1/alfa 0 0 beta/alfa beta+1 0 beta/alfa 0 beta+1 -1/alfa ]; fv.faces=nchoosek([1 2 3 4],3); fv.facevertexcdata=rand(4,3); fv.facecolor='interp'; grid patch(fv) view(3) alpha(0.2)

now, i'm trying obtain hiding portion of surface sigma=0 located outside tetrahedron t, plot shows t , remaining part of surface.

note tetrahedron t defined next set of coordinates:

0 <= x <= beta+1 0 <= y <= beta+1 (x-1)/alfa <= z <= (beta-y)/alfa

any help highly appreciated!

sorry mistakes in question form, first time on kind of website. please inquire farther explanation if necessary.

matlab-figure

No comments:

Post a Comment