Line Intersection problem with small lines

Line Intersection problem with small lines

nur91m
Advocate Advocate
488 Views
1 Reply
Message 1 of 2

Line Intersection problem with small lines

nur91m
Advocate
Advocate

Hi all. I have polyline and ray. when I apply intersectWith method of polyline to ray, it returns me intersection points perfect. But when ray intersects polyline's small segments it doesn't return anything. I noticed that it worked when the poylyline was in a big scale and not worked when i draw it as little as possible.

 

poly.IntersectWith(ray,Intersect.OnBothOperands,ray.GetPlane(),ptCol,0,0);	
ed.WriteMessage((ptCol.Count).ToString());
btr.AppendEntity(ray);
trans.AddNewlyCreatedDBObject(ray,true);

What does Intersect type parameter of IntersectWith method mean? what is it needed for?

0 Likes
489 Views
1 Reply
Reply (1)
Message 2 of 2

ActivistInvestor
Mentor
Mentor

@nur91m wrote:

Hi all. I have polyline and ray. when I apply intersectWith method of polyline to ray, it returns me intersection points perfect. But when ray intersects polyline's small segments it doesn't return anything. I noticed that it worked when the poylyline was in a big scale and not worked when i draw it as little as possible.

 

poly.IntersectWith(ray,Intersect.OnBothOperands,ray.GetPlane(),ptCol,0,0);	
ed.WriteMessage((ptCol.Count).ToString());
btr.AppendEntity(ray);
trans.AddNewlyCreatedDBObject(ray,true);

What does Intersect type parameter of IntersectWith method mean? what is it needed for?


I can't tell you why you're seeing the problem you see, but Intersect determines if either or both of the two objects should be extended. That allows the calculation of intersection points that do not lie on either object (consider two non-parallel lines that don't intersect. If they are both extended infinitely, they will intersect at some point, and that point would be returned if you used Intersect.ExtendBoth).

0 Likes