.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

a bug in IsEqualTo method

1 REPLY 1
Reply
Message 1 of 2
netcai
247 Views, 1 Reply

a bug in IsEqualTo method

i want judge two points is same ,so I use the following code ,but result is always that two points is same. Even polyline(pol) just has two different points.

Point3d startPnt = pol.GetPoint3dAt(0);
Point3d endPnt = pol.GetPoint3dAt(pol.NumberOfVertices-1);
Tolerance tr = new Tolerance(0,0);
if (startPnt.IsEqualTo(endPnt))
{
....
}
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: netcai

I can confirm that this is a bug. Use the == or != operators instead. The
following works as expected:
Point3d pt1 = new Point3d(1, 0, 0);

Point3d pt2 = new Point3d(2, 0, 0);

Point3d pt3 = new Point3d(1,0,0);

Debug.Assert(pt1 != pt2 );

Debug.Assert(pt1 == pt3 );

wrote in message news:4881410@discussion.autodesk.com...
i want judge two points is same ,so I use the following code ,but result is
always that two points is same. Even polyline(pol) just has two different
points.

Point3d startPnt = pol.GetPoint3dAt(0);
Point3d endPnt =
pol.GetPoint3dAt(pol.NumberOfVertices-1);
Tolerance tr = new Tolerance(0,0);
if (startPnt.IsEqualTo(endPnt))
{
....
}

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost