<html><div style='background-color:'><DIV>
<P>Alex,</P>
<P>Yes the vtk strategy of sampling a grid is going to get very expensive if you need high resolution on large models. But the size of the offset should not matter. If you get acceptable results at one offset distance, you should get the same at any offset. The surface is just in a different location, but will be sampled with the same resolution. So your choice of spacing <= offset just happened to be a good choice for resolving your surface, at a different offset you should get equally good results with the same spacing. You could even try some lower spacings and find a good balance between execution time and resolution.</P>
<P>Having said all that, the adaptive polygonization algorithm by Velho (and there are others) should be a more efficient way to obtain a surface from an implicit function. The vtk strength is is in its generality. Because you are pushing the limits of what can be done efficiently in vtk, the adaptive algorithm might be a good way to go.</P>
<P> regards</P>
<P> Dave Pont</P>
<P>>From: Alexander Trum <A.TRUM@TERAPORT.DE></P></DIV>
<DIV></DIV>>To: David Pont <DAVID_PONT@HOTMAIL.COM>, "vtkusers@public.kitware.com" <VTKUSERS@PUBLIC.KITWARE.COM>
<DIV></DIV>>Subject: Re: [vtkusers] Problem when creating an offset polygonal model
<DIV></DIV>>Date: Fri, 22 Mar 2002 16:39:37 +0100
<DIV></DIV>>
<DIV></DIV>>Hello
<DIV></DIV>>
<DIV></DIV>>Thanks a lot David for your tip.
<DIV></DIV>>I will try this algorithm after my vacation.
<DIV></DIV>>
<DIV></DIV>>But another question:
<DIV></DIV>>Regarding your tip i have choosen a spacing (= resolution of the
<DIV></DIV>>sampling grid) equal or smaller the offset value.
<DIV></DIV>>The results are now great and without holes!
<DIV></DIV>>But what should i do when the offset value is 0.1 millimetre or even
<DIV></DIV>>negative (shrink a polygonal model)?
<DIV></DIV>>With small offset values and big polygonal models limitation are soon
<DIV></DIV>>reached.
<DIV></DIV>>E. g. offset value of 0.1 and bounds of polygonal model 700x600x500
<DIV></DIV>>
<DIV></DIV>>David: Do you know if the algorithm you mentioned can handle this?
<DIV></DIV>>
<DIV></DIV>>Thanks in advance,
<DIV></DIV>> Alex
<DIV></DIV>>
<DIV></DIV>>David Pont schrieb:
<DIV></DIV>> >
<DIV></DIV>> > Alex,
<DIV></DIV>> >
<DIV></DIV>> > I think higher sample dimensions will give you better resolution, at
<DIV></DIV>> > the cost of much longer execution time. Because vtkImplitiModeller
<DIV></DIV>> > samples on a rectilinear grid there will be aliasing artefacts at any
<DIV></DIV>> > level of sample dimensions, they will just get less noticeable at
<DIV></DIV>> > higher sampling rates.
<DIV></DIV>> >
<DIV></DIV>> > As far as I know implicit surfaces in vtk can only be polygonised by
<DIV></DIV>> > sampling on a grid, and then contouring an isosurface. This gets quite
<DIV></DIV>> > expensive as low detail areas must be oversampled to get acceptable
<DIV></DIV>> > resolution in high detail areas, and a lot of dead space is sampled.
<DIV></DIV>> >
<DIV></DIV>> > A class that efficiently polygonises an implicit surface would be very
<DIV></DIV>> > useful in this situation. Check out the following:
<DIV></DIV>> >
<DIV></DIV>> > http://www.visgraf.impa.br/Projects/simple/java/
<DIV></DIV>> >
<DIV></DIV>> > This does adaptive polygonisation, meaning more polygons are used
<DIV></DIV>> > where required. This works very well on complex shapes (the sphere is
<DIV></DIV>> > not a great example), the user can control the desired level of
<DIV></DIV>> > detail, and execution time is relatively very fast compared to a
<DIV></DIV>> > sampling approach. C source code is provided, so this could be used to
<DIV></DIV>> > develop a really useful new vtk class.... Are you feeling
<DIV></DIV>> > adventurous...?
<DIV></DIV>> >
<DIV></DIV>> > regards
<DIV></DIV>> >
<DIV></DIV>> > Dave Pont
<DIV></DIV>> >
<DIV></DIV>> > >From: Alexander Trum
<DIV></DIV>> >
<DIV></DIV>> > >To: "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
<DIV></DIV>> > 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
<DIV></DIV>> > 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></DIV>> > ----------------------------------------------------------------------
<DIV></DIV>> > Get your FREE download of MSN Explorer at http://explorer.msn.com.
<DIV></DIV>><< a.trum.vcf >>
<DIV></DIV></div><br clear=all><hr>Send and receive Hotmail on your mobile device: <a href='http://g.msn.com/1HM304201/z'>Click Here</a><br></html>