[vtkusers] how to write an unstructured grid into a stl file

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Sun Nov 13 10:55:11 EST 2016


vtkDataSetSurfaceFilter is indeed the way to go. You should be able to set
an unstructrued grid as input. Not sure why it didn't work for you? Doesn't
the following code work:

vtkUnstructuredGrid* ug = ...
vtkDataSetSurfaceFilter* dsf = ...
dsf->SetInputDataObject(ug);

Utkarsh

On Sun, Nov 13, 2016 at 5:20 AM, Reza Faieghi <mfaieghi at westerneng.ca>
wrote:

> Hello,
>
> I am wondering is there a way to write an unstructured grid into
> an STL file?
>
> I am not sure if this is correct but I realized that for writing
> into an STL file, I have to create a triangle filter from my geometry. And,
> to create the triangle filter, I need to extract surface of my unstructured
> grid. I tried to use vtkDataSetSurfaceFilter for this purpose, but I was
> not able to set an input to an instance of this class from a
> vtkUnstructuredGrid.
>
> I am not sure if my approach is correct. I would be really grateful if you
> have any idea how to solve this.
>
> Many Thanks,
> Reza
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161113/b875e799/attachment.html>


More information about the vtkusers mailing list