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

Geometry Line2d IntersectWith

4 REPLIES 4
Reply
Message 1 of 5
kbarnettza
1275 Views, 4 Replies

Geometry Line2d IntersectWith

C#, AutoCAD 2010.

Greetings,
I normally use a database transaction to create temporary drawing Lines when I need to do any intersections. But I decided to try virtual Geometry Line2d instead. Intersecting Line2d with other Line2d objects. But I do not understand the Tolerance input. I definately need it - without it all the line2ds are intersecting even when they actually dont.
If you know, then please educate me (and others that may later read this forum).
Thanks for helping,
Cheers,
Kevin.
4 REPLIES 4
Message 2 of 5
_gile
in reply to: kbarnettza

Hi,

Geometry.Line2d is unbounded so two line2d will always intersect except if there're parallel.

Try using Geometry.LineSegment2d


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 5
adadnet
in reply to: kbarnettza

hi kevin

 

not sure but i reckon the tolerance is needed to compensate for autocad's abstract accuracy in calculating coordinates in space down to the xth position. logically it may be obvious that two linear non-parallels cross exactly once but calculating db coords to high precision and finding an exact equal is something different. (i think one tolerance part is for length deviation, the other for vector deviation.)

 

you may want to try the curvecurveintersector, which has a .numberofintersections property and may feel easier to work with.

 

felix

Message 4 of 5
Anonymous
in reply to: adadnet

can you tell, if it's faster than Curve.IntersetWith method? also are the operations with virtual geometry objects faster than with the database geometry objects?

Message 5 of 5
adadnet
in reply to: Anonymous

honest, no, i can't, i haven't used it anywhere near a scale where it would be noticable, however...

 

virtual geometry is, from what i know, by nature faster than working with database objects, i.e. the former leaves the latter 'virtually' untouched.

 

felix

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