<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Cory,<br>
<br>
and thank you very much, your proposition works fine for
illustration purposes. I need better accuracy, so I will do the
computation completely differently. In fact I can achieve what I
want with a simple contour applied on my surface wether using the
volumic data.<br>
<br>
Anyways, below the programmable filter script (input 0 is the
tetrahedra volume, input 1 is the cutting polydata surface):<br>
i<tt>npMain = self.GetInputDataObject( 0, 0 )</tt><tt><br>
</tt><tt>inpCut = self.GetInputDataObject( 0, 1 )</tt><tt><br>
</tt><tt>out = self.GetOutput()</tt><tt><br>
</tt><tt><br>
</tt><tt>cutter = vtk.vtkCutter()</tt><tt><br>
</tt><tt>cutter.SetInputDataObject( inpMain )</tt><tt><br>
</tt><tt>cutFunction = vtk.vtkImplicitPolyDataDistance()</tt><tt><br>
</tt><tt>cutFunction.SetInput( inpCut )</tt><tt><br>
</tt><tt>cutter.SetCutFunction( cutFunction )</tt><tt><br>
</tt><tt>cutter.Update()</tt><tt><br>
</tt><tt><br>
</tt><tt>outData = cutter.GetOutputDataObject( 0 )</tt><tt><br>
</tt><tt>out.DeepCopy( outData )</tt><tt><br>
</tt><br>
That helped, making me think about another way ;-)<br>
<br>
Yves<br>
<br>
<div class="moz-cite-prefix">Le 14/04/2015 16:37, Cory Quammen a
écrit :<br>
</div>
<blockquote
cite="mid:CAB5Fpx7_zYeuNdcOe5RfNo0yDZuSqRmR8VtR2mavcrb2WK862g@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Yves,
<div><br>
</div>
<div>Do you want to actually cut the tetrahedra that the
polydata geometry intersects? I don't know of anything that
will do that exactly in VTK, but you could approximate it by
using the vtkImplicitPolyDataDistance class with the vtkCutter
to approximately cut the tetrahedra by the polydata.</div>
<div><br>
</div>
<div>If you DON'T want to cut the tetrahedra, you could write a
plugin that computes the distance field from each point in the
tetrahedral mesh using vtkImplicitPolyDataDistance, then
thresholds the mesh to keep only tetrahedra where at least
some of the points have a negative signed distance from the
polydata.</div>
<div><br>
</div>
<div>I hope that helps,</div>
<div>Cory</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 14, 2015 at 4:18 AM, Yves
Rogez <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:yves.rogez@obs.ujf-grenoble.fr"
target="_blank">yves.rogez@obs.ujf-grenoble.fr</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I would like to know if there is a mean with paraview (or
VTK, I could write a plugin) to easily clip a tetrahedron
based geometry and data (built with a delaunay3D filter)
with a polydata geometry (typically a triangle mesh) ?<br>
The implicit sphere-based clipping could be an approximation
but an explicit 3D function would be better for my
application...<br>
<br>
Thanks,<br>
<br>
Yves<br>
<br>
_______________________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki
at: <a moz-do-not-send="true"
href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a moz-do-not-send="true"
href="http://markmail.org/search/?q=ParaView"
target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/paraview"
target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.</div>
</div>
</blockquote>
<br>
<div class="moz-signature">-- <br>
Yves Rogez<br>
<em>CONSERT Operations Engineer</em><br>
<br>
<b>IPAG</b><br>
<em>Institut de Planétologie et d'Astrophysique de Grenoble </em><br>
<font size="2">Bat D de Physique - BP. 53 - 38041 Grenoble -
FRANCE<br>
<br>
</font> tel : +33 (0)4 76 63 52 80<br>
lab : +33 (0)4 76 63 57 60<br>
</div>
</body>
</html>