LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extract 2d plane from a 3D surface.

Hi all,
 
Bit stumped by this one.
 
I have an array with 3 columns in it, (X,Y,Z) with a variable number of rows in it (Variable from data set to data set).  i use "3dmesh" to display this data and get a nice surface graph, all is good.  However what i would like to do next is specify say a Z index and plot all the XY values onto a 2D graph.  so if my surface was a Hemisphere (Sphere Cut in half at the horizon) i could take a value in Z and would end up with a plot of a circle.  The circles would decrease as Z increases/decreases depending which way up the hemisphere is.  Kinda like an MRI scan take slices of your head then you can flick through them to build up a picture.
 
Anyone know where to begin? i have looked through the math and graph pallettes but there seems to be nothing there quite suitable.
 
Thanks in advance
 
Craig
LabVIEW 2012
0 Kudos
Message 1 of 8
(4,001 Views)
Hi Craig,

Which version of LV are you using and would it be possible to post the code that you have? It would be nice to get a sample of your array data so that an example specific to your application can be built.

Thanks!

Stuart
0 Kudos
Message 2 of 8
(3,979 Views)

Hi Stuart,

 

I have cut out bits of my program to make a "Mock up" of what i am trying to achieve so please excuse any wiring etiquette type things (They should be minimal).

The first vi is exactly how my data is created.  and is running ok but there are other issues here.  I run out of memory with anything above 1000 data points(N) in griddata(Not surprising).  If anyone can help me make this more efficient please feel free to give me some pointers.

 

The second vi is my problem that i initially posted above.  I have made an attempt and can get "slices" in one direction but not the other.  I think i will have to re-sort my data wrt Y axis or something but still a bit stumped.

 

Have fun! 

 

Craig 

 

Oh edit type thing - Running LV 8.2 with Mathscript (cant remember if that is an add-on or not now.)

Message Edited by craigc on 05-04-2007 08:31 AM

LabVIEW 2012
0 Kudos
Message 3 of 8
(3,974 Views)

Not sure if I understand your request.

I believe a mesh meemory req's grows as teh square of the number of points.

How about a parametric plot?

See attached VI for a first crack at the XY version.

Ben

Message Edited by Ben on 05-06-2007 11:15 AM

Message Edited by Ben on 05-06-2007 11:15 AM

Message Edited by Ben on 05-06-2007 11:16 AM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
Message 4 of 8
(3,952 Views)

Hi Ben,

Thanks for having a look at my problem  You have the right idea (You have given me the XY plane, So a slice in "Z" as i would call it i would like my data as a slice in "X" and a slice in "Y").  I have managed to get the desired effect in one dimension of my XY Graph But not the other.  If you take a look at my New VI and run it you should see the desired outcome for a slice across one direction of the 3D plot (What i have coined the X axis).  I cannot get the desired effect for viewing the data from the other direction (Y axis).  I have taken a snippet for sorting the arrays from your VI, however it still does not work, Kinda confusing.

Thanks again,  so close yet so far....

Craig

Message Edited by craigc on 05-08-2007 04:24 AM

LabVIEW 2012
0 Kudos
Message 5 of 8
(3,921 Views)
Hi All,
 
After a bit of tinkering and Looking at Bens Code (Thanks Ben),  I have managed to solve my problem.  Here is the solution for those interested.
 
Thanks Again all
 
Craig
LabVIEW 2012
Message 6 of 8
(3,910 Views)
Hi Craig,

Please can you look at the attached VI, I think it does what you want, but I'm not sure I got the right end of the stick.

I have changed the architecture of your code, so you only sort the data when you change to the Y plane, rather than every time.

Also I changed the cluster sort, because the sort 1D array function sorts on the first cluster element, then the second and so on.

Regards
JamesC
NIUK and Ireland

Message 7 of 8
(3,906 Views)

Hi James,

Thanks for the Input,  I have modified my code to include your changes and everything is working just how i like it now plus more efficiently 🙂 This code is going into a results viewer i am writing for a quick look at data sets.

Thanks to all that helped

Craig

LabVIEW 2012
0 Kudos
Message 8 of 8
(3,903 Views)