<?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: 3D intersection of 2 3D polylines with Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242345#M18843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose you could test if the lines intersect in 2D. If so, find the XY coordinates where they intersect. Calculate the Z coordinate at those locations. See if they're the same. If the lines don't intersect in 2D, they don't intersect in 3D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2018 20:09:20 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2018-07-04T20:09:20Z</dc:date>
    <item>
      <title>3D intersection of 2 3D polylines with Python</title>
      <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242342#M18840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to the arcpy. I searched the community and I didn't find the answer to the question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have problem with finding the intersection of two 3D polylines (each one with 2 vertex) with python in arcgis standard 10.5. &amp;nbsp;Polylines are not in a .shp file, because they created using polyline1 = arcpy.polyline(...) so I can call them directly.&lt;/P&gt;&lt;P&gt;Using point = polyline1.intersect(polyline2 , 1) &amp;nbsp;just create a multipoint class without anypoint in it.&lt;/P&gt;&lt;P&gt;I need the intersection point coordination (with z) as an answer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I have problem with writing 3d polylines to .shp and .mdb files. after writing polylines to the file, the arcmap omit the z values and all the lines are horizontal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I really appriciate help with these 2 questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is an example of the problems:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from os.path import expanduser&lt;BR /&gt;from os.path import join as joinadd&lt;BR /&gt;import os&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#first question:&lt;/P&gt;&lt;P&gt;#2 below polylines obviously have intersection&lt;/P&gt;&lt;P&gt;#creating 3d polylines&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;polytemp1=arcpy.Polyline(arcpy.Array([arcpy.Point(1,2,1),arcpy.Point(10,11,10)]),"Unknown",True,False)&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;polytemp2=arcpy.Polyline(arcpy.Array([arcpy.Point(1,2,5),arcpy.Point(10,11,5)]),"Unknown",True,False)&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;#check for the intersection with disjoint&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;polytemp1.disjoint(polytemp2) #The answer is False, which means there is an intersection, but is disjoint check in 3D???? or just 2D????&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;#finding the point (3D)&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;SPAN style="text-indent: 0px;"&gt;pnt = polyline1.intersect(polyline2 , 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;SPAN style="text-indent: 0px;"&gt;print 'newpoint' ,newpoint.pointCount, newpoint.type, newpoint.partCount #This shows that there is no point in the multipoint!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;SPAN style="text-indent: 0px;"&gt;#second question: writing a 3d polyline in a .shp file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;SPAN style="text-indent: 0px;"&gt;homeadd =joinadd(expanduser("~"),"arcgistemp")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;SPAN style="text-indent: 0px;"&gt;&lt;BR /&gt; if not os.path.exists(homeadd):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;SPAN style="text-indent: 0px;"&gt;&amp;nbsp; &amp;nbsp; os.makedirs(homeadd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: -5.0px; margin: 0.0px 0.0px 0.0px 5.0px;"&gt;&lt;/P&gt;&lt;P&gt;arcpy.CreateFeatureclass_management(homeadd,"polyline1.shp","POLYLINE","","DISABLED","ENABLED","")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; cursor = arcpy.da.InsertCursor(polyline1add, ["SHAPE@"])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cursor.insertRow([polyline1])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;del cursor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#now I have the .shp file, but the lines are 2D!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2018 13:48:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242342#M18840</guid>
      <dc:creator>ashkanhassanzadeh</dc:creator>
      <dc:date>2018-07-03T13:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: 3D intersection of 2 3D polylines with Python</title>
      <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242343#M18841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Question 1: change one of the z coordinates so that the lines clearly do not intersect along the z-axis, but still would intersect along the xy plane, to check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question 2: you go through a lot of work to create a feature class called 'homeadd', and then insert into a different feature class, 'polyline1add'. Is that intentional?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 16:16:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242343#M18841</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-07-04T16:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: 3D intersection of 2 3D polylines with Python</title>
      <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242344#M18842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Darren.&lt;/P&gt;&lt;P&gt;As I understand, .disjoint and .intersect just works in 2D (without Z).&lt;/P&gt;&lt;P&gt;Now the question is, 1. how to check if intersection exist in 3D? &amp;nbsp;2.How to find the intersection point (X,Y,Z)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 18:58:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242344#M18842</guid>
      <dc:creator>ashkanhassanzadeh</dc:creator>
      <dc:date>2018-07-04T18:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: 3D intersection of 2 3D polylines with Python</title>
      <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242345#M18843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose you could test if the lines intersect in 2D. If so, find the XY coordinates where they intersect. Calculate the Z coordinate at those locations. See if they're the same. If the lines don't intersect in 2D, they don't intersect in 3D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 20:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242345#M18843</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-07-04T20:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: 3D intersection of 2 3D polylines with Python</title>
      <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242346#M18844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is If the lines have intersect in their 2D projection, it does not mean that they have intersect in 3D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 09:15:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242346#M18844</guid>
      <dc:creator>ashkanhassanzadeh</dc:creator>
      <dc:date>2018-07-10T09:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: 3D intersection of 2 3D polylines with Python</title>
      <link>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242347#M18845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's why&amp;nbsp;I suggest calculate the Z-coordinates at the 2D intersection point. If it's the same for both line, then they intersect 3D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 15:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/3d-intersection-of-2-3d-polylines-with-python/m-p/242347#M18845</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-07-10T15:53:04Z</dc:date>
    </item>
  </channel>
</rss>

