<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'>&nbsp;</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'>&nbsp;</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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nPts
= polyData-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polyData-&gt;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"'>&nbsp;</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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polyData-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; surf-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; surf-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nPts
= ((vtkDataSet * )surf-&gt;GetOutput())-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((vtkDataSet
* )surf-&gt;GetOutput())-&gt;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"'>&nbsp;</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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cf-&gt;SetInput(
(vtkDataSet * )surf-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cf-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cf-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nPts
= cf-&gt;GetOutput()-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cf-&gt;GetOutput()-&gt;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"'>&nbsp;</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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font
color=green><span style='color:green'>// inconsistent. vtkReverseSense cures
this problem.&nbsp; </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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rev-&gt;SetInput(cf-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rev-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rev-&gt;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rev-&gt;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"'>&nbsp;</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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polyData-&gt;DeepCopy(rev-&gt;GetOutput());</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</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&#8217;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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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"'>&nbsp;</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'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</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'>&nbsp;</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'>&nbsp;&nbsp; Andrew</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</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&nbsp; 2006&nbsp; 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'>&nbsp;</span></font></p>

<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Room:&nbsp; 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:&nbsp;&nbsp; +61 2 9351 7474</span></font></p>

<p class=MsoAutoSig><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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'>&nbsp;</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'>&nbsp;</span></font></p>

</div>

</body>

</html>