home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
Software
/
ASCENDER
/
ascendMar8.tar
/
UMass
/
BuildingFinder
/
Lisp
/
extrude.lisp
< prev
next >
Wrap
Lisp/Scheme
|
1995-04-12
|
1KB
|
42 lines
(in-package 'cme)
#| ********old version that doesn't work very well
(defun extrude-roof-curve (curve)
(let* ((extru (make-extrusion-from-vertex-list
(listarray (vertices curve))
(object-to-world-transform curve)
(world curve)))
(vlist (make-vertex-list-from-vertex-array (vertices curve)))
(vert (car vlist)))
(set-z-size extru (- (third vert)
(terrain-model-Z-at-XY
(find-terrain-model (world curve))
(car vert) (cadr vert))))
extru))
|#
(defun find-lowest-terrain-Z-under-curve (curve)
(let ((terrain (find-terrain-model (world curve)))
(vertlist (make-vertex-list-from-vertex-array (vertices curve))))
(apply #'min (mapcar #'(lambda (vert)
(terrain-model-Z-at-XY
terrain
(car vert)
(cadr vert)))
vertlist))))
(defun extrude-roof-curve (curve)
(let ((groundz (find-lowest-terrain-z-under-curve curve))
(roofz (vertex-obj-z (car (listarray (vertices curve))))))
(make-extrusion curve :bottom-z groundz :z-size (- groundz roofz))))
(defun z-height-at-XY (xpos ypos zpos world)
(let* ((terrain (find-terrain-model world))
(ground (terrain-model-Z-at-XY terrain xpos ypos)))
(- zpos ground)))