I’m looking for solution of removing every second line of points array (like on the picture). This points I got from the spline sampler after some transformations.
The first is within your spline blueprint. You could set your spline to spawn additional splines every X units (with spawn child actor) until the end of your spline, then auto-set the spline length to the width of your perimeter. Then, you can use those spline samples in your PCG to check for intersections and remove those points.
The other way to do this, which is cleaner but may be harder to pull off in PCG due to its limitations, is to do it mathematically. Assuming the points are sorted cleanly from the origin of the spline, you just need to calculate the number of boxes in each row ( totalWidth = X * (boxWidth + offsetWidth)). Once you have the number of boxes in each row (X) you can modulo by two rows (2X) and remove every box above X.
As an example using the image above, after doing your width calculation you find that there are 5 boxes in each row. 5*2 = 10, which covers the boxes in both rows. Now, take your point number and modulo it by 10, so each point is only counting to ten then resetting. Remove any points above the number 5. Now, every other row will be removed.
Let me know if you need any of this explained more, I know math equations can be weird to explain in a written format.