Skip to content

Commit

Permalink
owverwrite face-normal-vector, see euslisp/EusLisp#21
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Jun 24, 2014
1 parent 454bde8 commit 23e85ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions irteus/test/geo.l
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

(init-unit-test)

(in-package "GEO")
(defun face-normal-vector (vertices)
(let* ((v1 (first vertices)) (v2) (vlist (rest vertices))
(v (float-vector 0 0 0))
(normal (float-vector 0 0 0)))
(while vlist
(setq v2 (pop vlist))
(v+ (v* v1 v2 v) normal normal)
(setq v1 v2))
(setq v2 (car vertices))
(v+ (v* v1 v2 v) normal normal)
(normalize-vector normal normal)) )

(defmethod polygon
(:reset-normal ()
(setq normal (face-normal-vector (rest vertices))
distance (- (v. normal (car vertices))))))
(in-package "USER")

(deftest test-body+
(let (bottom-frame
Expand Down

0 comments on commit 23e85ee

Please sign in to comment.