<div dir="ltr">this code for create mesh it always give bug and error that vtkinttype can't load the elements<div><br></div><div>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 </div>
<div>the code is :</div><div><br></div><div><div> ren1 = gcnew vtk::vtkRenderer();</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>renwM = r;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>renwM::AddRenderer(ren1);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>iren::SetRenderWindow(renwM);</div><div><br></div><div><br></div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span> vtk::vtkMarchingCubes ^mcubes = gcnew vtk::vtkMarchingCubes();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes->GetOutput()->ReleaseDataFlagOff();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes->SetInput(VoxelData);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes->SetValue(0, 4);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes->ComputeGradientsOn();</div><div>
<br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes->Update();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtk::vtkSmoothPolyDataFilter ^smoother = gcnew vtk::vtkSmoothPolyDataFilter();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->GetOutput()->ReleaseDataFlagOff();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->SetInput(mcubes->GetOutput());</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->SetNumberOfIterations(5);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->SetRelaxationFactor(0.70);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->SetFeatureAngle(70);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->FeatureEdgeSmoothingOn();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->BoundarySmoothingOn();</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother->Update();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtk::vtkPolyDataNormals ^normals = gcnew vtk::vtkPolyDataNormals();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals->GetOutput()->ReleaseDataFlagOff();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals->SetInput(smoother->GetOutput());</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals->SetFeatureAngle(80);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals->Update();</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span> vtk::vtkDelaunay3D ^delaunay4 = gcnew vtkDelaunay3D();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>try</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><br></div><div><br></div><div><br></div><div><br></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>delaunay4->SetInputConnection(normals->GetOutputPort());</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>delaunay4->Update();</div>
<div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>catch(System::Exception ^ex)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><br></div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>MessageBox::Show(ex->Message);</div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><br></div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkDataSetMapper ^mapper = gcnew vtk::vtkDataSetMapper();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>mapper->SetInputConnection(delaunay4->GetOutputPort());</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>vtkActor ^actor = gcnew vtk::vtkActor();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>actor->SetMapper(mapper);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>actor->GetProperty()->SetRepresentationToWireframe();</div>
<div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>ren1::AddActor(actor);</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>renwM::Render();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>iren->Initialize();</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>iren::Enable();</div><div><br></div><div><br>
</div><div><span class="Apple-style-span" style="font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px; border-collapse: collapse; white-space: pre; "><div style="border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); ">
I used getactualmemorysize and numberofcells and numberof point:</div><div style="border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); ">
<br></div><div style="border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); ">at marching, till normal steps I have 23799 kb , 6608388 cells , and 3306508 points ,a ny suggestions please</div>
</span></div></div></div>