David Bethel Posted October 23, 2010 Posted October 23, 2010 I would definitely recommend using a 3D point value for midpoint calculations: (defun mid_pt (p1 p2 / xp yp zp) ;Mid Point (setq xp (+ (nth 0 p1) (* 0.5 (- (nth 0 p2) (nth 0 p1))))) (setq yp (+ (nth 1 p1) (* 0.5 (- (nth 1 p2) (nth 1 p1))))) (setq zp (+ (nth 2 p1) (* 0.5 (- (nth 2 p2) (nth 2 p1))))) (list xp yp zp)) (defun mid_point (s e) (mapcar '(lambda (a b) (* (+ a b) 0.5)) s e)) (defun midpt (p1 p2) (cal "(p1+p2)/2")) The missing z axis could lead to all kinds on oddities. -David Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.