One of multiple solutions. Create points inside polygon, fishnet will do. Add vertices of polygons to this set. Create TIN. Export tin triangles and clip them:
Updated answer on points creation. Script below works from ArcGIS and takes 3 parameters:
- Layer in TOC. Used to define extent.
- Distance between points, type double
- Points layer (empty)
import arcpy, traceback, os, sys
extentLayer = arcpy.GetParameterAsText(0)
xStep = float(arcpy.GetParameterAsText(1))
destLayer = arcpy.GetParameterAsText(2)
try:
def showPyMessage():
arcpy.AddMessage(str(time.ctime()) + " - " + message)
def isLayerExist(lName):
layer = arcpy.mapping.ListLayers(mxd,lName)[0]
ext=layer.getSelectedExtent()
return (layer,ext)
mxd = arcpy.mapping.MapDocument("CURRENT")
destLayer, anExt=isLayerExist(destLayer)
extentLayer, anExt=isLayerExist(extentLayer)
yMin,yMax,xS,xE=anExt.YMin,anExt.YMax,anExt.XMin,anExt.XMax
yStep=xStep/2*math.pow(3.0,0.5)
curT = arcpy.da.InsertCursor(destLayer,"SHAPE@")
p=arcpy.Point()
iMax=int((yMax-yMin)/yStep)+2
jMax=int((xE-xS)/xStep)+2
for i in range(iMax):
Y=yMin+i*yStep
xStart=xS+i%2*xStep/2
xEnd = xE +i%2*xStep/2
for j in range(jMax):
X=xStart+j*xStep
p.X,p.Y=X,Y
theRow=(p,)
curT.insertRow(theRow)
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()