Points inaccuracy in Dynamo

And to complicate things, the way floating points are calculated will vary by hardware, operating system, and software application.

So the same PC using the same [Dynamo, Python, DLL] which relies on any type of double comparison can return different results when you update windows. Or if you have the same windows but different hardware they can return different results.

In 1994 Intel famously had to recall $475,000,000 of Pentium processors in what was the first ever full recall of a computer chip.

But we digress…

A nodes only approach which won’t require rebuilding your points (a potentially slow operation, though this isn’t a trivial thing at scale) is as follows:

  1. Prune the duplicate points using your desired tolerance
  2. Get the distance from each point to all pruned points
  3. Get the index of the minimum item in each sublist
  4. Group the points by the minimum item index

In nodal form that looks like this (with a fun grouping display added for kicks :slight_smile: ):
point grouping

And a design script alternative:

dists = Geometry.DistanceTo(pnts@L1<1>,Point.PruneDuplicates(pnts, tolerance));
groups =
	List.GroupByKey(
		pnts,
		List.IndexOf(dists@L2<1>, List.MinimumItem(dists)@L1<1>)
	)["groups"];
4 Likes