[vtkusers] Soild *.stl format needed.
Rasmus Reinhold Paulsen
rrp at imm.dtu.dk
Mon Feb 24 09:08:14 EST 2003
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;
> }
More information about the vtkusers
mailing list