David,
I'll give you what little expertise I have in this area. Lets assign the
boxes label 1, 2, and 3 to p1, p2, and p3. Using Tony's vector side
function you can determine where the endpoints of each line are relative to
your green vector.
First, to get the second argument to vector-side, subtract the coordinates
to get the direction vector.
(setq v2 (mapcar '- p2 p1))
Then find out which side p3 is on.
(vector-side p1 v2 p3)
Then trim or erase based on which side the two points of the line are on.
--
Cliff
;-----------------------------------------------------------------
;Here is one from the master Tony Tanzillo, enjoy
;;; (vector-side
)
;;; Returns an integer code indicating position of
;;; in relation to the directed vector whose endpoints are
;;; and .
;;; Result Meaning
;;; -1 Point is to the right of vector.
;;; 0 Point is on (colinear with) vector
;;; 1 Point is to the left of vector.
(defun vector-side (v1 v2 p / r)
(setq
r
(-
(* (- (car v2) (car v1)) (- (cadr p) (cadr v1)))
(* (- (cadr v2) (cadr v1)) (- (car p) (car v1)))
)
)
(cond
((equal r 0.0 1e-8) 0)
(t (fix (/ (abs r) r)))
)
)
"David Bethel" wrote in message
news:BA5F77B301E27160ED742AB507C5AF51@in.WebX.maYIadrTaRb...
| Ok guys,
|
| I've over complicated this 1.
|
| The base premise is to select the green line, pick the offset side, erase
| all lines that exist entirely on the offset side, and trim lines that
extend
| thru the green line vector extended infinitely back to the vector. I've
| started with clockwise tests for the 3 points ( 1 2 3 ). I'm stuck on a
| good test to see if points are on the offset side or not. The end result
| would be that only the blue lines remain. Any suggestions out there?
| TIA -David
|
|
|
|
| ---
| Outgoing mail is certified Virus Free.
| Checked by AVG anti-virus system (http://www.grisoft.com).
| Version: 6.0.282 / Virus Database: 150 - Release Date: 9/26/01
|
|
----------------------------------------------------------------------------
----