Grasshopper

algorithmic modeling for Rhino

Hi all,
How can I delete twice or congruent objects in Rhino model space?

Views: 12460

Replies to This Discussion

Hi Rafi,

what kind of objects? Points? Curves? BReps?

And, do you want to delete exact duplicates, or do you want to delete objects which kinda-sorta look alike... a bit... somewhat?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
David,

Looking at the number of questions regarding this, perhaps it might be worthwhile having a component that does this? Perhaps it could even have a user controlled tolerance for the kinda-sorta look alike... a bit... somewhat cases?
Yes, that's what I figured. As soon as you allow tolerances it becomes a whole lot harder to solve these cases (except for points). Exact duplicates shouldn't be too hard.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hallo David,

I just want delete congruent curves and points which are exact duplicates!
Hi Rafi,

if you're looking at exact duplicates of curves and points, here's what I'd do:

1) Write a new class in a VB or C# component that implements IComparer(Of IOnCurve). You can check easy properties first (boundingbox, length, start and end points), if these all turn out to be the same, you'll eventually have to drill down all the way to Nurbs properties (i.e. compare the CV array and Knot-Vectors of the curves), but perhaps it's good enough to stick with the easy comparisons.

2) Iterate through a list of IOnCurves (or OnCurves, or OnNurbsCurves, whatever you've got), and slowly populate a SortedList or SortedDictionary as you loop. This SortedList must be aware of your Comparer. Then, whenever you encounter a curve which already has been handled before, you know you've got a duplicate.

This is not exactly trivial, not even for the somewhat experienced DotNetters. I'll see if I have some time tomorrow to implement this.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
I was thinking this would have something to do with DataCRC (for exact matches)...?

Since you mention comparing the 'easy properties', does that imply you suggest using the IComparer for the kinda-sorta almost cases?

And if it were only limited to exact duplicates, which method would be faster -- IComparer or DataCRC?
Hi guys,

I have been using Kangaroo to delete duplicate points and so far it's been great but
when I increased the amount of points to 160,000, it crashes.

Would there be an alternative which could take such density or does it have to do with computer capacity ?

Many thanks,

Arthur
I just wrote this VB script component, not sure what the density capability is, but it removes duplicates for points, lines and curves. Let me know how it works for your large number of points.
Attachments:
Sorry!
I received just the 3D model from a customer, it is therefore not a Grasshopper Component to clean up!
I have exactly the same problem - In my case its identical points - or points that share the same z coordinate, but it would be great to have a component for all kinds of objects.

julian
I remember there was a somewhat simpler method, but can't think of it now. Maybe this will work for you.
Attachments:
Did anyone figure out an easy way to remove duplicate points from a list?

Thanks.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service