[vtkusers] Soild *.stl format needed.

anast.jm at pg.com anast.jm at pg.com
Mon Feb 24 10:01:44 EST 2003


Yes, this is true, if you make surfaces from height maps for instance, you 
need to extrude the surface to get a machineable volume file. I used 
vtkLinearExtrusionFilter to do this. The only down side is that the bottom 
of the volume is bottom of the top surface so its not flat. That wasn't a 
problem for me but some type of cutting plane might be needed to make a 
flat bottom to the piece if required. I have a tcl example if 
interested.......john





Internet Mail Message
Received from host: 



Rasmus Reinhold Paulsen <rrp at imm.dtu.dk>
                        Sent by: vtkusers-admin at public.kitware.com
02/24/2003 09:08 AM

 
               To:      "Lorensen, William E (Research)" <lorensen at crd.ge.com>
        cc:     "'#YAN RI AN#'" <yanrian at pmail.ntu.edu.sg>, vtk users 
<vtkusers at public.kitware.com>, (bcc: John Anast-JM/PGI)
        Subject:        RE: [vtkusers] Soild *.stl format needed.

Hi Bill and Yan,

I think that the machine needs some kind of thickness of the shell?

So I believe that what is needed here is a post-processing with some kind
of "shelling" algorithm. That is an algorithm that produces an offset
surface and connects it with the original surface to produce a watertight
shell with a thickness.

If I am completely wrong or if there is another solution please tell me.

Regards,
Rasmus


On Mon, 24 Feb 2003, Lorensen, William E (Research) wrote:

> You should be able to use the stl file to create rapid prototypes. We 
have done it many times.
> 
> Bill
> 
> -----Original Message-----
> From: #YAN RI AN# [mailto:yanrian at pmail.ntu.edu.sg]
> Sent: Monday, February 24, 2003 2:06 AM
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] Soild *.stl format needed.
> 
> 
> 
> Dear All vtk users:
> I need Solid *.stl format model for the rapid prototyping technology.
> the MarchingCubes Algorithm only got isosurface *.stl format only.
> I do not know how to solve the proplem.
> Could any experts help me?
> Here is my program:
> 
>  //main program:
>     vtkVolume16Reader *v16=vtkVolume16Reader::New();
>     v16->SetDataDimensions(64,64);
>     v16->GetOutput()->SetOrigin(0,0,0);
>     v16->SetDataByteOrderToLittleEndian();
>     v16->SetFilePrefix("c:/Vtkdata/Data/headsq/quarter");
>     v16->SetImageRange(1,93);
>     v16->SetDataSpacing(3.2,3.2,1.5);
>     v16->Update();//put the image into memory
> 
>     vtkMarchingCubes *iso=vtkMarchingCubes::New();
>     iso->SetInput(v16->GetOutput());
>     iso->SetValue(0,1150);
>     iso->ComputeGradientsOn();
>     iso->ComputeScalarsOff();
> 
>     vtkPolyDataMapper *isoMapper=vtkPolyDataMapper::New();
>     isoMapper->SetInput(iso->GetOutput());
>     isoMapper->ScalarVisibilityOn();
>     isoMapper->ImmediateModeRenderingOn();
> 
> 
>     vtkActor *isoActor=vtkActor::New();
>     isoActor->SetMapper(isoMapper);
>     isoActor->GetProperty()->SetColor(1,1,1);
> 
> // Add the actors to the renderer, set the background and size
>      vtkRenderer *ren1 = vtkRenderer::New();
>      ren1->AddActor(isoActor);
>      ren1->SetBackground(0,0,1);
> 
>     vtkRenderWindow *renWin = vtkRenderWindow::New();
>     renWin->AddRenderer(ren1);
>     renWin->SetSize(600,600);
> 
>   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>   iren->SetRenderWindow(renWin); 
> 
> 
>   //
>   //STL OutPut
>    vtkTriangleFilter *triangles=vtkTriangleFilter::New();
>    triangles->SetInput(iso->GetOutput());
> 
>   vtkDecimatePro *decimate=vtkDecimatePro::New();
>   decimate->SetInput(triangles->GetOutput());
>   decimate-> SetTargetReduction(0.9);
>   decimate-> PreserveTopologyOn(); 
> 
>    vtkSTLWriter *stl=vtkSTLWriter::New();
>    stl->SetInput(decimate->GetOutput());
>    stl->SetFileName("head.stl");
>    stl->Write();
>    // 
>   renWin->Render();
>   iren->Start();
> 
>   v16->Delete();
>   iso->Delete();
>   isoMapper->Delete();
>   isoActor->Delete();
> 
>   ren1->Delete();
>   renWin->Delete();
>   iren->Delete();
> 
>   triangles->Delete();
>   decimate->Delete();
>   stl->Delete();
> 
>   return 0;
> }

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: 
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030224/d3f573e1/attachment.htm>


More information about the vtkusers mailing list