[vtkusers] Problem when creating an offset polygonal model

Alexander Trum a.trum at teraport.de
Fri Mar 22 10:39:37 EST 2002


Hello

Thanks a lot David for your tip.
I will try this algorithm after my vacation.

But another question:
Regarding your tip i have choosen a spacing (= resolution of the
sampling grid) equal or smaller the offset value.
The results are now great and without holes!
But what should i do when the offset value is 0.1 millimetre or even
negative (shrink a polygonal model)?
With small offset values and big polygonal models limitation are soon
reached.
E. g. offset value of 0.1 and bounds of polygonal model 700x600x500

David: Do you know if the algorithm you mentioned can handle this?

Thanks in advance,
  Alex

David Pont schrieb:
> 
> Alex,
> 
>   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.
> 
> 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.
> 
> A class that efficiently polygonises an implicit surface would be very
> useful in this situation. Check out the following:
> 
> http://www.visgraf.impa.br/Projects/simple/java/
> 
> 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...?
> 
>  regards
> 
>     Dave Pont
> 
> >From: Alexander Trum
> 
> >To: "vtkusers at public.kitware.com"
> >Subject: [vtkusers] Problem when creating an offset polygonal model
> >Date: Thu, 21 Mar 2002 16:47:50 +0100
> >
> >Hello
> >
> >I'm reading in a polygonal model (a rim of a car wheel) from a STL
> file.
> >What i want is an offset polygonal model.
> >I choose an offset of 1 millimetre.
> >The dimensions of this model are round about 250*500*500 millimetres.
> >I choose sample dimensions of 50, 100, 100 so that the modelling is
> done
> >with a spacing of 5 millimetres.
> >Then i create a new polygonal surface with a contour value set to the
> >offset value.
> >But the offset polygonal model has a lot of wholes where the original
> >model has a closed surface.
> >What did i wrong?
> >
> > float offset = 1.0;
> >
> > vtkSTLReader* stlReader = vtkSTLReader::New();
> > stlReader->SetFileName("/tmp/rim.stl");
> > stlReader->MergingOn();
> > stlReader->Update();
> >
> > vtkImplicitModeller* implicitModeller = vtkImplicitModeller::New();
> > implicitModeller->SetInput(stlReader->GetOutput());
> > implicitModeller->SetSampleDimensions(50, 100, 100);
> > implicitModeller->Update();
> > stlReader->Delete(); stlReader = NULL;
> >
> > vtkContourFilter* contourFilter = vtkContourFilter::New();
> > contourFilter->SetInput(implicitModeller->GetOutput());
> > contourFilter->SetValue(0, offset);
> > contourFilter->Update();
> > implicitModeller->Delete(); implicitModeller = NULL;
> >
> > vtkSTLWriter* stlWriter = vtkSTLWriter::New();
> > stlWriter->SetFileName("/tmp/offset_rim.stl");
> > stlWriter->SetInput(contourFilter->GetOutput());
> > stlWriter->Write();
> > contourFilter->Delete(); contourFilter = NULL;
> > stlWriter->Delete(); stlWriter = NULL;
> >
> >
> >Thanks in advance,
> > Alex
> ><< a.trum.vcf >>
> 
> ----------------------------------------------------------------------
> Get your FREE download of MSN Explorer at http://explorer.msn.com.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.trum.vcf
Type: text/x-vcard
Size: 409 bytes
Desc: Karte für Alexander Trum
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020322/3d9fb08f/attachment.vcf>


More information about the vtkusers mailing list