@abilabib wrote:
For some conditions work well. But at any condition (red rectangle) the minpoint is wrong.
How to solve this one
Based on the image you posted, the "bottom" for you is the right most as for the red rectangles the minpoint is bottom left.
If thats the case, you need to change the predicate function to this:
(setq ptmin (car (vl-sort PointList (function (lambda (e1 e2)
(cond
((< (cadr e1) (cadr e2)) )
((eq (cadr e1) (cadr e2))(> (car e1) (car e2)))
)))))
)
If Y value is the same, use the one on the right most. This will deal with the "How to solve this one?" issue.
I'm still not sure if that is what you require for your request on psot #1
(setq ptmin (car (vl-sort PointList (function (lambda (e1 e2)
(cond
((< (cadr e1) (cadr e2)) )
((eq (cadr e1) (cadr e2))(> (car e1) (car e2))) ;<-- for bottom left, use "<"
)))))
)
HTH