Can anyone help with explaining how Geometry.Tolerance works...
If i compare 2 points p1 = 28,5 and p2 = 101.4,120.2 and have a tolerance object that is 0,100 the result of the comparison is true.....
Tolerance tol = new Tolerance (0,100);
Point2d pt1 = new Point2d(28,5);
Point2d pt2 = new Point2d(101.4,120.2);
bool result = pt1.IsEqualTo(pt2,tol);
result will be true but I dont understand why.... the distance between the points is 136.6 and x coordinate differance is 115.2, both out of tolerance. So, what's the 'tolerance' doing?
Many thanks.
EDIT: It was a coding error - seems I had mixed up coordinates.....
Solved! Go to Solution.
Solved by FRFR1426. Go to Solution.
Wonder if anyone out there can enlighten me:
I now understand that Tolerance tol = new Tolerance (0,100); gives a distance tolerance of 100. However, I do not understand what the 0 is. Any figure in there doesnt change the outcome. Its called "equalVector" and its type is "double". Can anyone show me an example of how that would work?
Many thanks.
The first argument of the tolerance constructor is used to compare vectors (default: 1e-12), the second is to compare points (default: 1e-10). Vectors are used to store directions, so there are compared with a higher tolerance than points (a small difference between angles has a bigger impact than the same difference between distances).
Thanks for the reply.
So if im comparing points, the vector part will have no effect and vis versa if im comparing vectors?
Yes. Point2d and Point3d.IsEqualTo use EqualPoint, Vector2d and Vector3d.IsEqualTo use EqualVector.
Can't find what you're looking for? Ask the community or share your knowledge.