Hi Andrea, The correct line would be :
clipper.PreserveInputCells(True) Best, Mathieu Westphal On Wed, May 30, 2018 at 6:06 PM, Caffagni, Andrea < andrea.caffa...@ferrari.com> wrote: > Dear Mathieu, > > I have to use this programmable filter also with Poly Mesh; unfortunately > it doesn’t work with this kind of mesh. > > Usually, when I clip Poly mesh, it works fine the ‘Crinkle clip’. > > How I should modify the programmable filter in order to use this for the > Poly mesh? > > > > Best Regards, > > Andrea > > > > *From:* Caffagni, Andrea > *Sent:* Thursday, April 26, 2018 07:00 > *To:* Mathieu Westphal > *Cc:* paraview@public.kitware.com > *Subject:* RE: [Paraview] Clip a domain using a close surface > > > > Thank you Mathieu, > > It works perfectly. > > > > Best Regards, > > Andrea > > > > *From:* Mathieu Westphal [mailto:mathieu.westp...@kitware.com > <mathieu.westp...@kitware.com>] > *Sent:* Wednesday, April 25, 2018 16:50 > *To:* Caffagni, Andrea > *Cc:* paraview@public.kitware.com > *Subject:* Re: [Paraview] Clip a domain using a close surface > > > > Hi Andrea, > > Here is an updated script to clip instead of cutting. > > You will recover the volume of your main dataset which is inside the > provided surface. > > (if your are interested by what is outside, just change the InsideOut > value) > > *import* *vtk.vtkPVVTKExtensionsDefault* *as* *ext* > > > > inpMain = self.GetInputDataObject( 0, 0 ) > > inpClip = self.GetInputDataObject( 0, 1 ) > > out = self.GetOutput() > > > > clipper = ext.vtkPVMetaClipDataSet() > > clipper.SetInputDataObject(inpMain) > > clipper.SetInsideOut(True) > > clipFunction = vtk.vtkImplicitPolyDataDistance() > > clipFunction.SetInput(inpClip) > > clipper.SetClipFunction(clipFunction) > > clipper.Update() > > > > outData = clipper.GetOutputDataObject(0) > > out.DeepCopy(outData) > > > > I've included the state file and a dataset to test with. make sure to set > the path to the dataset when loading the state file. > > You may also want to take a look into the resample with dataset solution. > > Best regards, > > > Mathieu Westphal > > > > On Wed, Apr 25, 2018 at 11:14 AM, Caffagni, Andrea < > andrea.caffa...@ferrari.com> wrote: > > Thank you Mathieu for your answer, > > When I tries your filter I obtain ‘an intersection’ between the sphere and > my domain. > > While the result that I would get is a clipped domain, I have included a > Statefile for demonstration on what I would get. > > Maybe I'm using your filter in a wrong way? > > > > Best Regards, > > Andrea > > > > *From:* Mathieu Westphal [mailto:mathieu.westp...@kitware.com] > *Sent:* Wednesday, April 25, 2018 10:13 > *To:* Caffagni, Andrea > *Cc:* paraview@public.kitware.com > *Subject:* Re: [Paraview] Clip a domain using a close surface > > > > Hi Andrea, > > This is achievable using a Programmable Filter, with the following script > : > > inpMain = self.GetInputDataObject( 0, 0 ) > > inpCut = self.GetInputDataObject( 0, 1 ) > > out = self.GetOutput() > > > > cutter = vtk.vtkCutter() > > cutter.SetInputDataObject( inpMain ) > > cutFunction = vtk.vtkImplicitPolyDataDistance() > > cutFunction.SetInput( inpCut ) > > cutter.SetCutFunction( cutFunction ) > > cutter.Update() > > > > outData = cutter.GetOutputDataObject( 0 ) > > out.DeepCopy(outData) > > (thanks @Yves Roger for providing it here : > https://public.kitware.com/pipermail/paraview/2015-April/033903.html) > > In case you do not know how to use the programmable filter in this case, I > have included a StateFile that demonstrate it. > Notice that we are using an "output data type : vtkPolyData". > > Best regards, > > > > > Mathieu Westphal > > > > On Wed, Apr 25, 2018 at 7:49 AM, Caffagni, Andrea < > andrea.caffa...@ferrari.com> wrote: > > Nobody has had to face this problem in the past? Is it an impassable > obstacle to paraview at the moment? > > > > Best Regards, > > Andrea > > > > *From:* ParaView [mailto:paraview-boun...@public.kitware.com] *On Behalf > Of *Caffagni, Andrea > *Sent:* Sunday, April 22, 2018 12:32 > *To:* paraview@public.kitware.com > *Subject:* [Paraview] Clip a domain using a close surface > > > > Dear users, > > I need to clip a domain with a close surface. > > More in details I have a cfd domain with pressure and velocity field, I > import a table of point and I create a closed surface using delunay3d > filters. > > At this stage, I would clip the computational domain using the close > surface dividing the cfd domain or in the internal part of the close > surface or in the external part. > > > > I have tried using clip with scalars, but I am not able to understand how > use it properly. > > > > Thanks for the suggestions, > > Andrea > > ____________________________________________________________ > _____________________________________________________ > > > > Questo messaggio è da intendersi esclusivamente ad uso del destinatario e > può contenere informazioni che sono di natura privilegiata, confidenziale o > non divulgabile secondo le leggi vigenti. Se il lettore del presente > messaggio non è il destinatario designato, o il dipendente/agente > responsabile per la consegna del messaggio al destinatario designato, si > informa che ogni disseminazione, distribuzione o copiatura di questa > comunicazione è vietata anche ai sensi della normativa vigente in materia > di protezione dei dati personali. Se avete ricevuto questo messaggio per > errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di > risposta e successivamente di procedere alla cancellazione di questa e-mail > e relativi allegati dal vostro sistema. > > ____________________________________________________________ > _____________________________________________________ > > > > This message is intended only for the use of the addressee and may contain > information that is privileged, confidential and exempt from disclosure > under applicable law. If the reader of this message is not the intended > recipient, or the employee or agent responsible for delivering the message > to the intended recipient, you are hereby notified that any dissemination, > distribution or copying of this communication is prohibited under the > applicable data protection law. If you have received this e-mail by > mistake, please notify us immediately by return e-mail and delete this > e-mail and all attachments from your system. > > > > ____________________________________________________________ > _____________________________________________________ > > ____________________________________________________________ > _____________________________________________________ > > > > Questo messaggio è da intendersi esclusivamente ad uso del destinatario e > può contenere informazioni che sono di natura privilegiata, confidenziale o > non divulgabile secondo le leggi vigenti. Se il lettore del presente > messaggio non è il destinatario designato, o il dipendente/agente > responsabile per la consegna del messaggio al destinatario designato, si > informa che ogni disseminazione, distribuzione o copiatura di questa > comunicazione è vietata anche ai sensi della normativa vigente in materia > di protezione dei dati personali. Se avete ricevuto questo messaggio per > errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di > risposta e successivamente di procedere alla cancellazione di questa e-mail > e relativi allegati dal vostro sistema. > > ____________________________________________________________ > _____________________________________________________ > > > > This message is intended only for the use of the addressee and may contain > information that is privileged, confidential and exempt from disclosure > under applicable law. If the reader of this message is not the intended > recipient, or the employee or agent responsible for delivering the message > to the intended recipient, you are hereby notified that any dissemination, > distribution or copying of this communication is prohibited under the > applicable data protection law. If you have received this e-mail by > mistake, please notify us immediately by return e-mail and delete this > e-mail and all attachments from your system. > > > > ____________________________________________________________ > _____________________________________________________ > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensou > rce/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: > https://public.kitware.com/mailman/listinfo/paraview > > > > ____________________________________________________________ > _____________________________________________________ > > > > Questo messaggio è da intendersi esclusivamente ad uso del destinatario e > può contenere informazioni che sono di natura privilegiata, confidenziale o > non divulgabile secondo le leggi vigenti. Se il lettore del presente > messaggio non è il destinatario designato, o il dipendente/agente > responsabile per la consegna del messaggio al destinatario designato, si > informa che ogni disseminazione, distribuzione o copiatura di questa > comunicazione è vietata anche ai sensi della normativa vigente in materia > di protezione dei dati personali. Se avete ricevuto questo messaggio per > errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di > risposta e successivamente di procedere alla cancellazione di questa e-mail > e relativi allegati dal vostro sistema. > > ____________________________________________________________ > _____________________________________________________ > > > > This message is intended only for the use of the addressee and may contain > information that is privileged, confidential and exempt from disclosure > under applicable law. If the reader of this message is not the intended > recipient, or the employee or agent responsible for delivering the message > to the intended recipient, you are hereby notified that any dissemination, > distribution or copying of this communication is prohibited under the > applicable data protection law. If you have received this e-mail by > mistake, please notify us immediately by return e-mail and delete this > e-mail and all attachments from your system. > > > > ____________________________________________________________ > _____________________________________________________ > > > > ____________________________________________________________ > _____________________________________________________ > > > > Questo messaggio è da intendersi esclusivamente ad uso del destinatario e > può contenere informazioni che sono di natura privilegiata, confidenziale o > non divulgabile secondo le leggi vigenti. Se il lettore del presente > messaggio non è il destinatario designato, o il dipendente/agente > responsabile per la consegna del messaggio al destinatario designato, si > informa che ogni disseminazione, distribuzione o copiatura di questa > comunicazione è vietata anche ai sensi della normativa vigente in materia > di protezione dei dati personali. Se avete ricevuto questo messaggio per > errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di > risposta e successivamente di procedere alla cancellazione di questa e-mail > e relativi allegati dal vostro sistema. > > ____________________________________________________________ > _____________________________________________________ > > > > This message is intended only for the use of the addressee and may contain > information that is privileged, confidential and exempt from disclosure > under applicable law. If the reader of this message is not the intended > recipient, or the employee or agent responsible for delivering the message > to the intended recipient, you are hereby notified that any dissemination, > distribution or copying of this communication is prohibited under the > applicable data protection law. If you have received this e-mail by > mistake, please notify us immediately by return e-mail and delete this > e-mail and all attachments from your system. > > > > ____________________________________________________________ > _____________________________________________________ >
_______________________________________________ Powered by www.kitware.com ParaView discussion is moving! Please visit https://discourse.paraview.org/ for future posts. 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: https://public.kitware.com/mailman/listinfo/paraview