<html><div style='background-color:'><DIV>
<P>Alex,</P>
<P> I think higher sample dimensions will give you better resolution, at the cost of much longer execution time. Because vtkImplitiModeller samples on a rectilinear grid there will be aliasing artefacts at any level of sample dimensions, they will just get less noticeable at higher sampling rates.</P>
<P>As far as I know implicit surfaces in vtk can only be polygonised by sampling on a grid, and then contouring an isosurface. This gets quite expensive as low detail areas must be oversampled to get acceptable resolution in high detail areas, and a lot of dead space is sampled. </P>
<DIV></DIV>
<DIV></DIV>
<P>A class that efficiently polygonises an implicit surface would be very useful in this situation. Check out the following:</P>
<P><A href="http://www.visgraf.impa.br/Projects/simple/java/">http://www.visgraf.impa.br/Projects/simple/java/</A></P>
<P>This does adaptive polygonisation, meaning more polygons are used where required. This works very well on complex shapes (the sphere is not a great example), the user can control the desired level of detail, and execution time is relatively very fast compared to a sampling approach. C source code is provided, so this could be used to develop a really useful new vtk class.... Are you feeling adventurous...?</P>
<P> regards</P>
<P> Dave Pont</P>
<P>>From: Alexander Trum <A.TRUM@TERAPORT.DE></P></DIV>
<DIV></DIV>>To: "vtkusers@public.kitware.com" <VTKUSERS@PUBLIC.KITWARE.COM>
<DIV></DIV>>Subject: [vtkusers] Problem when creating an offset polygonal model
<DIV></DIV>>Date: Thu, 21 Mar 2002 16:47:50 +0100
<DIV></DIV>>
<DIV></DIV>>Hello
<DIV></DIV>>
<DIV></DIV>>I'm reading in a polygonal model (a rim of a car wheel) from a STL file.
<DIV></DIV>>What i want is an offset polygonal model.
<DIV></DIV>>I choose an offset of 1 millimetre.
<DIV></DIV>>The dimensions of this model are round about 250*500*500 millimetres.
<DIV></DIV>>I choose sample dimensions of 50, 100, 100 so that the modelling is done
<DIV></DIV>>with a spacing of 5 millimetres.
<DIV></DIV>>Then i create a new polygonal surface with a contour value set to the
<DIV></DIV>>offset value.
<DIV></DIV>>But the offset polygonal model has a lot of wholes where the original
<DIV></DIV>>model has a closed surface.
<DIV></DIV>>What did i wrong?
<DIV></DIV>>
<DIV></DIV>> float offset = 1.0;
<DIV></DIV>>
<DIV></DIV>> vtkSTLReader* stlReader = vtkSTLReader::New();
<DIV></DIV>> stlReader->SetFileName("/tmp/rim.stl");
<DIV></DIV>> stlReader->MergingOn();
<DIV></DIV>> stlReader->Update();
<DIV></DIV>>
<DIV></DIV>> vtkImplicitModeller* implicitModeller = vtkImplicitModeller::New();
<DIV></DIV>> implicitModeller->SetInput(stlReader->GetOutput());
<DIV></DIV>> implicitModeller->SetSampleDimensions(50, 100, 100);
<DIV></DIV>> implicitModeller->Update();
<DIV></DIV>> stlReader->Delete(); stlReader = NULL;
<DIV></DIV>>
<DIV></DIV>> vtkContourFilter* contourFilter = vtkContourFilter::New();
<DIV></DIV>> contourFilter->SetInput(implicitModeller->GetOutput());
<DIV></DIV>> contourFilter->SetValue(0, offset);
<DIV></DIV>> contourFilter->Update();
<DIV></DIV>> implicitModeller->Delete(); implicitModeller = NULL;
<DIV></DIV>>
<DIV></DIV>> vtkSTLWriter* stlWriter = vtkSTLWriter::New();
<DIV></DIV>> stlWriter->SetFileName("/tmp/offset_rim.stl");
<DIV></DIV>> stlWriter->SetInput(contourFilter->GetOutput());
<DIV></DIV>> stlWriter->Write();
<DIV></DIV>> contourFilter->Delete(); contourFilter = NULL;
<DIV></DIV>> stlWriter->Delete(); stlWriter = NULL;
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Thanks in advance,
<DIV></DIV>> Alex
<DIV></DIV>><< a.trum.vcf >>
<DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://g.msn.com/1HM304201/y'>http://explorer.msn.com</a>.<br></html>