Code covered by the BSD License  

Highlights from
wireframe

4.0

4.0 | 5 ratings Rate this file 9 Downloads (last 30 days) File Size: 2.19 KB File ID: #9315
image thumbnail

wireframe

by Daniel Ennis

 

08 Dec 2005 (Updated 13 Dec 2005)

This function plots a sub-sampled wireframe of a surface.

| Watch this File

File Information
Description

This function generates undersampling of the mesh lines from the matrices usually passed to the SURF command. Highly resolved surfaces drawings often look better than there low resolution counterparts, but the high density of mesh lines can obscure surface details. Undersampling of the mesh lines can indicate important contour features, but must be done properly. The undersampling has to be performed carefully so that the mesh lines still track the surface features, something that is not obtained by simply rendering a lower resolution wireframe.

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
10 Dec 2005 John D'Errico

Its not a bad idea to undersample the gridlines. Large
plots can be totally obscured by the gridlines. From the
description I was hoping to see an intelligent agent that
would adaptively do this, perhaps even do so differentially
across the grid. Too much to ask, you must specify the
undersampling factor.

I was disappointed to see additional lines over my surface
though that clearly did not belong. The code also bombs
when x and y are passed as vectors for each axis, not as
arrays as the output of meshgrid. This is a valid way to
call surf, and is easily checked for and easily repaired with
a call to meshgrid.

13 Dec 2005 John D'Errico

Problems fixed. I might even lean to a 4.5 rating.
Intelligently automated undersampling of the grid lines
is not a trivial thing to do anyway. I still have hope
though...

17 Jan 2006 Neil King

EXCELLENT!!! Thanks for this, ive been wanting to do this for a while, often i have thousands of points so tend to get just a black surface if i try to include a grid! This does the job just nicely

04 Jun 2009 Marko Crivaro

Really good, does that it promises. Especially helpful when visualizing huge (accurate) grids.

04 Jun 2009 Lukas Lansky

Nice. If you want to quickly try it out:
x = [0:0.1:10];
y = [0:0.1:10];
z = sin(x)'*cos(y);
mesh(x,y,z); wireframe(x,y,z,5);

Please login to add a comment or rating.
Updates
12 Dec 2005

The inputs X and Y are now checked to be vectors in length equivalent to the column and row dimensions of Z, if true the input vectors are MESHGRIDded. Sorry, but still no "intelligence" behind picking which contour lines to display.

13 Dec 2005

Fixed bug that caused stray lines to be generated.

Tag Activity for this File
Tag Applied By Date/Time
specialized Daniel Ennis 22 Oct 2008 08:09:36
plotting Daniel Ennis 22 Oct 2008 08:09:36
surf Daniel Ennis 22 Oct 2008 08:09:36
surface Daniel Ennis 22 Oct 2008 08:09:36
mesh Daniel Ennis 22 Oct 2008 08:09:36
wire Daniel Ennis 22 Oct 2008 08:09:36
wireframe Daniel Ennis 22 Oct 2008 08:09:36

Contact us at files@mathworks.com