[vtkusers] the code always crash
Ali Habib
ali.mahmoud.habib at gmail.com
Tue Oct 13 17:33:17 EDT 2009
this code for create mesh it always give bug and error that vtkinttype can't
load the elements
I tried to remove Delaunary part , but the same error , I have 4 GB ram ,
and I used GetActualMemorySize( ) to get the actual used RAM
the code is :
ren1 = gcnew vtk::vtkRenderer();
renwM = r;
renwM::AddRenderer(ren1);
iren::SetRenderWindow(renwM);
vtk::vtkMarchingCubes ^mcubes = gcnew vtk::vtkMarchingCubes();
mcubes->GetOutput()->ReleaseDataFlagOff();
mcubes->SetInput(VoxelData);
mcubes->SetValue(0, 4);
mcubes->ComputeGradientsOn();
mcubes->Update();
vtk::vtkSmoothPolyDataFilter ^smoother = gcnew
vtk::vtkSmoothPolyDataFilter();
smoother->GetOutput()->ReleaseDataFlagOff();
smoother->SetInput(mcubes->GetOutput());
smoother->SetNumberOfIterations(5);
smoother->SetRelaxationFactor(0.70);
smoother->SetFeatureAngle(70);
smoother->FeatureEdgeSmoothingOn();
smoother->BoundarySmoothingOn();
smoother->Update();
vtk::vtkPolyDataNormals ^normals = gcnew vtk::vtkPolyDataNormals();
normals->GetOutput()->ReleaseDataFlagOff();
normals->SetInput(smoother->GetOutput());
normals->SetFeatureAngle(80);
normals->Update();
vtk::vtkDelaunay3D ^delaunay4 = gcnew vtkDelaunay3D();
try
{
delaunay4->SetInputConnection(normals->GetOutputPort());
delaunay4->Update();
}
catch(System::Exception ^ex)
{
MessageBox::Show(ex->Message);
}
vtkDataSetMapper ^mapper = gcnew vtk::vtkDataSetMapper();
mapper->SetInputConnection(delaunay4->GetOutputPort());
vtkActor ^actor = gcnew vtk::vtkActor();
actor->SetMapper(mapper);
actor->GetProperty()->SetRepresentationToWireframe();
ren1::AddActor(actor);
renwM::Render();
iren->Initialize();
iren::Enable();
I used getactualmemorysize and numberofcells and numberof point:
at marching, till normal steps I have 23799 kb , 6608388 cells , and 3306508
points ,a ny suggestions please
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091013/17308eb5/attachment.htm>
More information about the vtkusers
mailing list