[vtkusers] vtkSmoothPolyDataFilter + unstructuredGrid

David Gobbi david.gobbi at gmail.com
Fri Dec 11 10:54:01 EST 2009


Hmm... if GeometryFilter keeps all the points, then it's possible that
you could generate a new vtkDataSet that combines the points from the
smoothed polydata with the cells of your grid.  Something like this:

smoothFilter->Update();
gridProducer->Update();
vtkDataSet *newdata = vtkDataSet::New();
newdata->DeepCopy(gridProducer->GetOutput());
newdata->SetPoints(smoothFilter->GetOutput()->GetPoints());

Note that code like this can crash if the assumptions aren't correct.
Also, only the outer layer of points will be smoothed, so the
resulting data object might contain invalid cells.  But still, this
should give you ideas about how to find a proper solution.

    David


On Fri, Dec 11, 2009 at 8:40 AM, Bill Chivas <noo134 at googlemail.com> wrote:
> vtkGeometryFilter works fine. I wonder if i could get back to
> unstructuredGrid and hexahedrons by using the points.
> I noticed that the number of points are the same in unstructuredGrid and
> vtkGeometryFilter (vtkPolyData).
> Could i "reproduce" the original hexahedron topology?
>
> Thanks,
> Bill
>
> 2009/12/11 David Gobbi <david.gobbi at gmail.com>
>>
>> On Fri, Dec 11, 2009 at 7:11 AM, Bill Chivas <noo134 at googlemail.com>
>> wrote:
>> > Hello all,
>> >
>> > I would like to use vtkSmoothPolyDataFilter  on an unstructuredGrid, but
>> > i
>> > read the particular filter applies only to vtkPolyData.
>> > My unstructuredGrid consists of hexahedrons.
>> > How could i use the filter?
>> > One idea i thought is to extract the surface iterately and apply to
>> > these
>> > surfaces, but i don't know if it's ok.
>>
>> I've seen some people create a "skin" polydata with vtkGeometryFilter,
>> apply the smoothing to the "skin" and then use a custom filter to
>> propagate the smoothing throughout the interior of their mesh.  The
>> vtkGeometryFilter is a basic anything-to-polydata filter, so it is
>> easy to use.  The final step of using the smoothed polydata to create
>> a smoothed mesh is nontrivial, though.
>>
>>    David
>
>



More information about the vtkusers mailing list