Hi Gerard,

Been a while since we exchanged emails.

>>>>> "Gerard" == Gerard Gorman <[EMAIL PROTECTED]> writes:

    Gerard> Hi We're written a new Filter for mayavi (1.x) which
    Gerard> allows one to plot arbitrary fields (scalars and vectors)
    Gerard> on iso-surfaces. It also gives the volume fluxes and
    Gerard> scalar fluxes through the iso-surface. The result...some
    Gerard> interesting diagnostics and cool pictures :-) Note: flux
    Gerard> fields are calculated using point wise quantities (using
    Gerard> the normal at a vertex) while integrals are performed over
    Gerard> triangular elements in the iso-surface.

Sounds very cool.  I've been down with a fever past couple of days and
am still battling my older emails. ;-)

I did notice in the code that you loop over VTK arrays.  If you used
tvtk you can do this using numpy arrays without the need for an
expensive for loop in Python.

    Gerard> For those interested in the hacking aspect, it's
    Gerard> interesting because you have the change the active scalar
    Gerard> in a vtk dataset, so there cannot be one dataset, ie. the
    Gerard> active scalar required for the iso-surface is different
    Gerard> from the scalar you want to plot on the iso-surface. The
    Gerard> only way around this appears to be to make a deep copy of
    Gerard> the output of the contour filter, modify the active scalar
    Gerard> of this copy and make this object the output of the
    Gerard> filter.

I believe you can do this in another way:

In [1]: import vtk

In [2]: c = vtk.vtkContourFilter()

In [3]: c = vtk.vtkContourFilter()

In [4]: c.SetInputArrayToProcess?
[...]
Docstring:
    V.SetInputArrayToProcess(int, int, int, int, string)
    C++: void SetInputArrayToProcess (int idx, int port, int connection, int 
fieldAssociation, const char *name);
    V.SetInputArrayToProcess(int, int, int, int, int)
    C++: void SetInputArrayToProcess (int idx, int port, int connection, int 
fieldAssociation, int fieldAttributeType);
    V.SetInputArrayToProcess(int, vtkInformation)
    C++: void SetInputArrayToProcess (int idx, vtkInformation *info);
    V.SetInputArrayToProcess(int, int, int, string, string)
    C++: void SetInputArrayToProcess (int idx, int port, int connection, const 
char *fieldAssociation, const char *attributeTypeorName);
    
     Set the input data arrays that this algorithm will
     process. Specifically the idx array that this algorithm will process
     (starting from 0) is the array on port, connection with the specified
     association and name or attribute type (such as SCALARS). The
     fieldAssociation refers to which field in the data object the array is
     stored. See vtkDataObject::FieldAssociations for detail.

Perhaps this will do the trick?

    Gerard> Prabhu, after people have had a change to give feedback,
    Gerard> are you happy with this being committed? We have started

Sure, no problem.  I don't think I'll make a new release though.
MayaVi2 is the future.

    Gerard> playing with mayavi2 (very nice) so at a later stage we'll
    Gerard> port it across.

That would be great!  Thanks!

Thanks again for the contribution.

cheers,
prabhu

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to