<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with the function Curve.Intersect(Curve) in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637918#M53861</link>
    <description>&lt;P&gt;Thanks Jeremy, I have indeed solved the problem for myself (once you have found it, not difficult...).&lt;/P&gt;&lt;P&gt;Benoit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 11:21:46 GMT</pubDate>
    <dc:creator>BenoitE&amp;A</dc:creator>
    <dc:date>2017-12-20T11:21:46Z</dc:date>
    <item>
      <title>Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7632649#M53857</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a problem when I use this function with 2 lines intersecting each other in the case where they are parallel. See code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ pt1 = new XYZ();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ pt2 = new XYZ(1, 0, 0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ pt3 = new XYZ(-1, 0, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetComparisonResult scr = Line.CreateBound(pt1, pt2).Intersect(Line.CreateBound(pt1, pt3), out IntersectionResultArray ira);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr == SetComparisonResult.Overlap)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 1 overlap" + DonneXYZ(ira.get_Item(0).XYZPoint);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr == SetComparisonResult.Disjoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 1 disjoint";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr != SetComparisonResult.Overlap &amp;amp;&amp;amp; scr != SetComparisonResult.Disjoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 1 problem";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns the Case 1 problem (not overlap, not disjoint).&lt;/P&gt;&lt;P&gt;If the 2 lines are not parallel to each other the result is overlap (correct)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ pt4 = new XYZ(0, 1, 0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetComparisonResult scr2 = Line.CreateBound(pt1, pt2).Intersect(Line.CreateBound(pt1, pt4), out IntersectionResultArray ira2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr2 == SetComparisonResult.Overlap)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 2 overlap" + DonneXYZ(ira2.get_Item(0).XYZPoint);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr2 == SetComparisonResult.Disjoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 2 disjoint";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr2 != SetComparisonResult.Overlap &amp;amp;&amp;amp; scr != SetComparisonResult.Disjoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 2 problem";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried to get a curve with tangent parallel with the other curve :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Arc myArc = Arc.Create(new XYZ(0, 1, 0), 1.0, -0.5 * Math.PI, 0.0, XYZ.BasisX, XYZ.BasisY);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetComparisonResult scr3 = myArc.Intersect(Line.CreateBound(pt1, pt3), out IntersectionResultArray ira3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr3 == SetComparisonResult.Overlap)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 2 overlap "+DonneXYZ(ira3.get_Item(0).XYZPoint);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr3 == SetComparisonResult.Disjoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 2 disjoint";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scr3 != SetComparisonResult.Overlap &amp;amp;&amp;amp; scr != SetComparisonResult.Disjoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monMessage += "\n Case 2 problem";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the result is correct (overlap).&lt;/P&gt;&lt;P&gt;So it appears that the only incorrect result is when you have 2 parallel lines.&lt;/P&gt;&lt;P&gt;But it is a mess in my code (unexpected errors that I have to deal with) so if this could be fixed if would be great!&lt;/P&gt;&lt;P&gt;Benoit&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:36:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7632649#M53857</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2017-12-18T16:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7634602#M53858</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Benoit,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your report.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your source code is more readable if you add it using the 'Insert Code' button '&amp;lt;i&amp;gt;'.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So, you say that you have a problem with the intersection of two parallel lines?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;Point P = (-1,0,0)
Point O = (0,0,0)
Point Q = (0,0,+1)
Line A from P to O
Line B from O to Q&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;These two lines have one single common point in (0,0,0).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Whether that is to be considered an intersection depends completely on your point of view.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the lines are considered as closed sets of points in space, they intersect in one point.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If they are considered as open sets in space, they do not intersect.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Both of these way of looking at geometrical elements are completely valid.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Mathematically speaking, you can consider this equivalent question:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Question: Do the two intervals [-1,0] and [0,1] intersect?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Answer: The two closed intervals [-1,0] and [0,1] do intersect, in one single point 0. The intersection is infinitesimally small and has a volume of zero. The two open intervals (-1,0) and (0,1) do not intersect. There is also no intersection between the two intervals if one of them is open and the second closed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;These cases can only be distinguished precisely using exact arithmetic:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/24352127/exact-arithmetic-in-c" target="_blank"&gt;https://stackoverflow.com/questions/24352127/exact-arithmetic-in-c&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic" target="_blank"&gt;https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The Revit API, just like most other current geometrical programming environments, does not specify which paradigm is considered valid.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In fact, it cannot, because it does not work with exact arithmetic.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As long as we are working with imprecise double precision floating point numbers, these two cases cannot be distinguished.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The line A is considered totally equivalent to the line&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;Line4 A' from P to (-0.000000000000000000001,0,0)&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The only way I see for you to handle your problem properly is to perform a fuzzy comparison of the edge cases such as these, cf.:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2017/06/sensors-bim-ai-revitlookup-and-fuzzy-comparison.html#4" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2017/06/sensors-bim-ai-revitlookup-and-fuzzy-comparison.html#4&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would say that this is not a bug, and there is no way to decide whether parallel lines that meet in one single point intersect or not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any such attempt would be completely pointless&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your software needs to be implemented in a way that takes this possibility into account.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Exact comparison would be required to answer this precisely.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is definitely not possible using floating point arithmetic.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this clarifies.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 10:32:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7634602#M53858</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-12-19T10:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637774#M53859</link>
      <description>&lt;P&gt;Hey Jeremy,&lt;/P&gt;&lt;P&gt;Your explainations are interesting. Still the bottom of the problem remains:&lt;/P&gt;&lt;P&gt;- the way this subject is coded in Revit makes the results of very similar intersection problems non consistant.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 1 : intersection between [(0,0) ; (1,0)] and&amp;nbsp;&lt;SPAN&gt;[(0,0) ; (-1,0)] returns neither overlap nor disjoint&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Case 2 : intersection between [(0,0) ; (1,0)] and&amp;nbsp;[(0,0) ; (0,1)] returns overlap&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Case 3 : intersection between [(0,0) ; (1,0)] and&amp;nbsp;the arc of center (0,10E9) and of radius 10E9 ending in (0,0) (which is locally a Line) returns overlap.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- this problem arises only for Line which are parallel, not for the other types of Curves.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As I explained, this rises unexpected errors which should be avoided and can be difficult to find. So I believe the Curve.intersect method should be updated on this particular point. Except if there is a better argument not to do so...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Benoit&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 10:20:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637774#M53859</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2017-12-20T10:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637838#M53860</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Benoit,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your update.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As you can tell, I find the topic interesting and really want to help find a satisfactory solution.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this only applies to parallel lines, I would suggest solving it for that case, because it is not hard to do.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I added IsParallel and IsCollinear predicates to The Building Coder samples for this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  public static bool IsParallel( XYZ p, XYZ q )
  {
    return p.CrossProduct( q ).IsZeroLength();
  }

  public static bool IsCollinear( Line a, Line b )
  {
    XYZ v = a.Direction;
    XYZ w = b.Origin - a.Origin;
    return IsParallel( v, b.Direction )
      &amp;amp;&amp;amp; IsParallel( v, w );
  }&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Next step would be to check for the overlap including the required fuzziness in case lines are collinear..&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I will also discuss with the development team whether they agree with you and the official API intersection functionality should take this into account as well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 10:48:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637838#M53860</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-12-20T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637918#M53861</link>
      <description>&lt;P&gt;Thanks Jeremy, I have indeed solved the problem for myself (once you have found it, not difficult...).&lt;/P&gt;&lt;P&gt;Benoit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 11:21:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637918#M53861</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2017-12-20T11:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637991#M53862</link>
      <description>&lt;P&gt;Care to share? Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 11:48:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7637991#M53862</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-12-20T11:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7638687#M53863</link>
      <description>&lt;P&gt;Dear Benoit,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The development team replies regarding the return value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe the documentation covers this case and the return is "Subset":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.revitapidocs.com/2018.1/3310a68d-b67a-79cb-ea54-deb00d9f60d9.htm" target="_blank"&gt;http://www.revitapidocs.com/2018.1/3310a68d-b67a-79cb-ea54-deb00d9f60d9.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SetComparisonResult.Subset - The inputs are parallel lines with only one common intersection point, or the curve used to invoke the intersection check is a line entirely within the unbound line passed as argument curve. If the former, the output argument has the details of the intersection point&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The customer didn't indicate what the return value was for them; if it is subset, that matches what we have told them it would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 15:16:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7638687#M53863</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-12-20T15:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641149#M53864</link>
      <description>&lt;P&gt;Published for posterity:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2017/12/project-identifier-and-fuzzy-comparison.html#3" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2017/12/project-identifier-and-fuzzy-comparison.html#3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Benoit, I added a new little question for you in there, by the way&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 10:14:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641149#M53864</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-12-21T10:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641453#M53865</link>
      <description>&lt;P&gt;Hey Jeremy,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Indeed this answer (SetcomparisonResult.Subset) works for my problem and is much more elegant than my previous solution (which was in essence : check if SetComparisonResult is either Overlap or Disjoint, and if it is not, check if the 2 elements are line, are colinear and have same end. If so, do as if the case was Overlap).&lt;/P&gt;&lt;P&gt;Now it gives :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;if (scr != SetComparisonResult.Overlap &amp;amp;&amp;amp; scr != SetComparisonResult.Disjoint &amp;amp;&amp;amp; (scr!=SetComparisonResult.Subset &amp;amp;&amp;amp; ira.Size==1)){bla bla bla} &lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And that's it!!&lt;/P&gt;&lt;P&gt;Bye.&lt;/P&gt;&lt;P&gt;Benoit&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 12:11:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641453#M53865</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2017-12-21T12:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641465#M53866</link>
      <description>&lt;P&gt;Little mistake...&lt;/P&gt;&lt;P&gt;This is better.&lt;/P&gt;&lt;I&gt;if (scr != SetComparisonResult.Overlap &amp;amp;&amp;amp; scr != SetComparisonResult.Disjoint &amp;amp;&amp;amp; !(scr==SetComparisonResult.Subset &amp;amp;&amp;amp; ira.Size==1))&lt;/I&gt;</description>
      <pubDate>Thu, 21 Dec 2017 12:15:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641465#M53866</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2017-12-21T12:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the function Curve.Intersect(Curve)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641611#M53867</link>
      <description>&lt;P&gt;Dear Benoit,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your update, appreciation, confirmation and sample snippet, which I added to the post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 13:07:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/problem-with-the-function-curve-intersect-curve/m-p/7641611#M53867</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-12-21T13:07:51Z</dc:date>
    </item>
  </channel>
</rss>

