1

I have a polygon shapefile which I'd like to rotate 90 degrees about the x-axis in 3d. The polygon is currently flat (projected in plan view), I'd like to project it vertically. Specifically, this is a geologic cross section currently projected with depth on the Y-axis - I want to turn the polygon into it's proper Z-orientation.

I have access to 3d-analyst and ArcScene, AutoCAD.

2

I placed points along section line at regular interval:

enter image description here and sampled top and bottom elevations of clay and basalt layers: enter image description here

After that I ran script below twice from active mxd. Highlighted fields are the ones I used for 1st run:

enter image description here

to get this:

enter image description here

Script creates 2 near-vertical triangles using coordinates of 2 consequitive points and pairs of elevation values.

Due to smartness (is this a correct word?) of ArcGIS, I was unable to create true vertical triangles (which works perfectly fine in grandmother ArcView 3 environment), because any attempt to create polygon with zero area in XY plane, results in NULL shape. Play with parameter fArcGIS in the script to see how small you can make it to force ArcGIS in create polygon instead of fake shape.

On the other hand the slight horizontal shift of 0.1 m that I applied, worked fine for visual presentation of geology and I hope it is only visual thing you are after, otherwise I strongly suggest software truly capable of working with 3D geometries.

 ##3D fence maker
import arcpy, sys, os,traceback
inLayer = arcpy.GetParameterAsText(0)
layerFld=arcpy.GetParameterAsText(1)
roof=arcpy.GetParameterAsText(2)
base=arcpy.GetParameterAsText(3)
target=arcpy.GetParameterAsText(4)
d=arcpy.Describe(inLayer)
SR=d.spatialReference
fArcGIS=0.1

try:
    def showPyMessage():
        arcpy.AddMessage(str(time.ctime()) + " - " + message)
    curT = arcpy.da.InsertCursor(target,["SHAPE@","NAME"])
    for i,row in enumerate(arcpy.da.UpdateCursor(inLayer, ("SHAPE@XY",layerFld,roof,base))):
        if i==0:
            (x1,y1),lr,UpZ1,BotZ1=row
        else:
            (x2,y2),lr,UpZ2,BotZ2=row
            LL=arcpy.Point(x1,y1,BotZ1)
            UL=arcpy.Point(x1+fArcGIS,y1+fArcGIS,UpZ1)
            UR=arcpy.Point(x2,y2,UpZ2)
            pgonZ=arcpy.Polygon(arcpy.Array([LL,UL,UR,LL]),SR,True)
            curT.insertRow((pgonZ,lr))
            LR=arcpy.Point(x2+fArcGIS,y2+fArcGIS,BotZ2)
            pgonZ=arcpy.Polygon(arcpy.Array([LL,UR,LR,LL]),SR,True)
            curT.insertRow((pgonZ,lr))
            (x1,y1),lr,UpZ1,BotZ1=row
except:
    message = "\n*** PYTHON ERRORS *** "; showPyMessage()
    message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]; showPyMessage()
    message = "Python Error Info: " +  str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()
| improve this answer | |
  • Excellent, thanks for your help. I haven't tried this yet, but it might be useful going forward. – bkn79 Aug 17 '16 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.