How can make vtkpolydata by points?

Hi

I have a 3DList of point data .
now I want to make a heterogeneous polydata wich inside of that has filled
Can you help me to way of do that?

Hi @A.M_Shahpouri

You try vtkDelaunay3D.

Best

Hi Mathieu
thank you for answer to me

but I have a Big 3DList of point and by this way take alot!!! of time

        vtkPoints points = new();

        for (int z = 0; z <ZSize; z++)
        {
                for (int y = 0; y < YSize; y++)
                {
                    for (int x = 0; x <XSize; x++)
                    {         
                        if (IsInside(P[z][y][x]))
                        {
                            points.InsertNextPoint(x, y, z);
                        }
                    }
                }
            }
        }

        vtkPolyData polydata = new();
        polydata.SetPoints(points);

        vtkDelaunay3D delaunay = new();
        delaunay.SetInputData(polydata);
        //delaunay.SetTolerance(.00001);
        //delaunay.SetAlpha(100000);
        delaunay.Update();

        vtkDataSetMapper mapper = new();
        mapper.SetInputConnection(delaunay.GetOutputPort());

        vtkActor actor = new();
        actor.SetMapper(mapper);

        renderer.AddActor(actor );

and when run is not work in true way
like this

the problem in this photo : Some points (at the outer edges of the shape) are connected, which we don’t want to happen
like this
Untitled

I want make a shape with point , which I had set in vtkPoints ( and don’t want to draw line between points automatically )
and I want make faster

thank you a lot for helping :pray:

You can try to change the alpha to a non zero value to control the radius of the delaunau algorithm

mr.Mathieu

I have 3 problem in this way . can you answer that :

  1. Which range of Alpha should I set ?
  2. How can I set Spacing For This ?
  3. It take about 5 min to run!!! . What I should do to speed up?

thank you

@Charles_Gueunet

@A.M_Shahpouri

  1. Which range of Alpha should I set ?

The alpha roughly drives the maximum edge length. As your point cloud seems to be quite dense, I would say something with 1 or 5% of the dataset size would seems good. If you choose Alpha too large, you may have large edges filling concavities. If you choose Alpha too small, you may have holes on the resulting meshes.

  1. How can I set Spacing For This ?

I am not sure to understand the question, can you clarify ?

  1. It take about 5 min to run!!! . What I should do to speed up?

A smaller Alpha may already improves the run time a bit, but not so much. There is no SMP on the VTK filter to improve running time neither so I do not see easy solutions. We could decimate the input but this would of course lead to bad quality result. We could try to use the efficient CGAL delaunay 3D implementation through vespa but this would require to implement it.