{"id":877,"date":"2020-04-07T20:26:07","date_gmt":"2020-04-07T20:26:07","guid":{"rendered":"https:\/\/www.parametriczoo.com\/?p=877"},"modified":"2020-04-07T20:26:16","modified_gmt":"2020-04-07T20:26:16","slug":"plane-and-curve-intersection-2","status":"publish","type":"post","link":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/","title":{"rendered":"Plane and curve intersection (2)"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;3.22.7&#8243;][et_pb_row _builder_version=&#8221;3.22.7&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.22.7&#8243;][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>In my last my post I discussed this topic in the context of linear algebra and differential geometry. We also briefly discussed root finding method. Although the method works properly but you are probably looking for something faster!&nbsp;<\/p>\n<p>Here I would like to use a method from Revit API to improve the performance.<span style=\"font-size: 14px;\">&nbsp;<\/span><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;3.22.7&#8243; background_color=&#8221;#f2f2f2&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d3d3d3&#8243; custom_margin=&#8221;-2px|||||&#8221; custom_padding=&#8221;11px|15px|0px|15px|false|true&#8221; saved_tabs=&#8221;all&#8221;]<\/p>\n<pre><code><span class=\"keyword\">public<\/span> <a href=\"dafc9c77-f17a-1ad8-0bcb-422b4309ee43.htm\">FaceIntersectionFaceResult<\/a> <span class=\"identifier\">Intersect<\/span>(\n\t<a href=\"e32b3b1f-66fc-57cb-6e1c-aa81d1bf3e63.htm\">Face<\/a> <span class=\"parameter\">face<\/span>,\n\t<span class=\"keyword\">out<\/span> <a href=\"400cc9b6-9ff7-de85-6fd8-c20002209d25.htm\">Curve<\/a> <span class=\"parameter\">result<\/span>\n)<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>Above method compute the intersection of curve and face. If we can generate a planar face in the given plane in which intersect the curve then we can use the method to compute the Plane &#8211; Curve intersection. The question is in which position in the plane and in what size we should create the face? Let us assume that curve <strong><em>c<\/em><\/strong> intersect the plane <em><strong>Q<\/strong><\/em> at least in one point <strong><em>P<\/em><\/strong>. It is obvious that <strong><em>P<\/em><\/strong> lies in the curve <strong><em>c&#8217;<\/em><\/strong> the projection of Curve <em><strong>c<\/strong> <\/em>on the plane <strong><em>Q<\/em><\/strong>. Consequently if curve <strong><em>c<\/em><\/strong> intersect plane <strong><em>Q<\/em><\/strong> at a any point <strong><em>P<\/em><\/strong> then it also intersect curve <strong><em>c&#8217;<\/em><\/strong>, meaning the normal projection of curve <strong><em>c<\/em><\/strong> on plane <em><strong>Q<\/strong> <\/em>holds all possible intersection points. Now let us take any point on the curve <em><strong>c<\/strong><\/em> , let&#8217;s say point <em><strong>r<\/strong><\/em> and find it&#8217;s projection on plane <em><strong>Q<\/strong><\/em> which is<strong><em> r&#8217;<\/em><\/strong> a point on curve <em><strong>c&#8217;<\/strong><\/em>. From point <em><strong>r&#8217;<\/strong><\/em> on the plane <strong><em>Q<\/em><\/strong> we draw the circle <em><strong>s<\/strong><\/em> with the radius of<strong><em> l<\/em> <\/strong>the length of the curve <em><strong>c<\/strong><\/em>. We proof that circle <em><strong>s<\/strong><\/em> always contains curve <strong><em>c&#8217;<\/em><\/strong>.&nbsp;<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/04\/projection-of-curve-in-circle-s.jpg&#8221; _builder_version=&#8221;3.22.7&#8243;][\/et_pb_image][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>We proof by contradiction. Let&#8217;s assume the Curve <em><strong>c&#8217;<\/strong><\/em> intersect the circle <em><strong>s<\/strong><\/em> in point <em><strong>x<\/strong><\/em>. This means the length of the line <em><b>r&#8217;-x <\/b><\/em>equals to<em><strong> l<\/strong> <\/em>the length of the curve<b><\/b><em><b> c. <\/b><\/em>Hence we can write:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/04\/image001.png&#8221; align=&#8221;center&#8221; _builder_version=&#8221;3.22.7&#8243; width=&#8221;35%&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>In the other hand the length of the line segment <em><b>r-x&#8217; <\/b><\/em>spanning&nbsp;between two points on the curve<em><strong> c&#8217;<\/strong><b><em>&nbsp; <\/em><\/b><\/em>is shorter than the curve <b><i>:<\/i><\/b><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/04\/image003.png&#8221; align=&#8221;center&#8221; _builder_version=&#8221;3.22.7&#8243; width=&#8221;37%&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>From (1) and (2) we conclude :<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/04\/image005-1.png&#8221; align=&#8221;center&#8221; _builder_version=&#8221;3.22.7&#8243; width=&#8221;37%&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>Above statement is incorrect , as you can <a href=\"https:\/\/www.parametriczoo.com\/index.php\/2020\/03\/31\/plane-and-curve-intersection\/\">see in the previous post<\/a> the length of the normal projection of the curve <em><strong>c<\/strong><\/em> is less or equal to the length of the curve <em><strong>c<\/strong><\/em>.&nbsp;<\/p>\n<p>Now that we know a circle with the radius of<em><strong> L(c)<\/strong><\/em> around any point of the <em><strong>c&#8217;<\/strong><\/em> includes the entire curve <em><strong>c&#8217;,<\/strong><\/em> we shall use this to construct a face of this <em><strong>2l X 2l<\/strong><\/em> centered on a point (for example first point) of curve <em><strong>c&#8217;<\/strong><\/em> ti insure no intersection will falls within the face. This is nothing but the bounding rectangle of the circle <em><strong>s <\/strong><\/em>as shown in below<\/p>\n<p>[\/et_pb_text][et_pb_image align=&#8221;center&#8221; src=&#8221;https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/04\/bounding-rectangle-1.jpg&#8221; _builder_version=&#8221;3.22.7&#8243;][\/et_pb_image][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>In order to build a face out of the bounding rectangle we need to use a method from <a href=\"https:\/\/www.revitapidocs.com\/2017\/e829700d-48ff-0914-b288-5ceb93d8ee86.htm\">GeometryCreationUtilities<\/a> class.<br \/>\nAll the methods in this class create solid geometry which makes it difficult to simply create a bounded surface (<a href=\"https:\/\/www.revitapidocs.com\/2017\/e32b3b1f-66fc-57cb-6e1c-aa81d1bf3e63.htm\">Face<\/a>) , Except one method!&nbsp;&nbsp;<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;3.22.7&#8243; background_color=&#8221;#f2f2f2&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d3d3d3&#8243; custom_margin=&#8221;-2px|||||&#8221; custom_padding=&#8221;11px|15px|0px|15px|false|true&#8221; saved_tabs=&#8221;all&#8221;]<\/p>\n<pre><code><span class=\"keyword\">public<\/span> <span class=\"keyword\">static<\/span> <a href=\"7a3b5ac1-c66d-9f81-a11d-9bcd4e026295.htm\">Solid<\/a> <span class=\"identifier\">CreateLoftGeometry<\/span>(\n\t<a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/5y536ey6\" target=\"_blank\" rel=\"noopener noreferrer\">IList<\/a>&lt;<a href=\"84824924-cb89-9e20-de6e-3461f429dfd6.htm\">CurveLoop<\/a>&gt; <span class=\"parameter\">profileLoops<\/span>,\n\t<a href=\"75d6caeb-62d1-d31f-47fe-618ac7cedf19.htm\">SolidOptions<\/a> <span class=\"parameter\">solidOptions<\/span>\n)<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;3.22.7&#8243;]<\/p>\n<p>Using above method we can create an open shell with a single face . To do so , we require a list of <a href=\"https:\/\/www.revitapidocs.com\/2017\/84824924-cb89-9e20-de6e-3461f429dfd6.htm\">CurveLoops. <\/a>To build a loft surface which looks like a rectangle we consider two lines either on the top and bottom or left and right side of the rectangle, <a href=\"https:\/\/www.revitapidocs.com\/2017\/9f58eb60-84cb-4c6b-9b06-1df8007b12e0.htm\">CreateLoftGeometry()<\/a> then generate a surface spanning between the two lines.&nbsp; Below is the complete implementation. The method returns&nbsp; <a href=\"https:\/\/www.revitapidocs.com\/2017\/4742c1e8-0566-73c6-de42-04d98a503dfc.htm\">IntersectionResultArray<\/a>&nbsp;holding the information about the intersection events.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;3.22.7&#8243; background_color=&#8221;#f2f2f2&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#d3d3d3&#8243; custom_margin=&#8221;-2px|||||&#8221; custom_padding=&#8221;11px|15px|0px|15px|false|true&#8221; saved_tabs=&#8221;all&#8221;]<\/p>\n<pre style=\"font-family:Consolas;font-size:13px;color:black;\"><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">\/\/\/<\/span><span class=\"xml doc comment - text\" style=\"color:green;\"> <\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">summary<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span>\n<span class=\"xml doc comment - delimiter\" style=\"color:gray;\">\/\/\/<\/span><span class=\"xml doc comment - text\" style=\"color:green;\"> Compute the intersections of the plane with given curve<\/span>\n<span class=\"xml doc comment - delimiter\" style=\"color:gray;\">\/\/\/<\/span><span class=\"xml doc comment - text\" style=\"color:green;\"> <\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;\/<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">summary<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span>\n<span class=\"xml doc comment - delimiter\" style=\"color:gray;\">\/\/\/<\/span><span class=\"xml doc comment - text\" style=\"color:green;\"> <\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">param<\/span><span class=\"xml doc comment - attribute name\" style=\"color:gray;\"> name<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">=<\/span><span class=\"xml doc comment - attribute quotes\" style=\"color:gray;\">\"<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"xml doc comment - attribute quotes\" style=\"color:gray;\">\"<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span><span class=\"xml doc comment - text\" style=\"color:green;\">Plane of the intersection<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;\/<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">param<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span>\n<span class=\"xml doc comment - delimiter\" style=\"color:gray;\">\/\/\/<\/span><span class=\"xml doc comment - text\" style=\"color:green;\"> <\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">param<\/span><span class=\"xml doc comment - attribute name\" style=\"color:gray;\"> name<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">=<\/span><span class=\"xml doc comment - attribute quotes\" style=\"color:gray;\">\"<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"xml doc comment - attribute quotes\" style=\"color:gray;\">\"<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span><span class=\"xml doc comment - text\" style=\"color:green;\">Curve to intersect with<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;\/<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">param<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span>\n<span class=\"xml doc comment - delimiter\" style=\"color:gray;\">\/\/\/<\/span><span class=\"xml doc comment - text\" style=\"color:green;\"> <\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&lt;<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">returns<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;&lt;\/<\/span><span class=\"xml doc comment - name\" style=\"color:gray;\">returns<\/span><span class=\"xml doc comment - delimiter\" style=\"color:gray;\">&gt;<\/span>\n<span class=\"keyword\" style=\"color:blue;\">public<\/span> <span class=\"keyword\" style=\"color:blue;\">static<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">IntersectionResultArray<\/span> <span class=\"ReSharper Dead Code - extension method name - static symbol - (TRANSIENT)\" style=\"color:#74531f;\">PlaneCurveIntersection<\/span><span class=\"punctuation\">(<\/span><span class=\"keyword\" style=\"color:blue;\">this<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Plane<\/span> <span class=\"parameter name\" style=\"color:#1f377f;\">p<\/span><span class=\"punctuation\">,<\/span><span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Curve<\/span> <span class=\"parameter name\" style=\"color:#1f377f;\">c<\/span><span class=\"punctuation\">)<\/span>\n<span class=\"punctuation\">{<\/span>\n    <span class=\"comment\" style=\"color:green;\">\/\/ Find the projection point<\/span>\n    <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"extension method name - identifier - (TRANSIENT)\" style=\"color:#74531f;\">DistanceTo<\/span><span class=\"punctuation\">(<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - (TRANSIENT)\" style=\"color:#74531f;\">GetEndPoint<\/span><span class=\"punctuation\">(<\/span><span class=\"number\">0<\/span><span class=\"punctuation\">),<\/span> <span class=\"keyword\" style=\"color:blue;\">out<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">XYZ<\/span> <span class=\"local name\" style=\"color:#1f377f;\">projection<\/span><span class=\"punctuation\">);<\/span>\n    <span class=\"comment\" style=\"color:green;\">\/\/ construct two parallel lines l1 and l2 <\/span>\n    <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Line<\/span> <span class=\"local name\" style=\"color:#1f377f;\">l1<\/span> <span class=\"operator\">=<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Line<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - static symbol - (TRANSIENT)\" style=\"color:#74531f;\">CreateBound<\/span><span class=\"punctuation\">(<\/span><span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">projection<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">+<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">Length<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">*<\/span> <span class=\"punctuation\">(<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">XVec<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">+<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">YVec<\/span><span class=\"punctuation\">),<\/span>\n        <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">projection<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">+<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">Length<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">*<\/span> <span class=\"punctuation\">(<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">XVec<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">-<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">YVec<\/span><span class=\"punctuation\">));<\/span>\n    <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Line<\/span> <span class=\"local name\" style=\"color:#1f377f;\">l2<\/span> <span class=\"operator\">=<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Line<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - static symbol - (TRANSIENT)\" style=\"color:#74531f;\">CreateBound<\/span><span class=\"punctuation\">(<\/span><span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">projection<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">+<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">Length<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">*<\/span> <span class=\"punctuation\">(<\/span><span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">-<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">XVec<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">+<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">YVec<\/span><span class=\"punctuation\">),<\/span>\n        <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">projection<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">+<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">Length<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">*<\/span> <span class=\"punctuation\">(<\/span><span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">-<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">XVec<\/span> <span class=\"operator - operator - overloaded - (TRANSIENT)\" style=\"color:#74531f;\">-<\/span> <span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">p<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">YVec<\/span><span class=\"punctuation\">));<\/span>\n    <span class=\"comment\" style=\"color:green;\">\/\/ Add lines into single CurveLoop list<\/span>\n    <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">CurveLoop<\/span> <span class=\"local name\" style=\"color:#1f377f;\">cl1<\/span> <span class=\"operator\">=<\/span> <span class=\"keyword\" style=\"color:blue;\">new<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">CurveLoop<\/span><span class=\"punctuation\">();<\/span> <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">cl1<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - (TRANSIENT)\" style=\"color:#74531f;\">Append<\/span><span class=\"punctuation\">(<\/span><span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">l1<\/span><span class=\"punctuation\">);<\/span>\n    <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">CurveLoop<\/span> <span class=\"local name\" style=\"color:#1f377f;\">cl2<\/span> <span class=\"operator\">=<\/span> <span class=\"keyword\" style=\"color:blue;\">new<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">CurveLoop<\/span><span class=\"punctuation\">();<\/span> <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">cl2<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - (TRANSIENT)\" style=\"color:#74531f;\">Append<\/span><span class=\"punctuation\">(<\/span><span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">l2<\/span><span class=\"punctuation\">);<\/span>\n    <span class=\"comment\" style=\"color:green;\">\/\/Generate Loft surface<\/span>\n    <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">Solid<\/span> <span class=\"local name\" style=\"color:#1f377f;\">s<\/span> <span class=\"operator\">=<\/span> <span class=\"class name - identifier - static symbol - (TRANSIENT)\" style=\"color:#2b91af;\">GeometryCreationUtilities<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - static symbol - (TRANSIENT)\" style=\"color:#74531f;\">CreateLoftGeometry<\/span><span class=\"punctuation\">(<\/span>\n        <span class=\"keyword\" style=\"color:blue;\">new<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">List<\/span><span class=\"punctuation\">&lt;<\/span><span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">CurveLoop<\/span><span class=\"punctuation\">&gt;<\/span><span class=\"ReSharper Dead Code - punctuation - (TRANSIENT)\">()<\/span> <span class=\"punctuation\">{<\/span> <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">cl1<\/span><span class=\"punctuation\">,<\/span> <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">cl2<\/span> <span class=\"punctuation\">},<\/span> \n        <span class=\"keyword\" style=\"color:blue;\">new<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">SolidOptions<\/span><span class=\"punctuation\">(<\/span><span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">ElementId<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - static symbol - (TRANSIENT)\">InvalidElementId<\/span><span class=\"punctuation\">,<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">ElementId<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - static symbol - (TRANSIENT)\">InvalidElementId<\/span><span class=\"punctuation\">)<\/span>\n        <span class=\"punctuation\">);<\/span>\n    <span class=\"comment\" style=\"color:green;\">\/\/ intersect the plane with the face (only on face is available)<\/span>\n    <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">s<\/span><span class=\"operator\">.<\/span><span class=\"identifier - property name - (TRANSIENT)\">Faces<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - (TRANSIENT)\" style=\"color:#74531f;\">get_Item<\/span><span class=\"punctuation\">(<\/span><span class=\"number\">0<\/span><span class=\"punctuation\">)<\/span><span class=\"operator\">.<\/span><span class=\"identifier - method name - (TRANSIENT)\" style=\"color:#74531f;\">Intersect<\/span><span class=\"punctuation\">(<\/span><span class=\"identifier - parameter name - (TRANSIENT)\" style=\"color:#1f377f;\">c<\/span><span class=\"punctuation\">,<\/span> <span class=\"keyword\" style=\"color:blue;\">out<\/span> <span class=\"class name - identifier - (TRANSIENT)\" style=\"color:#2b91af;\">IntersectionResultArray<\/span> <span class=\"local name\" style=\"color:#1f377f;\">results<\/span><span class=\"punctuation\">);<\/span>\n    <span class=\"keyword - control\" style=\"color:#8f08c4;\">return<\/span> <span class=\"identifier - local name - (TRANSIENT)\" style=\"color:#1f377f;\">results<\/span><span class=\"punctuation\">;<\/span>\n<span class=\"punctuation\">}<\/span><\/pre>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last my post I discussed this topic in the context of linear algebra and differential geometry. We also briefly discussed root finding method. Although the method works properly but you are probably looking for something faster!&nbsp; Here I would like to use a method from Revit API to improve the performance.&nbsp; public FaceIntersectionFaceResult [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":890,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":""},"categories":[46,45],"tags":[50,47,48],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Plane and curve intersection (2) - Parametric Zoo<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Plane and curve intersection (2) - Parametric Zoo\" \/>\n<meta property=\"og:description\" content=\"In my last my post I discussed this topic in the context of linear algebra and differential geometry. We also briefly discussed root finding method. Although the method works properly but you are probably looking for something faster!&nbsp; Here I would like to use a method from Revit API to improve the performance.&nbsp; public FaceIntersectionFaceResult [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Parametric Zoo\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-07T20:26:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-07T20:26:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1733\" \/>\n\t<meta property=\"og:image:height\" content=\"1156\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"PARA\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"PARA\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.parametriczoo.com\/#website\",\"url\":\"https:\/\/www.parametriczoo.com\/\",\"name\":\"Parametric Zoo\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.parametriczoo.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#primaryimage\",\"url\":\"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg\",\"contentUrl\":\"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg\",\"width\":1733,\"height\":1156},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/\",\"url\":\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/\",\"name\":\"Plane and curve intersection (2) - Parametric Zoo\",\"isPartOf\":{\"@id\":\"https:\/\/www.parametriczoo.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#primaryimage\"},\"datePublished\":\"2020-04-07T20:26:07+00:00\",\"dateModified\":\"2020-04-07T20:26:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.parametriczoo.com\/#\/schema\/person\/0368c6eb8bfe3a003504793be2a2e0e3\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.parametriczoo.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Plane and curve intersection (2)\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.parametriczoo.com\/#\/schema\/person\/0368c6eb8bfe3a003504793be2a2e0e3\",\"name\":\"PARA\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.parametriczoo.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2b2ff0ff40493545df12d0b31a504675?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2b2ff0ff40493545df12d0b31a504675?s=96&d=mm&r=g\",\"caption\":\"PARA\"},\"url\":\"https:\/\/www.parametriczoo.com\/index.php\/author\/para\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Plane and curve intersection (2) - Parametric Zoo","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/","og_locale":"en_US","og_type":"article","og_title":"Plane and curve intersection (2) - Parametric Zoo","og_description":"In my last my post I discussed this topic in the context of linear algebra and differential geometry. We also briefly discussed root finding method. Although the method works properly but you are probably looking for something faster!&nbsp; Here I would like to use a method from Revit API to improve the performance.&nbsp; public FaceIntersectionFaceResult [&hellip;]","og_url":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/","og_site_name":"Parametric Zoo","article_published_time":"2020-04-07T20:26:07+00:00","article_modified_time":"2020-04-07T20:26:16+00:00","og_image":[{"width":1733,"height":1156,"url":"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg","type":"image\/jpeg"}],"author":"PARA","twitter_card":"summary_large_image","twitter_misc":{"Written by":"PARA","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.parametriczoo.com\/#website","url":"https:\/\/www.parametriczoo.com\/","name":"Parametric Zoo","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.parametriczoo.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#primaryimage","url":"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg","contentUrl":"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg","width":1733,"height":1156},{"@type":"WebPage","@id":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/","url":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/","name":"Plane and curve intersection (2) - Parametric Zoo","isPartOf":{"@id":"https:\/\/www.parametriczoo.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#primaryimage"},"datePublished":"2020-04-07T20:26:07+00:00","dateModified":"2020-04-07T20:26:16+00:00","author":{"@id":"https:\/\/www.parametriczoo.com\/#\/schema\/person\/0368c6eb8bfe3a003504793be2a2e0e3"},"breadcrumb":{"@id":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.parametriczoo.com\/index.php\/2020\/04\/07\/plane-and-curve-intersection-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.parametriczoo.com\/"},{"@type":"ListItem","position":2,"name":"Plane and curve intersection (2)"}]},{"@type":"Person","@id":"https:\/\/www.parametriczoo.com\/#\/schema\/person\/0368c6eb8bfe3a003504793be2a2e0e3","name":"PARA","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.parametriczoo.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2b2ff0ff40493545df12d0b31a504675?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2b2ff0ff40493545df12d0b31a504675?s=96&d=mm&r=g","caption":"PARA"},"url":"https:\/\/www.parametriczoo.com\/index.php\/author\/para\/"}]}},"jetpack_featured_media_url":"https:\/\/www.parametriczoo.com\/wp-content\/uploads\/2020\/03\/Curve-plane-intersection.jpg","_links":{"self":[{"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/posts\/877"}],"collection":[{"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/comments?post=877"}],"version-history":[{"count":0,"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/posts\/877\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/media\/890"}],"wp:attachment":[{"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/media?parent=877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/categories?post=877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.parametriczoo.com\/index.php\/wp-json\/wp\/v2\/tags?post=877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}