David Bethel
Usenet Archive
- Joined
- Nov 22, 2001
- Messages
- 135
- Reaction score
- 0
Greetings,
In plain AutoLISP
;;;Here are the point lists of (4) coplaner lines that form a 4 sided polygon ( never a bowtie - always an open face ).
(setq iv '(((1 1 0) (1 2 0))
((2 1 0) (2 2 0))
((1 2 0) (2 2 0))
((1 1 0) (2 1 0))))
;;;I'm looking to sort the list so that the common points are in order
;;;The resulting list would be consist of vectors like this:
(setq fl (list (nth 0 iv)
(nth 2 iv)
(reverse (nth 1 iv))
(reverse (nth 3 iv))))
'(((1 1 0) (1 2 0))
((1 2 0) (2 2 0))
((2 2 0) (2 1 0))
((2 1 0) (1 1 0))))
;;;This would extract the output points - CCW /CW direction is irelevant (foreach v fl (setq output (cons (car v) output)))
'((1 1 0) (1 2 0) (2 2 0) (2 1 0))
Any thoughts???? -David
In plain AutoLISP
;;;Here are the point lists of (4) coplaner lines that form a 4 sided polygon ( never a bowtie - always an open face ).
(setq iv '(((1 1 0) (1 2 0))
((2 1 0) (2 2 0))
((1 2 0) (2 2 0))
((1 1 0) (2 1 0))))
;;;I'm looking to sort the list so that the common points are in order
;;;The resulting list would be consist of vectors like this:
(setq fl (list (nth 0 iv)
(nth 2 iv)
(reverse (nth 1 iv))
(reverse (nth 3 iv))))
'(((1 1 0) (1 2 0))
((1 2 0) (2 2 0))
((2 2 0) (2 1 0))
((2 1 0) (1 1 0))))
;;;This would extract the output points - CCW /CW direction is irelevant (foreach v fl (setq output (cons (car v) output)))
'((1 1 0) (1 2 0) (2 2 0) (2 1 0))
Any thoughts???? -David