Mayavi - geology 3D volume

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Mayavi - geology 3D volume

bevan jenkins
Hello,
 
I have a number of text files that contain geology data.  Each file represents the top of a geologic layer for example
surface.txt
x y z
100 100 52.5
120 100 54.0
140 100 56.0
100 120 51.5
120 120 52.5
140 120 53.6
etc
sandstone.txt
 
I have read each file into a np.array.  I am keen to display this in mayavi but am struggling with where to start?
Do I need to combine arrays into a 2D array which has
x y z layer
and create a code for each layer (i.e surface = 1, sandstone =2)?
 
Any help getting started is appreciated
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Brennan Williams
Bevan

See attached volume_slicer.py demo which may be of interest.

You can find a description of it....

http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_volume_slicer.html#example-volume-slicer

Other people may point you in a better direction. But it is a nice
interactive demo of moving through 3d data.

Brennan

bevan jenkins wrote:

> Hello,
>  
> I have a number of text files that contain geology data.  Each file
> represents the top of a geologic layer for example
> surface.txt
> x y z
> 100 100 52.5
> 120 100 54.0
> 140 100 56.0
> 100 120 51.5
> 120 120 52.5
> 140 120 53.6
> etc
> sandstone.txt
>  
> I have read each file into a np.array.  I am keen to display this in
> mayavi but am struggling with where to start?
> Do I need to combine arrays into a 2D array which has
> x y z layer
> and create a code for each layer (i.e surface = 1, sandstone =2)?
>  
> Any help getting started is appreciated
> ------------------------------------------------------------------------
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>  

"""
Example of an elaborate dialog showing a multiple views on the same data, with
3 cuts synchronized.

This example shows how to have multiple views on the same data, how to
embedded multiple scenes in a dialog, and the caveat in populating them
with data, as well as how to add some interaction logic on an
ImagePlaneWidget.

The order in which things happen in this example is important, and it is
easy to get it wrong. First of all, many properties of the visualization
objects cannot be changed if there is not a scene created to view them.
This is why we put a lot of the visualization logic in the callback of
scene.activated, which is called after creation of the scene.
Second, default values created via the '_xxx_default' callback are created
lazyly, that is, when the attributes are accessed. As the establishement
of the VTK pipeline can depend on the order in which it is built, we
trigger these access by explicitely calling the attributes.
In particular, properties like scene background color, or interaction
properties cannot be set before the scene is activated.

The same data is exposed in the different scenes by sharing the VTK
dataset between different Mayavi data sources. See
the :ref:`sharing_data_between_scenes` tip for more details.

In this example, the interaction with the scene and the various elements
on it is strongly simplified by turning off interaction, and choosing
specific scene interactor styles. Indeed, non-technical users can be
confused with too rich interaction.
"""
# Author: Gael Varoquaux <[hidden email]>
# Copyright (c) 2009, Enthought, Inc.
# License: BSD Style.

import numpy as np

from enthought.traits.api import HasTraits, Instance, Array, \
    on_trait_change
from enthought.traits.ui.api import View, Item, HGroup, Group

from enthought.tvtk.api import tvtk
from enthought.tvtk.pyface.scene import Scene

from enthought.mayavi import mlab
from enthought.mayavi.core.api import PipelineBase, Source
from enthought.mayavi.core.ui.api import SceneEditor, MayaviScene
from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel

################################################################################
# Create some data
x, y, z = np.ogrid[-5:5:64j, -5:5:64j, -5:5:64j]
data = np.sin(3*x)/x + 0.05*z**2 + np.cos(3*y)

################################################################################
# The object implementing the dialog
class VolumeSlicer(HasTraits):
    # The data to plot
    data = Array()

    # The 4 views displayed
    scene3d = Instance(MlabSceneModel, ())
    scene_x = Instance(MlabSceneModel, ())
    scene_y = Instance(MlabSceneModel, ())
    scene_z = Instance(MlabSceneModel, ())

    # The data source
    data_src3d = Instance(Source)

    # The image plane widgets of the 3D scene
    ipw_3d_x = Instance(PipelineBase)
    ipw_3d_y = Instance(PipelineBase)
    ipw_3d_z = Instance(PipelineBase)

    _axis_names = dict(x=0, y=1, z=2)


    #---------------------------------------------------------------------------
    def __init__(self, **traits):
        super(VolumeSlicer, self).__init__(**traits)
        # Force the creation of the image_plane_widgets:
        self.ipw_3d_x
        self.ipw_3d_y
        self.ipw_3d_z


    #---------------------------------------------------------------------------
    # Default values
    #---------------------------------------------------------------------------
    def _data_src3d_default(self):
        return mlab.pipeline.scalar_field(self.data,
                            figure=self.scene3d.mayavi_scene)

    def make_ipw_3d(self, axis_name):
        ipw = mlab.pipeline.image_plane_widget(self.data_src3d,
                        figure=self.scene3d.mayavi_scene,
                        plane_orientation='%s_axes' % axis_name)
        return ipw

    def _ipw_3d_x_default(self):
        return self.make_ipw_3d('x')

    def _ipw_3d_y_default(self):
        return self.make_ipw_3d('y')

    def _ipw_3d_z_default(self):
        return self.make_ipw_3d('z')


    #---------------------------------------------------------------------------
    # Scene activation callbaks
    #---------------------------------------------------------------------------
    @on_trait_change('scene3d.activated')
    def display_scene3d(self):
        outline = mlab.pipeline.outline(self.data_src3d,
                        figure=self.scene3d.mayavi_scene,
                        )
        self.scene3d.mlab.view(40, 50)
        # Interaction properties can only be changed after the scene
        # has been created, and thus the interactor exists
        for ipw in (self.ipw_3d_x, self.ipw_3d_y, self.ipw_3d_z):
            # Turn the interaction off
            ipw.ipw.interaction = 0
        self.scene3d.scene.background = (0, 0, 0)
        # Keep the view always pointing up
        self.scene3d.scene.interactor.interactor_style = \
                                 tvtk.InteractorStyleTerrain()


    def make_side_view(self, axis_name):
        scene = getattr(self, 'scene_%s' % axis_name)

        # To avoid copying the data, we take a reference to the
        # raw VTK dataset, and pass it on to mlab. Mlab will create
        # a Mayavi source from the VTK without copying it.
        # We have to specify the figure so that the data gets
        # added on the figure we are interested in.
        outline = mlab.pipeline.outline(
                            self.data_src3d.mlab_source.dataset,
                            figure=scene.mayavi_scene,
                            )
        ipw = mlab.pipeline.image_plane_widget(
                            outline,
                            plane_orientation='%s_axes' % axis_name)
        setattr(self, 'ipw_%s' % axis_name, ipw)

        # Synchronize positions between the corresponding image plane
        # widgets on different views.
        ipw.ipw.sync_trait('slice_position',
                            getattr(self, 'ipw_3d_%s'% axis_name).ipw)

        # Make left-clicking create a crosshair
        ipw.ipw.left_button_action = 0
        # Add a callback on the image plane widget interaction to
        # move the others
        def move_view(obj, evt):
            position = obj.GetCurrentCursorPosition()
            for other_axis, axis_number in self._axis_names.iteritems():
                if other_axis == axis_name:
                    continue
                ipw3d = getattr(self, 'ipw_3d_%s' % other_axis)
                ipw3d.ipw.slice_position = position[axis_number]

        ipw.ipw.add_observer('InteractionEvent', move_view)
        ipw.ipw.add_observer('StartInteractionEvent', move_view)

        # Center the image plane widget
        ipw.ipw.slice_position = 0.5*self.data.shape[
                    self._axis_names[axis_name]]

        # Position the view for the scene
        views = dict(x=( 0, 90),
                     y=(90, 90),
                     z=( 0,  0),
                     )
        scene.mlab.view(*views[axis_name])
        # 2D interaction: only pan and zoom
        scene.scene.interactor.interactor_style = \
                                 tvtk.InteractorStyleImage()
        scene.scene.background = (0, 0, 0)


    @on_trait_change('scene_x.activated')
    def display_scene_x(self):
        return self.make_side_view('x')

    @on_trait_change('scene_y.activated')
    def display_scene_y(self):
        return self.make_side_view('y')

    @on_trait_change('scene_z.activated')
    def display_scene_z(self):
        return self.make_side_view('z')


    #---------------------------------------------------------------------------
    # The layout of the dialog created
    #---------------------------------------------------------------------------
    view = View(HGroup(
                  Group(
                       Item('scene_y',
                            editor=SceneEditor(scene_class=Scene),
                            height=250, width=300),
                       Item('scene_z',
                            editor=SceneEditor(scene_class=Scene),
                            height=250, width=300),
                       show_labels=False,
                  ),
                  Group(
                       Item('scene_x',
                            editor=SceneEditor(scene_class=Scene),
                            height=250, width=300),
                       Item('scene3d',
                            editor=SceneEditor(scene_class=MayaviScene),
                            height=250, width=300),
                       show_labels=False,
                  ),
                ),
                resizable=True,
                title='Volume Slicer',
                )


m = VolumeSlicer(data=data)
m.configure_traits()

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

bevan jenkins
Brennan,
 
Thanks heaps - that is a pretty neat example that Gael has put together.
However, I am still stuck with how to get my data into the correct format.
 


 
On Wed, Mar 10, 2010 at 12:30 PM, Brennan Williams <[hidden email]> wrote:
Bevan

See attached volume_slicer.py demo which may be of interest.

You can find a description of it....

http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_volume_slicer.html#example-volume-slicer

Other people may point you in a better direction. But it is a nice interactive demo of moving through 3d data.

Brennan

bevan jenkins wrote:
Hello,
 I have a number of text files that contain geology data.  Each file represents the top of a geologic layer for example
surface.txt
x y z
100 100 52.5
120 100 54.0
140 100 56.0
100 120 51.5
120 120 52.5
140 120 53.6
etc
sandstone.txt
 I have read each file into a np.array.  I am keen to display this in mayavi but am struggling with where to start?
Do I need to combine arrays into a 2D array which has
x y z layer
and create a code for each layer (i.e surface = 1, sandstone =2)?
 Any help getting started is appreciated
------------------------------------------------------------------------


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Brennan Williams
Have a look at...

http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/data.html

which describes the different datatypes supported.

As I understand it, you have a number of xyz layers that you want to
combine in a visualization.
If you have the same number of x y z's in each layer and if the top of
the second layer represents the bottom of the first layer etc.
then maybe you have a structured grid (assuming you have no faults - if
you do, you will probably need an unstructured grid).

So you may want to create a structured grid by probably vstack'ing the
layers and then, yes as you suggest, assign a scalar value
(rocktype=1,2,...) to the cells or points in the grid.

Do you have a lower/bottom surface for the last layer?

Hope this is helping.

Brennan

bevan jenkins wrote:

> Brennan,
>  
> Thanks heaps - that is a pretty neat example that Gael has put together.
> However, I am still stuck with how to get my data into the correct format.
>  
>
>
>  
> On Wed, Mar 10, 2010 at 12:30 PM, Brennan Williams
> <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Bevan
>
>     See attached volume_slicer.py demo which may be of interest.
>
>     You can find a description of it....
>
>     http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_volume_slicer.html#example-volume-slicer
>
>     Other people may point you in a better direction. But it is a nice
>     interactive demo of moving through 3d data.
>
>     Brennan
>
>     bevan jenkins wrote:
>
>         Hello,
>          I have a number of text files that contain geology data.
>          Each file represents the top of a geologic layer for example
>         surface.txt
>         x y z
>         100 100 52.5
>         120 100 54.0
>         140 100 56.0
>         100 120 51.5
>         120 120 52.5
>         140 120 53.6
>         etc
>         sandstone.txt
>          I have read each file into a np.array.  I am keen to display
>         this in mayavi but am struggling with where to start?
>         Do I need to combine arrays into a 2D array which has
>         x y z layer
>         and create a code for each layer (i.e surface = 1, sandstone =2)?
>          Any help getting started is appreciated
>         ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>  


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Timmie
Administrator
In reply to this post by bevan jenkins
> I have read each file into a np.array.  I am keen to display this in mayavi
> but am struggling with where to start?
> Do I need to combine arrays into a 2D array which has
> x y z layer
> and create a code for each layer (i.e surface = 1, sandstone =2)?
>
> Any help getting started is appreciated
Do you need to use a Python program?
Geological data is spatial data.
You may consider GRASS GIS:
http://grass.itc.it/screenshots/viz.php

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

bevan jenkins
Tim,
 
No I don't have to use Mayavi, howerver, I am pretty keen to use it but if I can't get it sorted I will have a look at GRASS.
 
Thanks,
 
I think I am getting closer.  I found another example from Gael that uses a DEM.  I guess a another way to think about my problem is you have multiple DEMs, each one is offset in the vertical and I would like to fill the volume between each one rather thanjust have multiple surfaces.
 
 
 


 
On Fri, Mar 12, 2010 at 9:32 AM, Tim Michelsen <[hidden email]> wrote:
> I have read each file into a np.array.  I am keen to display this in mayavi
> but am struggling with where to start?
> Do I need to combine arrays into a 2D array which has
> x y z layer
> and create a code for each layer (i.e surface = 1, sandstone =2)?
>
> Any help getting started is appreciated
Do you need to use a Python program?
Geological data is spatial data.
You may consider GRASS GIS:
http://grass.itc.it/screenshots/viz.php

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Gael Varoquaux
In reply to this post by bevan jenkins
On Wed, Mar 10, 2010 at 12:24:40PM +1300, bevan jenkins wrote:

>    I have a number of text files that contain geology data.� Each file
>    represents the top of a geologic layer for example
>    surface.txt
>    x y z
>    100 100 52.5
>    120 100 54.0
>    140 100 56.0
>    100 120 51.5
>    120 120 52.5
>    140 120 53.6
>    etc
>    sandstone.txt
>    �
>    I have read each file into a np.array.� I am keen to display this in
>    mayavi but am struggling with where to start?
>    Do I need to combine arrays into a 2D array which has
>    x y z layer
>    and create a code for each layer (i.e surface = 1, sandstone =2)?
Hi there,

Sorry for the slow answer, I am busy on many fronts.

The two questions are:

    1) how is your data organized?

    2) how do you want to display it?

If you data has been sampled with x and y on a regular grid, you could
create a 2D array of z as a function of x and y (think of it as an image)
for each layer. Then you could use mlab.surf (
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#enthought.mayavi.mlab.surf
) to display as a surface.

I am not sure how I can give more information with such a sparse
description and without knowing what your background and your problems
are.

Hope this helps,

Ga�l

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Gael Varoquaux
In reply to this post by bevan jenkins
On Wed, Mar 17, 2010 at 11:00:41AM +1300, bevan jenkins wrote:
>    I think I am getting closer.� I found another example from Gael that uses
>    a DEM.� I guess a another way to think about my problem is you have
>    multiple DEMs, each one is offset in the vertical and I would like to fill
>    the volume between each one rather thanjust have multiple surfaces.

Ha, OK, you want to fill in the volume. That's the trick.

First, do you really want to do that? Filled volume is pretty hard to
visualize. What the visualization that you have in mind?

Second, one way of doing this would be to use what is called
'StructuredGrids' in VTK:

    1) Create 4 arrays that are (n_x, ny_, s), where s is the number of
       layers. These arrays should be:

            x: the x position of the points
            y: the y position of the points
            z: the y position of the points
            s: a numeric label for the layer

       the idea is that you are each time giving a position (x, y, z) for
       a data point, and the corresponding layer label.

    2) You can then build a structured grid using the example given in:
       http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/data.html#structuredgrid

    pts = np.r_[x, y, z].ravel()
    sgrid = tvtk.StructuredGrid(dimensions=(x.shape))
    sgrid.points = pts
    sgrid.point_data.scalars = s.ravel()
    sgrid.point_data.scalars.name = 'scalars'


    3) You can finally visualize the data applying the module that you
whish:

    mlab.pipeline.scalar_cut_plane(sgrid)

HTH,

Ga�l

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

bevan jenkins
Gael
 
Your typing is too fast for me - I was still working on a reply to your first email...
I have something like a 3d represetation of the geology of an area in mind - http://quake.wr.usgs.gov/research/3Dgeologic/CC_det2.jpg is a rough example of what I am trying to achieve.  (lets ignore faults for now).
 
I will do do some slices through.
 
Thanks I will try your implementation and come back.


 
On Wed, Mar 17, 2010 at 12:11 PM, Gael Varoquaux <[hidden email]> wrote:
On Wed, Mar 17, 2010 at 11:00:41AM +1300, bevan jenkins wrote:
>    I think I am getting closer.  I found another example from Gael that uses
>    a DEM.  I guess a another way to think about my problem is you have
>    multiple DEMs, each one is offset in the vertical and I would like to fill
>    the volume between each one rather thanjust have multiple surfaces.

Ha, OK, you want to fill in the volume. That's the trick.

First, do you really want to do that? Filled volume is pretty hard to
visualize. What the visualization that you have in mind?

Second, one way of doing this would be to use what is called
'StructuredGrids' in VTK:

   1) Create 4 arrays that are (n_x, ny_, s), where s is the number of
      layers. These arrays should be:

           x: the x position of the points
           y: the y position of the points
           z: the y position of the points
           s: a numeric label for the layer

      the idea is that you are each time giving a position (x, y, z) for
      a data point, and the corresponding layer label.

   2) You can then build a structured grid using the example given in:
      http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/data.html#structuredgrid

   pts = np.r_[x, y, z].ravel()
   sgrid = tvtk.StructuredGrid(dimensions=(x.shape))
   sgrid.points = pts
   sgrid.point_data.scalars = s.ravel()
   sgrid.point_data.scalars.name = 'scalars'


   3) You can finally visualize the data applying the module that you
whish:

   mlab.pipeline.scalar_cut_plane(sgrid)

HTH,

Gaël

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Brennan Williams




bevan jenkins wrote:
> Gael
>  
> Your typing is too fast for me - I was still working on a reply to
> your first email...
> I have something like a 3d represetation of the geology of an area in
> mind - http://quake.wr.usgs.gov/research/3Dgeologic/CC_det2.jpg is a
> rough example of what I am trying to achieve.  (lets ignore faults for
> now).
>  
Hmmm, if we're not ignoring the faults (can't help myself), that looks
like an unstructured grid to me which is what I'm battling with at the
moment.

> I will do do some slices through.
>  
> Thanks I will try your implementation and come back.
>
>
>  
> On Wed, Mar 17, 2010 at 12:11 PM, Gael Varoquaux
> <[hidden email] <mailto:[hidden email]>>
> wrote:
>
>     On Wed, Mar 17, 2010 at 11:00:41AM +1300, bevan jenkins wrote:
>     >    I think I am getting closer.  I found another example from
>     Gael that uses
>     >    a DEM.  I guess a another way to think about my problem is
>     you have
>     >    multiple DEMs, each one is offset in the vertical and I would
>     like to fill
>     >    the volume between each one rather thanjust have multiple
>     surfaces.
>
>     Ha, OK, you want to fill in the volume. That's the trick.
>
>     First, do you really want to do that? Filled volume is pretty hard to
>     visualize. What the visualization that you have in mind?
>
>     Second, one way of doing this would be to use what is called
>     'StructuredGrids' in VTK:
>
>        1) Create 4 arrays that are (n_x, ny_, s), where s is the number of
>           layers. These arrays should be:
>
>                x: the x position of the points
>                y: the y position of the points
>                z: the y position of the points
>                s: a numeric label for the layer
>
>           the idea is that you are each time giving a position (x, y,
>     z) for
>           a data point, and the corresponding layer label.
>
>        2) You can then build a structured grid using the example given in:
>          
>     http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/data.html#structuredgrid
>
>        pts = np.r_[x, y, z].ravel()
>        sgrid = tvtk.StructuredGrid(dimensions=(x.shape))
>        sgrid.points = pts
>        sgrid.point_data.scalars = s.ravel()
>        sgrid.point_data.scalars.name
>     <http://sgrid.point_data.scalars.name/> = 'scalars'
>
>
>        3) You can finally visualize the data applying the module that you
>     whish:
>
>        mlab.pipeline.scalar_cut_plane(sgrid)
>
Whether the grid is structured or unstructured, it isn't just a regular
volume. I've only played around a bit with cutting or slicing through a
grid (unstructured in my case) but those slices are planes whereas what
I would like to be able to do (and possibly Bevan does as well) is
interactively run a cut or slice through the grid which follows the
layering of the grid.

Describing that a bit better.... my grid is a 3d grid with a "cell"
i,j,k coordinate system so I have ni cells in i, nj in j and nk in k. In
may case k is  vertical going down so my layer 1 is at the top, my layer
nk is at the bottom (this is from reservoir simulation,  geologists
often  have layer 1 at the bottom).

So I would like to interactively run a "K slice" down from layer 1 to
layer nk and of course I'd like to be able to do that in i and j as
well. As my grid isn't regular these slices will not be planar, they
could either be made of polygons that slice through the middle of each
cell that is in the selected layer or  it could actually be a subset of
the grid being displayed (i.e.  displaying it as hexahedral grid cells
but all other cells in the grid apart from those in the current
slice/layer are turned off.

Thoughts?

Brennan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Gael Varoquaux
On Wed, Mar 17, 2010 at 12:43:16PM +1300, Brennan Williams wrote:
> Hmmm, if we're not ignoring the faults (can't help myself), that looks
> like an unstructured grid to me which is what I'm battling with at the
> moment.

Possibly. Though it might still be represented as a structured grid.
Structured grids are powerful. The only restriction they have is that
each point has 6 neighbors: the connectivity is that of a grid.

> Whether the grid is structured or unstructured, it isn't just a regular
> volume. I've only played around a bit with cutting or slicing through a
> grid (unstructured in my case) but those slices are planes whereas what
> I would like to be able to do (and possibly Bevan does as well) is
> interactively run a cut or slice through the grid which follows the
> layering of the grid.

> Describing that a bit better.... my grid is a 3d grid with a "cell"
> i,j,k coordinate system so I have ni cells in i, nj in j and nk in k. In
> may case k is  vertical going down so my layer 1 is at the top, my layer
> nk is at the bottom (this is from reservoir simulation,  geologists
> often  have layer 1 at the bottom).

> So I would like to interactively run a "K slice" down from layer 1 to
> layer nk and of course I'd like to be able to do that in i and j as
> well. As my grid isn't regular these slices will not be planar, they
> could either be made of polygons that slice through the middle of each
> cell that is in the selected layer or  it could actually be a subset of
> the grid being displayed (i.e.  displaying it as hexahedral grid cells
> but all other cells in the grid apart from those in the current
> slice/layer are turned off.

That's nasty :). I am not sure how you would define the cut surface in
this situation, and that's probably going to be the challenge.

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi - geology 3D volume

Gael Varoquaux
In reply to this post by bevan jenkins
On Wed, Mar 17, 2010 at 12:19:57PM +1300, bevan jenkins wrote:
>    Your typing is too fast for me - I was still working on a reply to your
>    first email...
>    I have something like�a 3d represetation of the geology of an area in mind
>    -�[1]http://quake.wr.usgs.gov/research/3Dgeologic/CC_det2.jpg�is a rough
>    example of what I am trying to achieve.� (lets ignore faults for now).

OK, that 'cut' feeling can be achieved using a 'DataSet Clipper' (use it
interactively before you start trying to code it), followed by a surface
module.

Has for the data source, I believe that the advice I gave you before
still holds. It pretty much depends on whether your data is structured
(grid connectivity) or not.

Good luck,

Ga�l

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev