Smooth surface mesh/grid

  • Follow


Using surface to create a patch grid results in a jagged surface.

[x,y]=meshgrid(-2:0.5:2,-2:0.5:2); 
z = x.^2-cos(5*x).*y.^2;
surface(x,y,z,'EdgeColor',[.8 .8 .8],'FaceColor','none')


Because I'm computing contour's and full colored surfaces I have a much finer meshgrid than above. 

[x,y]=meshgrid(-2:0.01:2,-2:0.01:2); 
z = x.^2-cos(5*x).*y.^2 + 0.3;
surf(x,y,z, 'EdgeColor', 'none'); 
alpha(0.35);
colormap(bone(512));

I would like to use the finer grid as a way to interpolate the grid lines for the grid plot so make it smoother. (or essentiallly draw every 5 to 10 grid lines on a finer grid)

If I use the finer meshgrid then I get too dense grid lines which makes it useless.

I also use hidden surface removal so I assume that the grid has to be made up of patches which have linear edges. This probably means I can't do what I want to do ;.

Any ideas?
0
Reply Jo 4/13/2010 2:24:05 AM

"Jo " <bobbyjoe23928@gmail.com> wrote in message <hq0kk5$g87$1@fred.mathworks.com>...
> Using surface to create a patch grid results in a jagged surface.
> 
> [x,y]=meshgrid(-2:0.5:2,-2:0.5:2); 
> z = x.^2-cos(5*x).*y.^2;
> surface(x,y,z,'EdgeColor',[.8 .8 .8],'FaceColor','none')
> 
> 
> Because I'm computing contour's and full colored surfaces I have a much finer meshgrid than above. 
> 
> [x,y]=meshgrid(-2:0.01:2,-2:0.01:2); 
> z = x.^2-cos(5*x).*y.^2 + 0.3;
> surf(x,y,z, 'EdgeColor', 'none'); 
> alpha(0.35);
> colormap(bone(512));
> 
> I would like to use the finer grid as a way to interpolate the grid lines for the grid plot so make it smoother. (or essentiallly draw every 5 to 10 grid lines on a finer grid)
> 
> If I use the finer meshgrid then I get too dense grid lines which makes it useless.
> 
> I also use hidden surface removal so I assume that the grid has to be made up of patches which have linear edges. This probably means I can't do what I want to do ;.
> 
> Any ideas?

not clear on what you want.. using a fine meshgrid and surf to plot results in a smooth surface...If grid lines are too dense, turn them off. Use contour to plot contour lines at an interval you specify.
John D'Errico's submission GridFit may be of use.
0
Reply James 6/17/2010 6:11:04 PM


"Jo " <bobbyjoe23928@gmail.com> wrote in message <hq0kk5$g87$1@fred.mathworks.com>...
> Using surface to create a patch grid results in a jagged surface.
> 
> [x,y]=meshgrid(-2:0.5:2,-2:0.5:2); 
> z = x.^2-cos(5*x).*y.^2;
> surface(x,y,z,'EdgeColor',[.8 .8 .8],'FaceColor','none')
> 
> 
> Because I'm computing contour's and full colored surfaces I have a much finer meshgrid than above. 
> 
> [x,y]=meshgrid(-2:0.01:2,-2:0.01:2); 
> z = x.^2-cos(5*x).*y.^2 + 0.3;
> surf(x,y,z, 'EdgeColor', 'none'); 
> alpha(0.35);
> colormap(bone(512));
> 
> I would like to use the finer grid as a way to interpolate the grid lines for the grid plot so make it smoother. (or essentiallly draw every 5 to 10 grid lines on a finer grid)
> 

Is this what you're looking for?

http://www.mathworks.com/matlabcentral/fileexchange/9315-wireframe


[x,y]=meshgrid(-2:0.01:2,-2:0.01:2); 
z = x.^2-cos(5*x).*y.^2 + 0.3;
surf(x,y,z, 'EdgeColor', 'none'); 
alpha(0.35);
colormap(bone(512));
wireframe(x,y,z,50);

-Kelly
0
Reply Kelly 6/17/2010 9:06:21 PM

2 Replies
832 Views

(page loaded in 0.044 seconds)

Similiar Articles:












7/24/2012 12:46:36 AM


Reply: