Welcome, Guest. Please Login.
OpenDX User Forum
05/24/13 at 18:44:46


Pages: 1
How to do a 3D plot (Read 2333 times)
msb
Junior Member
**


Got Viz?

Posts: 30
How to do a 3D plot
01/17/11 at 22:02:37
 
Dear Joelr,
 
Would please tell me how I can make 3D plot from a two dimensional function f(x,y)? I have a uniform 2D grid, on which f(x,y) is given for each x and y.  
 
Looking forward for you response.
Saeed
Back to top
 
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: How to do a 3D plot
Reply #1 - 01/18/11 at 16:34:40
 
Hi Saeed,
 
Of course it depends on exactly what you want to see. I'm assuming that
you want to visualize an xy mesh that is deformed in the z direction by
f(x,y), which is scalar valued. It sounds from your description that you  
already have a field with the appropriate xy grid and a data component
containing the desired z. Assuming all this, then all you need to do is:
Code:
-->Mark("positions")-->Compute([a.0, a.1, b])-->Unmark-->ShowConnections
 |                     |
 +---------------------+
 


 
Cheers,
Joel
Back to top
 
 
Email   IP Logged
msb
Junior Member
**


Got Viz?

Posts: 30
Re: How to do a 3D plot
Reply #2 - 01/18/11 at 18:50:54
 
Dear Joel,
 
As usual, you gave a real solution to me! Thanks a lot.
 
Now I can plot f(x,y) on my xy grid. Next I'd like to know how I can fill the surface. It now looks like a net (pls see the attached file), but I'd like to show it as a filled surface.  
 
Thanks,
Saeed
Back to top
Picture_20.jpeg (attachment deleted)  
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: How to do a 3D plot
Reply #3 - 01/19/11 at 06:30:39
 

Glad to help!  
 
To see the surface, skip the ShowConnections and send it directly to Image.
Back to top
 
 
Email   IP Logged
msb
Junior Member
**


Got Viz?

Posts: 30
Re: How to do a 3D plot
Reply #4 - 01/19/11 at 06:45:33
 
Thanks Joel.
 
Now I have a gorgeous energy surface!
Back to top
Picture_21.jpeg (attachment deleted)  
 
  IP Logged
msb
Junior Member
**


Got Viz?

Posts: 30
Re: How to do a 3D plot
Reply #5 - 01/19/11 at 09:30:19
 
Hi Joel,
 
Sorry for bothering you again. Now I want to clip the two off-diagonal corners of my surface (pls. see the attached file). Using ClipPlane I can clip either of corners. However when I try to clip the both corners using two ClipPlane modules set in parallel (as shown in the figure), the output looks totally unclipped. I tried using them in series, but it gave me an error message saying : "Nested Clipped objects not supported"
 
Am I missing something or using a wrong module for clipping?
 
Thanks again,
Saeed
Back to top
Picture-24.jpg (attachment deleted)  
 
  IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: How to do a 3D plot
Reply #6 - 01/19/11 at 14:17:17
 

Try using ClipSurfaceMacro. It clips by actually removing the unwanted
portion of the data, rather than inserting a special clipping object into
the scene graph. The standard ClipPlane and ClipBox modules use the
latter approach, which has the restriction you encountered.
(The sample program VolumeClip.net shows an example of having multiple
clipping planes using ClipSurfaceMacro.)
Back to top
 
 
Email   IP Logged
msb
Junior Member
**


Got Viz?

Posts: 30
Re: How to do a 3D plot
Reply #7 - 01/19/11 at 19:59:29
 
Dear Joel,
 
Thanks. I guess you meant ClipVolumeMacro, because apparently there is no ClipSurfaceMacro module in VolumeClip.net. If I feed both the surface and volume inputs of ClipVolumeMacro from the output of Unmark (shown above in your code) I can clip the unwanted areas, however  ClipVolumeMacro shows an error message saying: "ERROR: ClipVolumeMacro: MaptoPlane: Invalid data: quads is an invalid connections type." Any Idea how to get rid of this message?
 
Saeed
Back to top
 
 
  IP Logged
msb
Junior Member
**


Got Viz?

Posts: 30
Re: How to do a 3D plot
Reply #8 - 01/19/11 at 21:40:02
 
Hi Joel,
 
Pls ignore my last question. You were right; ClipSurfaceMacro did the job perfectly.  
Many thanks again.
Back to top
 
 
  IP Logged
Pages: 1