<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-AU link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I am using the latest nightly build (</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>13-Oct-2002</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>). </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I seem to be unable to reconstruct a surface using vtkSurfaceReconstructionFilter
in C++ with the following code:</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>// Filled a vtkPolyData structure with points from<br>
//$VTK_DATA_ROOT/Data/cactus.3337.pts.</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> nPts
= polyData->GetNumberOfPoints(); </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// A nPts = 3337 points</span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> polyData->GetBounds(bounds);</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> polyData->Modified();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> surf->SetInput(
polyData );</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> surf->Update();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> nPts
= ((vtkDataSet * )surf->GetOutput())->GetNumberOfPoints();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// B nPts = 75760 points</span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> ((vtkDataSet
* )surf->GetOutput())->GetBounds(bounds);</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// Contour at 0 to extract the surface.</span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> vtkContourFilter
* cf = vtkContourFilter::New();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> cf->SetInput(
(vtkDataSet * )surf->GetOutput());</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> cf->SetValue(0,0.0);</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> cf->Update();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> nPts
= cf->GetOutput()->GetNumberOfPoints();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// C nPts = 0 points</span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> cf->GetOutput()->GetBounds(bounds);</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// Sometimes the contouring algorithm can
create a volume whose gradient</span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// vector and ordering of polygon (using
the right hand rule) are </span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=green><span style='color:green'>// inconsistent. vtkReverseSense cures
this problem. </span></font></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> vtkReverseSense
* rev = vtkReverseSense::New();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> rev->SetInput(cf->GetOutput());</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> rev->ReverseCellsOn();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> rev->ReverseNormalsOn();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> rev->Update();</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> polyData->DeepCopy(rev->GetOutput());</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>This is a translation of the TCL code in the example reconstructSurface.tcl.
</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>polyData is a vtkPolyData structure filled with points from
the file $VTK_DATA_ROOT/Data/cactus.3337.pts</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>nPts at point A has the value: 3337. At B, npts = 75760,
which is expected as the surface</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>has been constructed. However at C, nPts is zero and the
bounds all have VTK_LARGE_FLOAT in them!</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The contour filter doesn’t seem to be producing any output.
</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>One oddity now is that I have had to put in the type
conversion </span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>(vtkDataSet * ) </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>at the
indicated points as a result of the VC7 compiler telling me: </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=1 face="Courier New"><span
style='font-size:8.0pt;font-family:"Courier New"'>'vtkDataSetToPolyDataFilter::SetInput'
: cannot convert parameter 1 from 'vtkImageData *' to 'vtkDataSet *'</span></font></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:8.0pt;
font-family:"Courier New"'> Types
pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or
function-style cast</span></font></p>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:8.0pt;
font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I thought that vtkContourFilter takes any dataset (and this
is supported by the documentation).</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>This type conversion did not have to be specified in the
older nightly builds ( before August).</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Another oddity is that the TCL example code works OK ( I am
using TCL8.4.0).</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Can someone please help?</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> Andrew</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>___________________________________________</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Andrew J. P. Maclean</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Postal:</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Australian Centre for Field Robotics</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>The Rose Street Building J04</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>The </span></font>University of Sydney 2006 NSW</p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>AUSTRALIA</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Room: 106</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Phone: +61 2 9351 3283</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Fax: +61 2 9351 7474</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> http://www.acfr.usyd.edu.au/</span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>___________________________________________</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
</div>
</body>
</html>