<div dir="ltr">this code for create mesh it always give bug and error that vtkinttype can&#39;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-&gt;GetOutput()-&gt;ReleaseDataFlagOff();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes-&gt;SetInput(VoxelData);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes-&gt;SetValue(0, 4);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes-&gt;ComputeGradientsOn();</div><div>
<br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>mcubes-&gt;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-&gt;GetOutput()-&gt;ReleaseDataFlagOff();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;SetInput(mcubes-&gt;GetOutput());</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;SetNumberOfIterations(5);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;SetRelaxationFactor(0.70);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;SetFeatureAngle(70);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;FeatureEdgeSmoothingOn();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;BoundarySmoothingOn();</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>smoother-&gt;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-&gt;GetOutput()-&gt;ReleaseDataFlagOff();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals-&gt;SetInput(smoother-&gt;GetOutput());</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals-&gt;SetFeatureAngle(80);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>normals-&gt;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-&gt;SetInputConnection(normals-&gt;GetOutputPort());</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>delaunay4-&gt;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-&gt;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-&gt;SetInputConnection(delaunay4-&gt;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-&gt;SetMapper(mapper);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>actor-&gt;GetProperty()-&gt;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-&gt;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>