<div dir="ltr">Dear Casey, Aashish,<div>The duplicated vertices works good. I use a <span style="font-family:arial,sans-serif;font-size:13px">vtkShrinkFilter on the polydata before set scalar of points. </span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Then re-generate the color table to contain same number of tuples with the point number of the new polydata.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">After that just setScalar as normal. I get a result as colored faces.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">That did solved my problem, Thank you all very much. ; )</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">Bo Yu</font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 4, 2014 at 1:12 AM, Casey Goodlett <span dir="ltr"><<a href="mailto:casey.goodlett@kitware.com" target="_blank">casey.goodlett@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Bo,<br><br>Try running vtkShrinkFilter with a scale factor of 1.0 prior to cell data to point data. This should create the necessary duplicate vertices.<br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Mar 3, 2014 at 11:01 AM, Bo Yu <span dir="ltr"><<a href="mailto:yubo1983@gmail.com" target="_blank">yubo1983@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, the colors are blended. Thank you, <span></span>It sounds reasonable to color duplicate points of the triangles, but is that means I have to regenerate the polydata? I will try it tomorrow (Tokyo time ;) <div>
<div><div><br></div>
<div>Bo Yu <br><br>On Tuesday, March 4, 2014, Casey Goodlett <<a href="mailto:casey.goodlett@kitware.com" target="_blank">casey.goodlett@kitware.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Is the problem that colors are being blended across the triangles? If so, you need to duplicate the vertices such that each triangle is defined by three unique vertices (its ok to have multiple vertices with the same XYZ locations).<br>
<br></div>Let me know if that makes sense.<br><br></div>Thanks<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 3, 2014 at 10:48 AM, Bo Yu <span dir="ltr"><<a>yubo1983@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you for your information, Casey, the color do appear, but it seems that was colored "vertex by vertex", not as I expected: "cell by cell".<div>
<div>I am using bitbucket with my colleagures. I'll try to <span></span>create a new repo in github to let you see.</div><span><font color="#888888">
<div><br></div>Bo Yu</font></span><div><div><br><div><br>On Tuesday, March 4, 2014, Casey Goodlett <<a>casey.goodlett@kitware.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 3, 2014 at 12:42 AM, Bo Yu <span dir="ltr"><<a>yubo1983@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>pd->GetPointData()->SetScalars(colorTable);//color works like on each vertexes and scalar, color table is an vtkUnsignedCharArray which contains same tuples as vertexes number.</div>
<div>//pd->GetCellData()->SetScalars(colorTable);//no color at all, color table is an vtkUnsignedCharArray which contains same tuples as cells number.</div><div><div> </div></div></blockquote></div><br>
</div><div class="gmail_extra">Bo,<br><br></div><div class="gmail_extra">Once you you run the filter you should not overwrite the scalars as done on these lines.<br><br>If you already built your colorTable for the vertices you dont need to use the CellDataToPointData filter at all just set directly as point data.<br>
<br></div><div class="gmail_extra">Is your problem that colors dont appear or they are not as you intended?<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Can you share how you have constructed your colorTable? Is your code anywhere public like github that we could look at?<br>
</div><div class="gmail_extra"><br clear="all"></div><div class="gmail_extra">Thanks<br></div><div class="gmail_extra"><br>-- <br>Casey B. Goodlett, Ph.D.<br>R&D Engineer<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
<a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a>
</div></div>
</blockquote></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Casey B. Goodlett, Ph.D.<br>R&D Engineer<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br><a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a>
</div>
</blockquote></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Casey B. Goodlett, Ph.D.<br>R&D Engineer<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
<a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a>
</div>
</div></div></blockquote></div><br></div>