Duplicate Point Identification

I'm having a hard time identifying duplicate points. Attached is a definition that seems like it would work. So far using it sometimes works better than, and sometimes worse or the same than the definition offered here: http://www.grasshopper3d.com/forum/topics/how-to-remove-duplicate-p... .

But neither work as well as the removeDuplicatPts component available in the Kangaroo plug-in. In the attached, it fails to identify two duplicate points. As vertices of a dodecahedron, there should only remain 12 points. I want to develop my own definition with the same consistency as the Kangaroo version for a few reasons:

  • I don't want to be so dependent on the Kangaroo component -- I had a few difficult days without it when it didn't work with the latest GH update.
  • Since without it, I've gotten curious and simply want to understand how to program this.
  • And most importantly, I need index identification of duplicate points more than the raw elimination of them. The Kangaroo component doesn't offer this and I plan to use point location identifiers to help remove duplicates of more complicated objects.

It seems like the problem is due to incorrectly sorting zero values that show up as extremely small exponentials e-15 or e-16; But I'm not sure. Adding a small but cumulatively larger value to each list item being sorted seems to help to a degree; but not enough.

Any thoughts about improving this definition or suggestions about a completely different approach would be great.

 

Load Previous Replies
  • up

    Gabe Krause

    After having this on my mind, it really seems like there's a bug or some problem with how the 'Sort List' component handles sorting multiple values of zero. It appears that it doesn't keep corresponding data in their proper order.

    I just switched to using the Z-value of the points for sorting, and my definition works exactly as designed.

    Attached shows how 'Sort List' fails on zeros (or very small numbers).

    • up

      David Reeves


      Here's an updated version of the remove duplicates component Daniel mentioned. It spits out an index tree as well for rebuilding sake. I double checked just to make sure and it appears to be working. If it's still giving you trouble try bumping up the absolute tolerance in your rhino document settings.

      3
      • up

        Stefan

        just in case somebody comes here:

        since Grasshopper 0.9.0005, there is an official component for this.

        see "new features" section at http://www.grasshopper3d.com/forum/topics/grasshopper-0-9-0005-avai...

        there it says "Added Cull Duplicate Points component (Vector.Point dropdown)."

        Best regards
          Stefan