Hi Alan,
I was able to reproduce your problem. I'm not sure why the
programmable filter approach fails, though.
As an alternative, use the attached Poly Data Distance XML plugin
(it's better, anyway, since you don't have to enter the script each
time you use it). Try the following:
- launch ParaView
- Tools -> Manage Plugins... -> Load New...
- Change file type to .xml and select the attached XML plugin file
- open disk_out_ref.exo
- Merge blocks
- Extract surface
- Transform, shifting 20 units in X
- Use PolyData distance plugin
You should have the distance computed on each version of disk_out_ref.exo.
Please let me know how it goes.
Thanks,
Cory
On Wed, Dec 24, 2014 at 8:15 PM, Scott, W Alan <[email protected]> wrote:
> Cory,
> Excellent idea. I did try, and yes - I end up with polydata. However, I
> then don't see any output. Mind giving this a try? Utkarsh should have
> disk_out_ref.exo. What I did;
>
> Read in disk_out_ref.exo.
> merge blocks
> extract surface.
> read in disk_out_ref.exo (yes, I know I could have used the original. Being
> pre-Christmas brain dead.)
> transform. X translation 20. (disks now have a distance from each other of
> about 8.5 units.)
> merge blocks
> extract surface.
> highlight each extract surface.
> programmable filter. Paste in your code.
>
> No output variable named "distance" to be found.
>
> Thanks,
>
> Alan
>
> -----Original Message-----
> From: Cory Quammen [mailto:[email protected]]
> Sent: Wednesday, December 24, 2014 3:10 PM
> To: Scott, W Alan
> Cc: Biddiscombe, John A.; [email protected]
> Subject: Re: [EXTERNAL] Re: [Paraview] Calculating the distance between two
> surfaces as a function of time during large deformation process
>
> Alan,
>
> disk_out_ref.ex2 -> Merge Blocks -> Extract Surface should get you polydata
> that you can feed into the programmable filter.
>
> Thanks,
> Cory
>
> On Wed, Dec 24, 2014 at 12:44 PM, Scott, W Alan <[email protected]> wrote:
>> Very nice and simple! Thanks.
>>
>> I tried running it on two instances of disk_out_ref.exo, and it complained
>> that it has MultiBlock data as inputs, but needs PolyData. Being a neophyte
>> with the programmable filter, how can I either convert my data, or convert
>> the filter to use multiblock data?
>>
>> Thanks!!
>>
>> Alan
>>
>> -----Original Message-----
>> From: Cory Quammen [mailto:[email protected]]
>> Sent: Tuesday, December 23, 2014 8:32 PM
>> To: Biddiscombe, John A.
>> Cc: Scott, W Alan; [email protected]
>> Subject: [EXTERNAL] Re: [Paraview] Calculating the distance between
>> two surfaces as a function of time during large deformation process
>>
>> Hi Alan,
>>
>> There is a filter in VTK called vtkDistancePolyDataFilter. It takes two
>> polydata as inputs and produces up two two outputs, each with an the
>> (optionally) signed distance from each point in the first polydata to the
>> closest point on the second polydata. If the polydata inputs overlap and the
>> signed distance is requested, the distance may be negative, which means that
>> the point at which the distance is computed is inside the other polydata.
>>
>> Attached is a ParaView 4.2 state file with a Programmable Filter that
>> exposes the vtkDistancePolyDataFilter. It could also be exposed as an XML
>> plugin.
>>
>> Cheers,
>> Cory
>>
>> On Tue, Dec 23, 2014 at 6:20 PM, Biddiscombe, John A. <[email protected]>
>> wrote:
>>> The way I did this was to use one surface as a “source” - fire rays
>>> from this surface along the surface normal until they hit the “target”
>>> and return the distance. Then use the distances for every source node
>>> as a new field which is output. One requires ideally a source mesh
>>> with quite dense points to get a good sampling.
>>>
>>> JB
>>>
>>> On 23/12/14 21:02, "Scott, W Alan" <[email protected]> wrote:
>>>
>>>>I have a user that asked the following question. Any ideas how to do
>>>>this?
>>>>
>>>>Thanks,
>>>>
>>>>Alan
>>>>
>>>>
>>>>Greetings,
>>>>
>>>>I need to quantify the distance between two curved and deforming
>>>>surfaces (large deformation mechanical analysis) as a function of
>>>>time in batch mode. I don't know (and don't want to know) which two
>>>>node points are the closest. Could you outline how you would code up
>>>>something like this ?
>>>>
>>>>George
>>>>
>>>>
>>>>
>>>>
>>>>_______________________________________________
>>>>Powered by www.kitware.com
>>>>
>>>>Visit other Kitware open-source projects at
>>>>http://www.kitware.com/opensource/opensource.html
>>>>
>>>>Please keep messages on-topic and check the ParaView Wiki at:
>>>>http://paraview.org/Wiki/ParaView
>>>>
>>>>Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>
>>>>Follow this link to subscribe/unsubscribe:
>>>>http://public.kitware.com/mailman/listinfo/paraview
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/paraview
>>
>>
>>
>> --
>> Cory Quammen
>> R&D Engineer
>> Kitware, Inc.
>
>
>
> --
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
--
Cory Quammen
R&D Engineer
Kitware, Inc.
<ServerManagerConfiguration>
<ProxyGroup name="filters">
<!-- ================================================================== -->
<SourceProxy name="PolyDataDistanceFilter" class="vtkDistancePolyDataFilter" label="PolyData Distance">
<Documentation
long_help="Computes the signed distance from one vtkPolyData to another. The signed distance to the second input is computed at every point in the first input using vtkImplicitPolyDataDistance. Optionally, the signed distance to the first input at every point in the second input can be computed. This may be enabled by calling ComputeSecondDistanceOn()."
short_help="Computes the signed distance from one vtkPolyData to another.">
</Documentation>
<InputProperty
name="FirstSurface"
port_index="0"
command="SetInputConnection">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkPolyData"/>
</DataTypeDomain>
<Documentation>
Set the first surface.
</Documentation>
</InputProperty>
<InputProperty
name="SecondSurface"
port_index="1"
command="SetInputConnection">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkPolyData"/>
</DataTypeDomain>
<Documentation>
Set the second surface.
</Documentation>
</InputProperty>
<IntVectorProperty
name="SignedDistance"
command="SetSignedDistance"
number_of_elements="1"
default_values="1">
<BooleanDomain name="bool"/>
<Documentation>
Compute the signed distance.
</Documentation>
</IntVectorProperty>
</SourceProxy>
<!-- End LandmarkTransformFilter -->
</ProxyGroup>
<!-- End Filters Group -->
</ServerManagerConfiguration>
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview