LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can't figure out 3d surface

Total newbie question... I just have a simple set of (x,y,z) coordinates that I want to plot in 3D, in realtime as they're collected one-y-one... what's the best way to do this?

 

For example, I've got these values, as (x,y,z):

 

0.000, 0.000, -5.072 

 

10.000, 0.000, -4.774

10.000, 10.000, -4.583

0.000, 10.000, -4.423

 

My program steps through a For Loop and generates one point during each run through the loop, i.e., at N = 0, it gets (0.000, 0.000, -5.072), at N = 1 it gets (10.000, 0.000, -4.774), and so on.

 

I've looked through the help and example files but I got confused, all this talk about 1D vectors and 2D matrices... all I've got are some simple (x,y,z) coordinates. My guess is that I need to somehow get the X values into a 1D X vector, same for Y, and for the Z a (in this case) 2x2 2D array, but I get confused about how to actually do that, and to get the plot to update point-by-point as it's getting built up... 

0 Kudos
Message 1 of 10
(3,561 Views)

A cut-n-paste from reply in this thread


Starting atpost #7 of this thread I start a tutorial exaplaining how to use the 3d Graph to plot multiple curves and surfaces.

 

If you want your final image to look like an air foil your are going to have to present your data such that adjoining points in your surface are adjacent in the data set. THis thread shows a quick hack of a a car rendered in 3d.

 

 

If you want it all to be one color you will have to set teh color mapping to none.

 

Idividual ribs of the wing can be added as sepearte plots to over-lay the surface.

 

Have fun!

 

Ben

 


I suggest you play with that car example first to develop a model in your head about what the graph wants. Once you figure that out, you could start a NEW thread on how to manipulate your data if you have trouble wit that part.

 

have fun,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 10
(3,544 Views)
Thanks for that Ben. Looking at the code for the example in this post of yours helped, but in that case all points were entered at the start of the program. In my case they're added one by one, not sure how to save/build-up the (x,y,z) points through numerous iterations of the for loop...
0 Kudos
Message 3 of 10
(3,529 Views)

Like I posted, that is step 1.

 

Start another thread (the subject is different and you want as many as possible to see your Q) to learn how to build your array.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 10
(3,524 Views)

sweet, figured out the arraying bit by just running some wires out and having LabVIEW auto-index them through a mix of Auto-Indexed Tunnels and Loop Tunnels, see attached image below... (excuse what I'm sure is horribly sloppy coding Smiley Happy )

 

the difficulty I'm having now is that it only updates once all the loops are finished, i.e., it doesn't update "realtime" as the data is gathered point-by-point. Is there a simple fix for this using the kind of wiring I have now?

 

0 Kudos
Message 5 of 10
(3,513 Views)
Your image is not going to get drawn until the 3D Surface.vi gets its x vector, y vector and z matrix.  And if you were to run the 3D Surface.vi every time you got a new point, your VI would run a lot slower.  Is there a reason you want it to update point-by-point, or are you just intested in the effect?
Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 6 of 10
(3,482 Views)

Hi Justin, the reason is that in the final version of the program, each point will take a long time to acquire... say, 1 minute. Building up a 10x10 image or larger would then take, experimentally, over an hour. Having a "realtime" preview of the data would allow the experimenter to see if something's wrong (and thus cancel the run and fix whatever's wrong) instead of waiting an hour or more for the final data, and then having to redo the experiment. 

0 Kudos
Message 7 of 10
(3,458 Views)
I suppose you know the dimensions of the area under examination before the measurement starts. Just compute the arrays for the dimensions before your program runs and do the same for the array that will hold the measured values. Use initialize array-you will get array of zeros thus a plain surface. Then in each iteration replace corresponding element (replace array) and redraw the graph.
Message Edited by ceties on 12-08-2009 04:26 PM
LV 2011, Win7
0 Kudos
Message 8 of 10
(3,453 Views)

 

Quick example.

 

 

Message Edited by ceties on 12-08-2009 04:41 PM
LV 2011, Win7
Message 9 of 10
(3,446 Views)

Init the arrays with "NaN" instead of "0" so those points don't plot.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 10
(3,423 Views)