<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:0in;
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;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Hi, thanks for the advice. I’ve
tried vtkLODActor but it doesn’t seem to have much effect. The same goes
for the specialised contour filters, vtkMarchingContourFilter, vtkMarchingCubes,
vtkKitwareContourFilter. I’ve also tried</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"'>vtkTriangleFilter and vtkStripper.
I need to keep the sampling at least 50*50*50 because at anything less than
that, the</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"'>rendered shape is very
distorted. Are you suggesting that I write my own SampleFunction? I’m not
very sure how to do that.</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"'>Can I view some sample code
that you used for implicit polygonization? Would really appreciate it. Thanks. </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"'>Hi,</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"'> My guess is
that vtkSampleFunction is the part that takes the most t= ime. You use SetSampleDimensions
to define the number of samples, for exampl= e 50*50*50 =3D 125,000 samples.
Your implicit function EvaluateFunction w= ill be called for each of these, and
I see your EvaluateFunction uses exp and sqrt. This volume is then contoured to
produce a surface, the contouring algorithms are relatively efficient, but this
might be the next slowest part.</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"'>If you use smaller SampleDimensions
you will note a dramatic (exponential) increase in speed, but you will also
notice a poor representation of the surface. The problem with vtkSampleFunction
is that in order to sample = the surface at high resolution you have to sample
a lot of dead space away = from the surface.</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"'>A basic design philosophy in
vtk is to favour generality in algorithms, for good reason. Producing a volume
(structured points) from an implicit function is smart because there are many vtk
classes that can be used on this type of data. Check the literature and you
will find examples of 'fast' algorithms for creating implicit surfaces (Google
'implicit polygon'). I played around with implicit polygonization by Velho
(source code available off the internet) some years back, but never had a real
need for it. The vtk philosophy would encourage you to implement a faster but
more specialised algorithm... (and would encourage you to contribute it back=</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"'>;-P). Take a look at the
documentation for vtkContourFilter and note th= e 'See also' for an example of
a generic algorithm and its more specialis= ed friends. So how are your C++
skills? they look just fine from your example code.= You could implement
a new vtk class to do fast polygonization of implicit surfaces in a few days...
and have interactive blobs.</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"'>The only other way around
might be to use vtkLODActor and feed it one (= or more) low resolution (low SampleDimensions)
pipelines and one at the desired resolution... ??</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"'>regards</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"'> Dave P.</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
</div>
</body>
</html>