algorithmic modeling for Rhino
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:
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.
Tags:
There is an SDK function that does exactly the same as the kangaroo component. Try the following code:
private void RunScript(List<Point3d> P, double t, ref object A) {
if(double.IsNaN(t) || t == 0){
t = RhinoDoc.ActiveDoc.ModelAbsoluteTolerance;
}
A = Point3d.CullDuplicates(P, t);
}
David Reeves made a definition to do this and posted it on the old kangaroo group some time ago:
https://groups.google.com/group/kangaroophysics/browse_thread/threa...
the file is in the downloads section:
https://groups.google.com/group/kangaroophysics/files
(duplicate_rebuild.ghx)
I got really excited for a second. I didn't think to search the Kangaroo forum. Unfortunately, the duplicate_rebuild script performs worse than the the pure grasshopper definitions presented in the opening post.
I've been working on some geodesic dome stuff. Attached is a definition culled down to just provide sufficient points to compare different "find duplicate" methods. You can see how everything performs so far. None come close to the Kangaroo version. What's the winning technique used in the Kangaroo version?
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).
David, the component works great. I like it a lot too.
Could you update it with another output similar to "A", but which prints, i.e, value "1" for the geometries that had duplicates, value "0" for those of the list that were uniques?
still great in 2012 ;)
thanks david!
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
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by