piac
(Giulio Piacentino)
June 4, 2014, 8:26am
2
The code used today by RhinoCommon is here:
#endregion
/// <summary>
/// Removes duplicates in the supplied set of points.
/// </summary>
/// <param name="points">A list, an array or any enumerable of <see cref="Point3d"/>.</param>
/// <param name="tolerance">The minimum distance between points.
/// <para>Points that fall within this tolerance will be discarded.</para>
/// .</param>
/// <returns>An array of points without duplicates; or null on error.</returns>
public static Point3d[] CullDuplicates(System.Collections.Generic.IEnumerable<Point3d> points, double tolerance)
{
if (null == points)
return null;
// This code duplicates the static function CullDuplicatePoints in tl_brep_intersect.cpp
Rhino.Collections.Point3dList point_list = new Rhino.Collections.Point3dList(points);
int count = point_list.Count;
if (0 == count)
return null;
There is already a class with better behavior RTree, but it is a bit more difficult to understand. You could edit this method or write an algorithm based on the RTree class?
Does this help?
Giulio
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com