[vtkusers] Mesh Texture

Cory Quammen cory.quammen at kitware.com
Thu Jan 5 09:35:01 EST 2017


Hi,

Please reply-all to keep the conversation on the mailing list so that
others may benefit and contribute.

I'm not sure what is happening with the texture in the output of the
vtkCleanPolyData. Perhaps there are some points in your data that need
to remain duplicated so that different texture coordinates can be
assigned to each point to avoid undesired texture interpolation. If
that's the case, merging coincident points will necessarily pick just
one of those texture coordinates and throw away the others, making the
texturing look funny. Unfortunately, there is no way to tell
vtkCleanPolyData to not merge where a scalar value is different, but
that appears to be what you need.

If you are going to do this operation only once for the data in the
images you sent me (not attached), I would recommend skipping the
connectivity filter approach to discard the small bits near the
person's shoulders and instead use vtkClipPolyData with, say, a
vtkSphere to define the clip function around the head. This can be
done without writing code using ParaView if you prefer.

HTH,
Cory

On Thu, Jan 5, 2017 at 5:43 AM, Mohammadreza Babaee
<mrezababaee at gmail.com> wrote:
> Hi,
>
>
> So the problem is that I have a mesh with tecture that contains several
> small regiosn and I would like to remove them (Please see image1 attached to
> this email.). So my appraoch was at the beginning using
> vtkconnectivityfileter and use the largest region. However, I needed to
> first clean sthe mesh data. The problem is that after using vtkCleanpolydata
> in order to clean the mesh and then applying filtering, I get a mesh that
> looks strange when I visualize it. (Please see image2)
>
> So do you have any idea to solve this problem.
>
> Here is the code
>
> vtkSmartPointer<vtkPolyData>
> meshRemoveSmallMeshes(vtkSmartPointer<vtkPolyData> &poly_in)
> {
>
>     vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter =
> vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();
>
>     vtkSmartPointer<vtkCleanPolyData> Cleaner =
> vtkSmartPointer<vtkCleanPolyData>::New();
>
>     vtkSmartPointer<vtkPolyData> poly_out =
> vtkSmartPointer<vtkPolyData>::New();
>
>
>     Cleaner->AddInputData(poly_in);
>
>     Cleaner->Update();
>
>
>     connectivityFilter->SetInputData(Cleaner->GetOutput());
>     connectivityFilter->SetExtractionModeToLargestRegion();
>     connectivityFilter->Update();
>
>     poly_out = connectivityFilter->GetOutput();
>
>     return poly_out;
>
> }
>
>
>
> On Wed, Jan 4, 2017 at 8:09 PM, Cory Quammen <cory.quammen at kitware.com>
> wrote:
>>
>> Do you expect the merged points to have the same texture coordinates?
>> If so, you might be able to use the Resample To Dataset filter to add
>> the texture coordinates back to the cleaned polydata. Set the Input of
>> the filter to your original polydata and the Source to your cleaned
>> polydata. Does that work?
>>
>> If not, could you post a self-contained code example and small data
>> file that shows the problem you are having?
>>
>> Thanks,
>> Cory
>>
>> On Wed, Jan 4, 2017 at 10:41 AM, Mohammadreza Babaee
>> <mrezababaee at gmail.com> wrote:
>> > Dear All,
>> >
>> >
>> > I have a Polydata and after cleaning I get a new mesh but the texture of
>> > the
>> > me sh is corrupted. I guess the problem comes the fact that  the points
>> > are
>> > merged. Do you have any Idea how to apply vtkCleanpolydata to the
>> > VtkPoly
>> > data without corrupting the texture.
>> >
>> >
>> > Thanks
>> >
>> > _______________________________________________
>> > 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
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list