<div dir="ltr"><div class="gmail_default" style="font-size:small">These examples will help you.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/CurvatureBandsWithGlyphs/">https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/CurvatureBandsWithGlyphs/</a><br></div><div class="gmail_default"><br></div><div class="gmail_default"><a href="https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/ElevationBandsWithGlyphs/">https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/ElevationBandsWithGlyphs/</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">The idea is to use a banded contour filter along with an indexed lookup table.</div><div class="gmail_default"><br></div><div class="gmail_default">Regards</div><div class="gmail_default">   Andrew</div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>---------- Forwarded message ----------<br>From: Polly Lina <<a href="mailto:polly_sukting@hotmail.com">polly_sukting@hotmail.com</a>><br>To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>Cc: <br>Bcc: <br>Date: Wed, 31 Jan 2018 10:29:13 -0700 (MST)<br>Subject: [vtkusers] How to apply different colours to the extracted mean curvature in vtkcurvature<br>I am applying vtkCurvature "SetCurvatureToMean" to extract the 3D face<br>
polydata.<br>
My question is:<br>
Can anyone please help me on how can I apply different colours to the<br>
extracted dataset by giving a mean curvature threshold.  Eg: The values ><br>
0.05 label the surface to black, the values <=0.05 label the surface to<br>
red..etc<br>
<br>
This is my code:<br>
vtkCurvatures> meanCurve = vtkCurvatures::New();<br>
        meanCurve->SetInputConnection(<wbr>reader->GetOutputPort());<br>
        meanCurve-><wbr>SetCurvatureTypeToMean();<br>
        meanCurve->Update();<br>
<br>
vtkLookupTable* lut = vtkLookupTable::New();<br>
        lut->SetNumberOfColors(2);<br>
<br>
double H;<br>
        for (int i = 0; i < nOfPnts; i++)<br>
        {<br>
                H =<br>
(double)meanCurve->GetOutput()<wbr>->GetPointData()->GetScalars()<wbr>->GetTuple1(i);<br>
                if (H >= 0.05)<br>
                {<br>
                        lut->SetTableValue(0.0, 0.0, 0.0, 1);<br>
                }<br>
                else<br>
                {<br>
                        lut->SetTableValue(1.0, 1.0, 1.0, 1);<br>
                }<br>
        }<br>
lut->Build();<br>
<br>
I could only get partially coloured and it is not what i expected.<br>
Thanks and helps are so much appreciated!<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/VTK-Users-f1224199.html</a><br>
<br>
<br><br></blockquote></div>-- <br><div class="gmail_signature">___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________</div>
</div></div>