[Fwd: Re: [vtkusers] How can I use vtkPolyData as a Implicit function ofvtkClipPolyData?]

David Pont david_pont at hotmail.com
Tue Feb 26 18:20:10 EST 2002


Hi Stefano,
  I will send the source to you directly to avoid clogging up the mailing 
list. I have resolved some important issues with this class, and have 
updated the notes on how to use it as a result. Recent feedback from 
Seungbum Koo and Hideaki Hiraki has been helpful, and I look forward to 
hearing about your results.
It is starting to look like a useful filter, and if it can stand up to a few 
more tests I will look at tidying the code and contributing it to VTK.
   regards
       Dave Pont.


>From: Stefano Perticoni <perticoni at tecno.ior.it>
>To: david_pont at hotmail.com
>Subject: [Fwd: Re: [vtkusers] How can I use vtkPolyData as a Implicit 
>function ofvtkClipPolyData?]
>Date: Tue, 26 Feb 2002 15:28:03 +0100
>
>David,
>
>i'll be very happy to test your vtkImplicitPolydata class since i
>need this feature right now; if you send me the .cxx and .h files
>i'm going to test your class in the next days.
>
>Thanks in advance,
>Stefano
>
>-------- Original Message --------
>Subject: Re: [vtkusers] How can I use vtkPolyData as a Implicit function
>ofvtkClipPolyData?
>Date: Wed, 20 Feb 2002 14:04:56 +1300
>From: "David Pont" <david_pont at hotmail.com>
>Reply-To: david.pont at forestresearch.co.nz
>To: koosb at stanford.edu
>CC: vtkusers at public.kitware.com
>
>Seungbum,
>   As far as I know vtkImplicitDataSet will not help you clip polydata
>with
>polydata, not directly anyway. I am also interested to hear if there is
>some
>way of clipping with polydata, using existing vtk classes.
>I have developed a class named vtkImplicitPolydata, which I have passed
>on
>to some people that have asked this type of question, I can send it to
>you
>if you like. I would happily contribute the class to vtk, but it needs
>more
>work first... and I have no time at the moment...
>If any of the people that have used vtkImplicitPolydata could report
>their
>experiences, this would help me decide if it just needs fine tuning, or
>a
>bullet.
>
>   regards
>     Dave Pont
>
>
> >From: Seungbum Koo <koosb at stanford.edu>
> >To: vtkusers at public.kitware.com
> >Subject: [vtkusers] How can I use vtkPolyData as a Implicit function of
> >vtkClipPolyData?
> >Date: Tue, 19 Feb 2002 10:15:12 -0800
> >
> >Dear vtk Users,
> >
> >I'm using vtk3.2 and I have read manuals and vtkusers Archives over and
> >over but
> >I couldn't figure out how to convert my vtkPolyData into
> >vtkImplicitFunction to use
> >it in vtkClipPolyData.
> >What I want to do is clipping between a vtkPolyData and a vtkPolyData.
> >Some people made classes likes vtkImplicitPolyData but I want to do this
> >using only
> >vtk if possible, so I tried some test cases.
> >
> >First, I made one vtkSphereSource as a vtkPolyData source, and one
> >vtkSphere as a vtkImplicitFunction
> >for vtkClipPolyData. It worked fine.
> >Second, I made one vtkSphereSource as a vtkPolyData source, and another
> >vtkSphereSource and
> >filtered is using vtkImplicitDataSet to use it as a vtkImplicitFunction. 
>It
> >didnt' work and I received a
> >messages "can't evaluate function".
> >I looked into the function EvaluateFunction in vtkImplicitDataSet and it
> >couldn't evaluate
> >vtkSphereSource beacuse it didn't have scalar value. (I'm very confused
> >what the scalar
> >value should be in sphere.), So, I made some scalar values for the
> >vtkSphereSource.
> >But next, FindAndGetCell() in EvaluateFunction couldn't find any cell
> >around a point.
> >
> >Does anyone know how to do vtkClipPolyData between two vtkPolyData's like
> >this case?
> >
> >Seungbum
> >koosb at stanford.edu
> >----------------------------------------------------------------
> >Source for First case:
> >	vtkSphereSource *pSphere1 = vtkSphereSource::New();
> >	pSphere1->SetRadius(50);
> >	pSphere1->SetCenter(0,0,0);
> >	vtkSphere *pSphere2 = vtkSphere::New();
> >	pSphere2->SetRadius(50);
> >	pSphere2->SetCenter(0,0,50);
> >	vtkClipPolyData *pClip = vtkClipPolyData::New();
> >	pClip->SetInput(pSphere1->GetOutput());
> >	pClip->SetClipFunction(pSphere2);
> >	pClip->GenerateClipScalarsOn();
> >	pClip->GenerateClippedOutputOn();
> >
> >Source for Second case:
> >	vtkSphereSource *pSphere1 = vtkSphereSource::New();
> >	pSphere1->SetRadius(50);
> >	pSphere1->SetCenter(0,0,0);
> >	vtkSphereSource *pSphere2 = vtkSphereSource::New();
> >	pSphere2->SetRadius(50);
> >	pSphere2->SetCenter(0,0,50);
> >	vtkImplicitDataSet *pIdata = vtkImplicitDataSet::New();
> >	pIdata->SetDataSet(pSphere2->GetOutput());
> >	vtkClipPolyData *pClip = vtkClipPolyData::New();
> >	pClip->SetInput(pSphere1->GetOutput());
> >	pClip->SetClipFunction(pIdata);
> >	pClip->GenerateClipScalarsOn();
> >	pClip->GenerateClippedOutputOn();
> >
> >	vtkScalars pScalars = vtkScalars::New();
> >	for(int i=0; i<pSphere2->GetOutput()->GetNumberOfPoints(); i++)
> >		pScalars->InsertNextScalar(1.0);
> >	pSphere2->GetOutput()->GetPointData()->SetScalars(pScalars);
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
> ><http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>
>_________________________________________________________________
>Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com




More information about the vtkusers mailing list