Dear Lee,
I thought about your idea (the complexities of the problem) and since I'm not expert at lisp programming in contrast to
you and other dear members,I shifted to VB that is simpler for me , so I solved this problem in these steps :
1- export coordinates of poly lines to a vector array in a text file (x1 y1 x2 y2 ...) .
2- After checking output coordinates manually , I load them again ( we can skip this step )
3- by below codes I find midpoints of upper and lower coordinates
4- fit a poly line to these points
5- offset them up and down (optional)
Actually I solved it Mathematically
my codes :
Export_All_Polylines_Vertexes_ToFile "D:\Users\my Temp\TEST2.txt" ' It's a sub routine
Import_All_Polylines_Vertexes_To_Array "D:\Users\my Temp\TEST2.txt", imp_Array
Id1 = (UBound(imp_Array) + 1)
ReDim X(0 To Id1 / 2)
ReDim Y(0 To Id1 / 2)
For i = 0 To (Id1 / 2) - 1 Step 2
X(i) = imp_Array(2 * i)
Next i
For i = 0 To (Id1 / 2) - 1 Step 2
Y(i) = imp_Array((2 * i) + 1)
Next i
' Debug.Print UBound(X), UBound(Y)
n = 0
For i = 0 To UBound(X) - 1
For j = 1 To UBound(X)
ds = getdist(X(i), Y(i), X(j), Y(j))
If (ds >= 12.4 And ds <= 12.6) Then
ReDim DMX(0 To n)
ReDim DMY(0 To n)
DMX(n) = Round(((X(i) + X(j)) / 2), 2) ' X of Midpoints coordinates
DMY(n) = Round(((Y(i) + Y(j)) / 2), 2) ' Y of Midpoints coordinates
Debug.Print n, DMX(n), DMY(n)
n = n + 1
Else
End If
Next j
Next i
Me.Show
Now, if you and other experts accept this solution I'll translate it to lisp codes .
Thanks for your advices though.