Hi,<br>
as the error message says, the vtkClipPolyData needs either a clip function<br>
or input scalars. Check if your data does have vtkPointData or vtkCellData.<br>
If not, you can generate one easily thanks to vtkGenerateIndexArray.<br>
<br>
If yes, you should share your data and minimal code to people that will be<br>
able to track the bug, if it is one.<br>
<br>
Hope that helps<br>
Jerome<br><br><br><div class="gmail_quote">2011/5/19 agerlach <span dir="ltr">&lt;<a href="mailto:agerlach@gmail.com">agerlach@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
All, I have a problem that has been driving me nuts. I have an application<br>
that allows the user to select and load *.ply and *.obj files at<br>
vtkPolyData. The user can then use the vtkImageTracerWidget to circle<br>
regions on the 3D model and then compute the area of that region. This works<br>
fine when I load a *.ply file, but if I use an *.obj file of the same 3D<br>
scene I get the following errors:<br>
ERROR: In ..\..\..\..\VTK-GIT\Graphics\vtkClipPolyData.cxx, line 175<br>
vtkClipPolyData (00000000034E21E0): Cannot clip without clip function or<br>
input scalars<br>
<br>
ERROR: In ..\..\..\..\VTK-GIT\Graphics\vtkMassProperties.cxx, line 81<br>
vtkMassProperties (00000000034E5AB0): No data to measure...!<br>
<br>
I have my method for loading the model and for computing area attached<br>
below.<br>
This is driving me nuts. Is it a bug or am I missing something. I am open to<br>
any alternatives for calculating area of a user circled or highlighted<br>
region that may be better. Thanks.<br>
<br>
void vtkHelper::loadModel(QString fileLoc)<br>
{<br>
    if(fileLoc.endsWith(&quot;ply&quot;))<br>
    {<br>
        this-&gt;plyReader-&gt;SetFileName(fileLoc.toAscii());<br>
        this-&gt;plyReader-&gt;Update();<br>
        this-&gt;polyData = this-&gt;plyReader-&gt;GetOutput();<br>
    }<br>
    else if(fileLoc.endsWith(&quot;obj&quot;))<br>
    {<br>
        this-&gt;objReader-&gt;SetFileName(fileLoc.toAscii());<br>
        this-&gt;objReader-&gt;Update();<br>
        this-&gt;polyData = this-&gt;objReader-&gt;GetOutput();<br>
<br>
    }<br>
}<br>
<br>
double vtkHelper::calcSurfaceArea(vtkImageTracerWidget *trace)<br>
{<br>
    vtkSmartPointer&lt;vtkPolyData&gt; tracePolyData =<br>
vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>
    trace-&gt;GetPath(tracePolyData);<br>
<br>
    if(tracePolyData-&gt;GetNumberOfPoints() &lt; 10)<br>
        return -1;<br>
    vtkSmartPointer&lt;vtkSelectPolyData&gt; loop =<br>
vtkSmartPointer&lt;vtkSelectPolyData&gt;::New();<br>
    loop-&gt;SetInput(this-&gt;polyData);<br>
    loop-&gt;SetLoop(tracePolyData-&gt;GetPoints());<br>
    loop-&gt;SetSelectionModeToSmallestRegion();<br>
    loop-&gt;Update();<br>
<br>
    vtkSmartPointer&lt;vtkClipPolyData&gt; clip =<br>
vtkSmartPointer&lt;vtkClipPolyData&gt;::New();<br>
    clip-&gt;SetInput(loop-&gt;GetOutput());<br>
    clip-&gt;Update();<br>
<br>
    vtkSmartPointer&lt;vtkMassProperties&gt; mass =<br>
vtkSmartPointer&lt;vtkMassProperties&gt;::New();<br>
    mass-&gt;SetInput(clip-&gt;GetOutput());<br>
<br>
    return mass-&gt;GetSurfaceArea();<br>
}<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Weird-vtkClipPolyData-error-when-using-an-obj-tp4408314p4408314.html" target="_blank">http://vtk.1045678.n5.nabble.com/Weird-vtkClipPolyData-error-when-using-an-obj-tp4408314p4408314.html</a><br>

Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>