Jump to content
magneto

Is there a fast way to delete all points that occupy the same space?

Recommended Posts

Hi,

I have a geometry where some points occupy the same space. I want to delete all points that do this, not merge them to a single point so Fuse SOP doesn't work. In my case these points are isolated and also only 2 could be at the same place at most.

I thought of saving some attribute values onto the points but how will I know that the other points are fused since they don't have any relationship to each other?

I thought of using the Snap option with the Point Attributes set to Least and Greatest in 2 separate Fuse operations and then get the difference but it didn't work.

Any ideas?

Thanks :)

Share this post


Link to post
Share on other sites

I think this could be done in VEX fairly easily - the POP Proximity DOP gets you most of the way there, and you could look inside that asset to see what it does.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks cwhite, it's doing point cloud lookups. Would this not be expensive for millions of points? If it's the only choice, I will have to use it though :)

I have boxes copied onto points and I want to delete all points and faces that are inside the surface, where they are not visible from the outside. Then I will fuse them to have a closed shell-like surface.

Some boxes might be missing though, so I have to do it in a way that will work for these cases, instead of a perfect NxNxN cube distribution.

That's why I thought of doing it by creating points at the center of each primitive which the inner faces will have 2 points at the same spot, so they will be the faces to remove.

I also tried using rays using the Intersect VOP but firing rays towards the polygon where there are 2 faces with opposing normals do not work. In most cases, both intersect operations return the same face, not the one that's looking opposite of ray's direction. I think this is a bug because intersect shouldn't hit faces where the face normal is facing away from the ray's direction.

EDIT: Forgot the picture:

aQjETsx.png

Edited by magneto

Share this post


Link to post
Share on other sites

It shouldn't be too bad if you choose appropriate parameters - in your case, you can make the max search points and search radius very small since you're only looking for a single point within a small distance threshold.

I'm not sure if I'm understanding your problem exactly, but the PolyDoctor SOP has an option to remove pairs of overlapping polygons.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, you are right, I will use very small radius and only 1 point or 2, since it also includes the point itself I think.

I just tried the PolyDoctor SOP but it says the polygons have to use the same vertices. In my case, they are separate :)

So for something like this, all the inner points and faces will be deleted and only the outer/visible faces will remain and fused:

KY9z70Y.png

Edited by magneto

Share this post


Link to post
Share on other sites

Thanks cwhite, I didn't know Clean SOP could do that. It seems to work very well :)

Share this post


Link to post
Share on other sites

Also if there are any alternatives, I am open to them :)

I was just foolishly smiling when I checked the cook times of the Clean SOP, until I noticed 10 seconds of calculation, where I realized it was a digital asset so the cook times shown at the top level are not accurate at all.

Motivated by this, I extracted only the nodes I need outside, which are Fuse and Poly Doctor to do the same thing. Unfortunately both are very slow. 10 seconds total for 1 million points is too long.

There has to be a simpler way I think :)

Share this post


Link to post
Share on other sites

Thanks cubiccube, that's a pretty good method. Quite a speed difference :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×