Find point at distance from another point

Hi all.

My project is to delete Curtain grid segments according to some mullions.
Centerpoint Grid and mullions are not 100% the same. Maybe +/- 100mm.

How can I match this upp.

I want to find point from a max distance from another point:

Red square is 100mm from P1.
Check if P2-P6 is insite the square.

So fare i’m thinking:

if a.X(+/-100mm) == b.Z ?
if a.Y(+/-100mm) == b.Z ?
if a.Z(+/-100mm) == b.Z ? : false;

I’m woking on this, but it will not give the resultat i want.

regards
Bárður

Hi

Have a look at my solution in the attached screenshot:

I test the absolute values of the difference between the coordinates, instead of checking both the negative and positive difference. Also, by chaining all the coordinates after another with AND (&&) operators in between the final result is true if all the differences in the coordinate values are below the provided length (len).

Does this solve your problem?

Good luck!

Thomas

Math.Abs(a.X - b.X) < len && Math.Abs(a.Y - b.Y) < len && Math.Abs(a.Z - b.Z) < len ? true : false;

1 Like

Thank you very much tothom.

That was it.

Bárður