@pkohut
I saw attachment, but reposting the same file I attach doesn't solve things... I posted files in hope that they could be used purpously in task for completion of whole ridge solution on any non-ortho closed polygonal LWPOLYLINE... Nevertheless I attached few more at *.ZIP at cadtutor... So now I wait cos' I don't know why it stops after drawing 6 lines... At the end I'll give up with those roof-*.lsp... So still I am hoping that "roof2d-new-new-new.lsp" could be converted to *.arx, *.brx, or *.dll...
Have a nice day...
M.R.
So, I spent about 10 hours looking at the code trying to see how it works. Additions were made, to your file, to facilitate collecting data for analysis. That "changed" lisp file is included in my zip attachment. This is just one of the steps I might go through when looking at an unknown problem space. So, the lisp file I attached is not the same as your original.
Given the additional data points, my intent was to look at why the lst variable is not populated properly. Either I'll get lucky figuring it out on my own or maybe someone will chime in with support. Once the program is creating the correct results I can move on to optimizations.
Speaking of optimizations, one of my collected data points was for the entmakex of circle and entdel of said circle, which is called about 750 times. Calling entmake(x) is not very fast and one of the vl- create routines would be much faster. Since the circles are just used for their built in geometry routines, only 2 circles are needed. Create them early, then modify their radius and center points everywhere entmakex is called.
Converting "roof2d-new-new-new.lsp" to ARX can be done by someone familiar with ARX. Someone would have to go routine by routine and do mental gymnastics from Autolisp to ARX. I am not aware of any automated task to do such a conversion. The benefit of such a conversion, faster speed, will be lost because the nested loops run deep recalculating same values over and over. I was going to spend a few cycles doing the conversion to ARX for a straight on head to head comparison. After that I was going to investigate different collection algorithms for huge speed improvements.
I don't think I have anything else useful to contribute.
Later.
That's all I got to say