Closest point bug

Hi folks,
As you can see here, Dynamo does not find the correct solution for the closest points between some lines and a planar Nurbs surface? (In this case, the points should be on the surface)


I have a workaround (projecting the points into a fixed direction), but the original approach should work?
Thanks,
GG
Dynamo-Bug-Closest-Point.dyn (9.5 KB)
planar_nurbs_surface.sat (5.0 KB)
lines.sat (16.5 KB)

Can you include the node preview bubbles in your screenshot so we can see what the list structure is? Hard to go off of just the background geometry and the output alone.

Feels like an issue with the SAT import node, or the SAT itself…

It does look like an issue with the SAT file or the import. Geometry.Intersect returns the points correctly.

1 Like

This is neither a problem of the SAT Import, nor the SAT file itself. I just used SAT to make the script independent from the Alias Dynamo, where I encountered this issue (with no SAT workflow involved).
As you can see, this is not an issue of list level access either:


I think the problem is rather that the closest points of the lines are lying on the planar surface, and are giving Dynamo issues with the algorithm due to that.

Intersecting is (by the way) not a solution for my problem. What I want to do: I have two surfaces of the exact same size. I have points on surface A, and want to measure the distance of those points to surface B, to use this distance value later in the script for a scaling operation. For that I want to use “closest point”. With the “project into a direction” approach I am afraid to run into numerical issues in Dynamo (as I already did in the past), where you miss the target by 0.000000000912mm, or so, and end up with a null or empty list entry, preventing your script from running correctly…

Built a simplified bit of code to reproduce the error:

rect =
	Rectangle.ByWidthLength(
		Plane.ByOriginNormal(
			Point.ByCoordinates(3,-1,6),
			Vector.YAxis()
		),
		1,
		1
	).Patch();


line =
	Line.ByStartPointDirectionLength(
		Point.ByCoordinates(
			3,-2,6
		),
		Vector.YAxis(),
		1
	);

near = Geometry.ClosestPointTo(rect,line);

Certainly reproduces for me, from 2.12 to 3.4. Unclear if I’m missing something, but the development team is aware. Hopefully I’ll have an answer soon enough.

FYI @solamour @achintya_bhat @emrullah.yildiz

5 Likes