NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Active Participant
craigc
Posts: 376
0 Kudos

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
Active Participant
Stuart R
Posts: 347
0 Kudos

Re: extract 2d plane from a 3D surface.

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
Active Participant
craigc
Posts: 376
0 Kudos

Re: extract 2d plane from a 3D surface.

[ Edited ]

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
Knight of NI
Knight of NI
Ben
Posts: 16,134

Re: extract 2d plane from a 3D surface.

[ Edited ]

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

Ben Rayner
Who is NOT John Galt... yet... just building Rayner's Ridge
Scheduled to close on the new ridge next week!
Active Participant
craigc
Posts: 376
0 Kudos

Re: extract 2d plane from a 3D surface.

[ Edited ]

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
Active Participant
craigc
Posts: 376

Re: extract 2d plane from a 3D surface.

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
Active Participant
JamesC
Posts: 634

Re: extract 2d plane from a 3D surface.

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

Active Participant
craigc
Posts: 376
0 Kudos

Re: extract 2d plane from a 3D surface.

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 :smileyhappy: 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