[vtkusers] Displaying multiple implicit functions

Bill Lorensen bill.lorensen at gmail.com
Tue Sep 28 23:55:28 EDT 2010


You can use ImplicitBoolean to combine multiple implicit functions.
See this example which has 2 spheres:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/ImplicitBoolean


On Tue, Sep 28, 2010 at 2:27 AM, ChiaWeng Boon <chiaweng at gmail.com> wrote:
> Hi,
>
> To display ONE implicit function F(x,y,z)=0, I use vtksamplefunction,
> as shown below. The output of vtkSampleFunction in ImageData format is
> written to a file using vtkXMLImageDataWritter.   How do I write MANY
> different implicit functions in one single file?  Put them into cells
> of unstructured grids?  If yes, how?
>
> ImpFunc* function = ImpFunc::New();
> vtkSampleFunction* sample = vtkSampleFunction::New();
> sample->SetImplicitFunction(function);
> sample->SetModelBounds(xmin, xmax, ymin, ymax, zmin, zmax);
> sample->SetSampleDimensions(20,20,20);
> sample->ComputeNormalsOff();
> sample->Update();
> vtkSmartPointer<vtkXMLImageDataWriter> writer = vtkXMLImageDataWriter::New();
> writer->SetFileName(string a);
> writer->SetInput(sample->GetOutput());
> writer->Write();
>
> I am an absolute beginner.  Showing the code that I have to write to
> solve the problem will be helpful.
>
>
> Yours,
>
> boon
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list