;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Jennifer Seely ; ; final_project_fixed_19may.LSP ; ; for use with NITROS (developed by Takehiko Nagakura) ; ; ; ; Final Project - 4.207 - Spring 2003 ; ; 3D Platforms Connected by Stairs and Ramps ; ; The Random Version ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variable Explanation ;; --------------------------------------------------------------- ;; xo, yo, zo : ucs origin ;; zaxis : direction of the z-axis ;; rot : ucs rotation angle about the z-axis ;; width : platform center height and width plus edge width ;; platform_thick : thickness of the platform and edge elements ;; edge_ h : platform edge height ;; step_thick : thickness of the steps ;; rise : rise of the stairs (toe-to-toe vertical distance) ;; run : run of the stairs (toe-to-toe horizontal distance) ;; num : number of stairs drawn in each compound type ;; ramp_length : length of ramp ;; slope : vertical distance from the starting to ending points of the ramp ;; side : width of ramp sides ;; rail_h : height of handrail ;; support_w : width of stair support ;;; ;;; ;;; ;;; ;;; TYPE DECLARATIONS ;;; ;;; ;;; ;;; ;;; ;; Compound Types: (nt_def_type "four_sided_platform" 'four_sided_platform '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("slope" . 20) ("side" . 4))) (nt_add_seed_type "four_sided_platform") (nt_def_type "three_sided_platform" 'three_sided_platform '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("slope" . 20) ("side" . 4))) (nt_add_seed_type "three_sided_platform") (nt_def_type "two_sided_platform" 'two_sided_platform '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("slope" . 20) ("side" . 4))) (nt_add_seed_type "two_sided_platform") (nt_def_type "extend_platform" 'extend_platform '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("slope" . 20) ("side" . 4))) (nt_def_type "ascending_steps" 'ascending_steps '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10) ("slope" . 20) ("side" . 4))) (nt_def_type "descending_steps" 'descending_steps '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10) ("slope" . 20) ("side" . 4))) (nt_def_type "ramp_and_sides" 'ramp_and_sides '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("ramp_length" . 60) ("slope" . 20) ("side" . 4) ("rail_h" . 36))) (nt_def_type "ramp_handrails" 'ramp_handrails '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6.0) ("platform_thick" . 4) ("ramp_length" . 60) ("slope" . 20) ("side" . 4) ("rail_h" . 36))) (nt_def_type "support_for_desc_steps" 'support_for_desc_steps '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10) ("slope" . 20) ("side" . 4) ("support_w" . 4))) (nt_def_type "support_for_asc_steps" 'support_for_asc_steps '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10) ("slope" . 20) ("side" . 4) ("support_w" . 4))) ;; Literal Types: (nt_def_type "platform_center" 'platform_center '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("platform_thick" . 4))) (nt_def_type "live_edge" 'live_edge '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("slope" . 20) ("side" . 4))) (nt_def_type "dead_edge" 'dead_edge '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4))) (nt_def_type "desc_steps" 'desc_steps '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10))) (nt_def_type "asc_steps" 'asc_steps '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10))) (nt_def_type "desc_stair_support" 'desc_stair_support '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10) ("slope" . 20) ("side" . 4) ("support_w" . 4))) (nt_def_type "asc_stair_support" 'asc_stair_support '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("step_thick" . 2) ("rise" . 7) ("run" . 11) ("num" . 10) ("slope" . 20) ("side" . 4) ("support_w" . 4))) (nt_def_type "ramp" 'ramp '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("ramp_length" . 60) ("slope" . 20) ("side" . 4))) (nt_def_type "live_ramp_side" 'live_ramp_side '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("ramp_length" . 60) ("slope" . 20) ("side" . 4) ("rail_h" . 36))) (nt_def_type "dead_ramp_side" 'dead_ramp_side '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("ramp_length" . 60) ("slope" . 20) ("side" . 4) ("rail_h" . 36))) (nt_def_type "handrail" 'handrail '(("xo" . 0) ("yo" . 0) ("zo" . 0) ("zaxis" . 1) ("rot" . 0) ("width" . 30) ("edge_h" . 6) ("platform_thick" . 4) ("ramp_length" . 60) ("slope" . 20) ("side" . 4) ("rail_h" . 36))) ;;; ;;; ;;; ;;; ;;; DRAWING PREPARTAION ;;; ;;; ;;; ;;; ;;; ;; Prepare Drawing Area: ;; --------------------------------------------------------------- (command "osnap" "off") (command "ucs" "world") (command "-layer" "make" "platform" "color" "white" "platform" "") (command "-view" "seiso") (command "zoom" "scale" 0.015) ;;; ;;; ;;; ;;; ;;; GEOMETRY DEFINITIONS ;;; ;;; ;;; ;;; ;;; ;; Define Geometries: ;; --------------------------------------------------------------- (defun platform_center (xo yo zo zaxis rot width platform_thick) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "box" (list 0 0 0) (list width width platform_thick)) (command "ucs" "world") (entlast) ) (defun live_edge (xo yo zo zaxis rot width edge_h platform_thick slope side) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "box" (list 0 0 0) (list width (- edge_h) platform_thick)) (command "ucs" "world") (entlast) ) (defun dead_edge (xo yo zo zaxis rot width edge_h platform_thick) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "box" (list 0 0 0) (list width (- edge_h) platform_thick)) (command "ucs" "world") (entlast) ) (defun desc_steps (xo yo zo zaxis rot width step_thick rise run num / all_steps xstep ystep zstep) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (setq all_steps nil) (setq xstep 0) (setq ystep 0) (setq zstep 0) (repeat num (command "box" (list xstep ystep zstep) (list (+ xstep width) (- ystep (+ run 2)) (- zstep step_thick))) (setq all_steps (cons (entlast) all_steps)) (setq ystep (- ystep run)) (setq zstep (+ zstep rise)) ) (command "ucs" "world") (nt_make_ablock all_steps) ) (defun asc_steps (xo yo zo zaxis rot width step_thick rise run num / all_steps xstep ystep zstep) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (setq all_steps nil) (setq xstep 0) (setq ystep 0) (setq zstep 0) (repeat num (command "box" (list xstep ystep zstep) (list (+ xstep width) (- ystep (+ run 2)) (- zstep step_thick))) (setq all_steps (cons (entlast) all_steps)) (setq ystep (- ystep run)) (setq zstep (+ zstep rise)) ) (command "ucs" "world") (nt_make_ablock all_steps) ) (defun ramp (xo yo zo zaxis rot width edge_h platform_thick ramp_length slope side / rline_01 rline_02 rline_03 rline_04 ramp_pline) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "line" (list side (- edge_h) 0) (list side (- edge_h) platform_thick) "") (setq rline_01 (entlast)) (command "line" (list side (- edge_h) platform_thick) (list side (- ramp_length) (+ platform_thick slope)) "") (setq rline_02 (entlast)) (command "line" (list side (- edge_h) 0) (list side (- ramp_length) slope) "") (setq rline_03 (entlast)) (command "line" (list side (- ramp_length) (+ platform_thick slope)) (list side (- ramp_length) slope) "") (setq rline_04 (entlast)) (command "ucs" "y" 90) (command "pedit" rline_01 "yes" "join" rline_02 rline_03 rline_04 "" "") (setq ramp_pline (entlast)) (command "extrude" ramp_pline "" (- width (* side 2)) "") (command "ucs" "world") (entlast) ) (defun live_ramp_side (xo yo zo zaxis rot width edge_h platform_thick ramp_length slope side rail_h / rline_01 rline_02 rline_03 rline_04 ramp_pline) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "line" (list 0 (- edge_h) 0) (list 0 (- edge_h) platform_thick) "") (setq sline_01 (entlast)) (command "line" (list 0 (- edge_h) platform_thick) (list 0 (- ramp_length) (+ platform_thick slope)) "") (setq sline_02 (entlast)) (command "line" (list 0 (- edge_h) 0) (list 0 (- ramp_length) slope) "") (setq sline_03 (entlast)) (command "line" (list 0 (- ramp_length) (+ platform_thick slope)) (list 0 (- ramp_length) slope) "") (setq sline_04 (entlast)) (command "ucs" "y" 90) (command "pedit" sline_01 "yes" "join" sline_02 sline_03 sline_04 "" "") (setq side_pline (entlast)) (command "extrude" side_pline "" side "") (command "ucs" "world") (entlast) ) (defun dead_ramp_side (xo yo zo zaxis rot width edge_h platform_thick ramp_length slope side rail_h / rline_01 rline_02 rline_03 rline_04 ramp_pline) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "line" (list 0 (- edge_h) 0) (list 0 (- edge_h) platform_thick) "") (setq sline_01 (entlast)) (command "line" (list 0 (- edge_h) platform_thick) (list 0 (- ramp_length) (+ platform_thick slope)) "") (setq sline_02 (entlast)) (command "line" (list 0 (- edge_h) 0) (list 0 (- ramp_length) slope) "") (setq sline_03 (entlast)) (command "line" (list 0 (- ramp_length) (+ platform_thick slope)) (list 0 (- ramp_length) slope) "") (setq sline_04 (entlast)) (command "ucs" "y" 90) (command "pedit" sline_01 "yes" "join" sline_02 sline_03 sline_04 "" "") (setq side_pline (entlast)) (command "extrude" side_pline "" side "") (command "ucs" "world") (entlast) ) (defun handrail (xo yo zo zaxis rot width edge_h platform_thick ramp_length slope side rail_h / hline_01 hline_02 hline_03 hline_04 hline_05 hline_06 hline_07 hline_08 handrail_pline handrail_circle) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) (command "line" (list (- (/ side 2) 0.75) (- (/ edge_h 2)) platform_thick) (list (- (/ side 2) 0.75) (- (/ edge_h 2)) (+ platform_thick rail_h)) "") (setq hline_01 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (/ edge_h 2)) (+ platform_thick rail_h)) (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2))) (+ platform_thick slope rail_h)) "") (setq hline_02 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2))) (+ platform_thick slope rail_h)) (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2))) (+ platform_thick slope)) "") (setq hline_03 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2))) (+ platform_thick slope)) (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2) (- 1.5))) (+ platform_thick slope)) "") (setq hline_04 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2) (- 1.5))) (+ platform_thick slope)) (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2) (- 1.5))) (+ platform_thick slope (- rail_h 2))) "") (setq hline_05 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (+ ramp_length (/ edge_h 2) (- 1.5))) (+ platform_thick slope (- rail_h 2))) (list (- (/ side 2) 0.75) (- (+ (/ edge_h 2) 1.5)) (+ platform_thick (- rail_h 1.25))) "") (setq hline_06 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (+ (/ edge_h 2) 1.5)) (+ platform_thick (- rail_h 1.25))) (list (- (/ side 2) 0.75) (- (+ (/ edge_h 2) 1.5)) platform_thick) "") (setq hline_07 (entlast)) (command "line" (list (- (/ side 2) 0.75) (- (+ (/ edge_h 2) 1.5)) platform_thick) (list (- (/ side 2) 0.75) (- (/ edge_h 2)) platform_thick) "") (setq hline_08 (entlast)) (command "ucs" "y" 90) (command "pedit" hline_01 "yes" "join" hline_02 hline_03 hline_04 hline_05 hline_06 hline_07 hline_08 "" "") (setq handrail_pline (entlast)) (command "extrude" handrail_pline "" 1.5 "") (command "ucs" "world") (entlast) ) (defun desc_stair_support (xo yo zo zaxis rot width edge_h platform_thick step_thick rise run num slope side support_w / run_counter rise_counter zvalue) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis)) ) (command "ucs" "z" rot) (command "ucs" "y" -90) (setq zvalue (- (+ (/ width 2) 1.5))) (command "pline" (list (- (+ rise step_thick)) 4 zvalue) (list (- rise platform_thick) 4 zvalue) (list (- rise platform_thick) 0 zvalue) (list (- step_thick) 0 zvalue) ) (setq run_counter (- run)) (setq rise_counter (- step_thick)) (repeat (fix (- num 1)) (command (list rise_counter run_counter zvalue)) (setq rise_counter (- rise_counter rise)) (command (list rise_counter run_counter zvalue)) (setq run_counter (- run_counter run)) ) (command (list rise_counter run_counter zvalue) (list (- rise_counter (+ (- rise step_thick) platform_thick)) run_counter zvalue ) (list (- rise_counter (+ (- rise step_thick) platform_thick)) (+ run_counter run) zvalue ) "c" ) (command "extrude" (entlast) "" 3 0) (command "ucs" "world") (entlast) ) (defun asc_stair_support (xo yo zo zaxis rot width edge_h platform_thick step_thick rise run num slope side support_w / run_counter rise_counter zvalue) (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis)) ) (command "ucs" "z" rot) (command "ucs" "y" -90) (setq zvalue (- (+ (/ width 2) 1.5))) (command "pline" (list (- rise platform_thick) (- run) zvalue) (list (- rise platform_thick) -2 zvalue) (list (- step_thick) -2 zvalue) ) (setq run_counter (- (+ run 2))) (setq rise_counter (- step_thick)) (repeat (fix (- num 1)) (command (list rise_counter run_counter zvalue)) (setq rise_counter (- rise_counter rise)) (command (list rise_counter run_counter zvalue)) (setq run_counter (- run_counter run)) ) (command (list rise_counter run_counter zvalue) (list (+ rise_counter platform_thick 1) run_counter zvalue) (list (+ rise_counter platform_thick 1) (- run_counter (- edge_h 2)) zvalue) (list (- rise_counter (+ (- (- rise) step_thick) platform_thick)) (- run_counter (- edge_h 2)) zvalue) "c") (command "extrude" (entlast) "" 3 0) (command "ucs" "world") (entlast) ) ;;; ;;; ;;; ;;; ;;; DEFINITIONS ;;; ;;; ;;; ;;; ;;; ;;; "four_sided_platform" definition: ;;; ------------------------------------------------------------------------- (defun four_sided_platform (xo yo zo zaxis rot width edge_h platform_thick slope side / platform_center_plist b_edge_plist r_edge_plist t_edge_plist l_edge_plist newpoint_0 newpoint_1 newpoint_2 newpoint_3 newpoint_4 xo_0 yo_0 xo_1 yo_1 xo_2 yo_2 xo_3 yo_3 xo_4 yo_4) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 0 0) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq newpoint_2 (trans (list width 0 0) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (setq newpoint_3 (trans (list width width 0) 1 0)) (setq xo_3 (car newpoint_3)) (setq yo_3 (cadr newpoint_3)) (setq newpoint_4 (trans (list 0 width 0) 1 0)) (setq xo_4 (car newpoint_4)) (setq yo_4 (cadr newpoint_4)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick)))) (setq b_edge_plist (list "live_edge" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (setq r_edge_plist (list "live_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" (+ rot 90)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (setq t_edge_plist (list "live_edge" nil (list (cons "xo" xo_3) (cons "yo" yo_3) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" (+ rot 180)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (setq l_edge_plist (list "live_edge" nil (list (cons "xo" xo_4) (cons "yo" yo_4) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" (+ rot 270)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (nt_composit (list platform_center_plist b_edge_plist r_edge_plist t_edge_plist l_edge_plist)) ) ;;; "three_sided_platform" definition: ;;; ------------------------------------------------------------------------- (defun three_sided_platform (xo yo zo zaxis rot width edge_h platform_thick slope side / platform_center_plist b_edge_plist r_edge_plist t_edge_plist newpoint_0 newpoint_1 newpoint_2 newpoint_3 xo_0 yo_0 xo_1 yo_1 xo_2 yo_2 xo_3 yo_3) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 0 0) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq newpoint_2 (trans (list width 0 0) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (setq newpoint_3 (trans (list width width 0) 1 0)) (setq xo_3 (car newpoint_3)) (setq yo_3 (cadr newpoint_3)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick)))) (setq b_edge_plist (list "live_edge" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (setq r_edge_plist (list "live_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" (+ rot 90)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (setq t_edge_plist (list "live_edge" nil (list (cons "xo" xo_3) (cons "yo" yo_3) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" (+ rot 180)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side) ))) (nt_composit (list platform_center_plist b_edge_plist r_edge_plist t_edge_plist)) ) ;;; "two_sided_platform" definition: ;;; ------------------------------------------------------------------------- (defun two_sided_platform (xo yo zo zaxis rot width edge_h platform_thick slope side / platform_center_plist b_edge_plist r_edge_plist newpoint_0 newpoint_1 newpoint_2 xo_0 yo_0 xo_1 yo_1 xo_2 yo_2) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 0 0) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq newpoint_2 (trans (list width 0 0) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq b_edge_plist (list "live_edge" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq r_edge_plist (list "live_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" (+ rot 90)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (nt_composit (list platform_center_plist b_edge_plist r_edge_plist)) ) ;;; "extended_platform" definition: ;;; ---------------------------------------------------------------------- (defun extend_platform (xo yo zo zaxis rot width edge_h platform_thick slope side / platform_center_plist b_edge_plist newpoint_0 newpoint_1 newpoint_2 newpoint_3 xo_0 yo_0 xo_1 yo_1 xo_2 yo_2 xo_3 yo_3) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 (- (+ width edge_h)) 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 (- (+ width edge_h)) 0) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq newpoint_2 (trans (list 0 0 0) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick)))) (setq b_edge_plist (list "live_edge" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq dead_edge_plist (list "dead_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (nt_composit (list platform_center_plist b_edge_plist dead_edge_plist)) ) ;;; "ascending_steps" definition: ;;; ---------------------------------------------------------------------- (defun ascending_steps (xo yo zo zaxis rot width edge_h platform_thick step_thick rise run num slope side / dead_edge_plist steps_plist dead_edge_2_plist platform_center_plist live_edge_plist live_edge_2_plist live_edge_3_plist newpoint_0 newpoint_1 newpoint_2 newpoint_3 newpoint_4 newpoint_5 newpoint_6 xo_0 yo_0 xo_1 yo_1 zo_1 xo_2 yo_2 zo_2 xo_3 yo_3 zo_3 xo_4 yo_4 zo_4 xo_5 yo_5 zo_5 xo_6 yo_6 zo_6) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 (- (- edge_h 2)) (+ platform_thick rise)) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq zo_1 (caddr newpoint_1)) (setq newpoint_2 (trans (list 0 (- (- edge_h 4) (* run num) edge_h) (+ rise (* rise num))) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (setq zo_2 (caddr newpoint_2)) (setq newpoint_3 (trans (list 0 (- (- edge_h 4) (* run num) width (* edge_h 2)) (+ rise (* rise num))) 1 0)) (setq xo_3 (car newpoint_3)) (setq yo_3 (cadr newpoint_3)) (setq zo_3 (caddr newpoint_3)) (setq newpoint_4 (trans (list 0 (- (- edge_h 4) (* run num) width (* edge_h 2)) (+ rise (* rise num))) 1 0)) (setq xo_4 (car newpoint_4)) (setq yo_4 (cadr newpoint_4)) (setq zo_4 (caddr newpoint_4)) (setq newpoint_5 (trans (list 0 (- (- edge_h 4) (* run num) (* edge_h 2)) (+ rise (* rise num))) 1 0)) (setq xo_5 (car newpoint_5)) (setq yo_5 (cadr newpoint_5)) (setq zo_5 (caddr newpoint_5)) (setq newpoint_6 (trans (list width (- (- edge_h 4) (* run num) width (* edge_h 2)) (+ rise (* rise num))) 1 0)) (setq xo_6 (car newpoint_6)) (setq yo_6 (cadr newpoint_6)) (setq zo_6 (caddr newpoint_6)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq dead_edge_plist (list "dead_edge" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (setq steps_plist (list "asc_steps" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo_1) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "step_thick" step_thick) (cons "rise" rise) (cons "run" run) (cons "num" num)))) (setq dead_edge_2_plist (list "dead_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo_2) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_3) (cons "yo" yo_3) (cons "zo" zo_3) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick)))) (setq live_edge_plist (list "live_edge" nil (list (cons "xo" xo_4) (cons "yo" yo_4) (cons "zo" zo_4) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq live_edge_2_plist (list "live_edge" nil (list (cons "xo" xo_5) (cons "yo" yo_5) (cons "zo" zo_5) (cons "zaxis" zaxis) (cons "rot" (+ rot 270)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq live_edge_3_plist (list "live_edge" nil (list (cons "xo" xo_6) (cons "yo" yo_6) (cons "zo" zo_6) (cons "zaxis" zaxis) (cons "rot" (+ rot 90)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (nt_composit (list dead_edge_plist steps_plist dead_edge_2_plist platform_center_plist live_edge_plist live_edge_2_plist live_edge_3_plist)) ) ;;; "descending_steps" definition: ;;; ---------------------------------------------------------------------- (defun descending_steps (xo yo zo zaxis rot width edge_h platform_thick step_thick rise run num slope side / dead_edge_plist steps_plist dead_edge_2_plist platform_center_plist live_edge_plist live_edge_2_plist live_edge_3_plist newpoint_0 newpoint_1 newpoint_2 newpoint_3 newpoint_4 newpoint_5 newpoint_6 xo_0 yo_0 xo_1 yo_1 zo_1 xo_2 yo_2 zo_2 xo_3 yo_3 zo_3 xo_4 yo_4 zo_4 xo_5 yo_5 zo_5 xo_6 yo_6 zo_6) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 (- (- edge_h 2)) (- platform_thick rise)) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq zo_1 (caddr newpoint_1)) (setq newpoint_2 (trans (list 0 (- (- edge_h 4) (* run num) edge_h) (- rise rise rise (* rise num))) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (setq zo_2 (caddr newpoint_2)) (setq newpoint_3 (trans (list 0 (- (- edge_h 4) (* run num) width (* edge_h 2)) (- rise rise rise (* rise num))) 1 0)) (setq xo_3 (car newpoint_3)) (setq yo_3 (cadr newpoint_3)) (setq zo_3 (caddr newpoint_3)) (setq newpoint_4 (trans (list 0 (- (- edge_h 4) (* run num) width (* edge_h 2)) (- rise rise rise (* rise num))) 1 0)) (setq xo_4 (car newpoint_4)) (setq yo_4 (cadr newpoint_4)) (setq zo_4 (caddr newpoint_4)) (setq newpoint_5 (trans (list 0 (- (- edge_h 4) (* run num) (* edge_h 2)) (- rise rise rise (* rise num))) 1 0)) (setq xo_5 (car newpoint_5)) (setq yo_5 (cadr newpoint_5)) (setq zo_5 (caddr newpoint_5)) (setq newpoint_6 (trans (list width (- (- edge_h 4) (* run num) width (* edge_h 2)) (- rise rise rise (* rise num))) 1 0)) (setq xo_6 (car newpoint_6)) (setq yo_6 (cadr newpoint_6)) (setq zo_6 (caddr newpoint_6)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq dead_edge_plist (list "dead_edge" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (setq steps_plist (list "desc_steps" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo_1) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "step_thick" step_thick) (cons "rise" (- rise)) (cons "run" run) (cons "num" num)))) (setq dead_edge_2_plist (list "dead_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo_2) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_3) (cons "yo" yo_3) (cons "zo" zo_3) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick)))) (setq live_edge_plist (list "live_edge" nil (list (cons "xo" xo_4) (cons "yo" yo_4) (cons "zo" zo_4) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq live_edge_2_plist (list "live_edge" nil (list (cons "xo" xo_5) (cons "yo" yo_5) (cons "zo" zo_5) (cons "zaxis" zaxis) (cons "rot" (+ rot 270)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq live_edge_3_plist (list "live_edge" nil (list (cons "xo" xo_6) (cons "yo" yo_6) (cons "zo" zo_6) (cons "zaxis" zaxis) (cons "rot" (+ rot 90)) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (nt_composit (list dead_edge_plist steps_plist dead_edge_2_plist platform_center_plist live_edge_plist live_edge_2_plist live_edge_3_plist)) ) ;;; "ramp" definition: ;;; ---------------------------------------------------------------------- (defun ramp_and_sides (xo yo zo zaxis rot width edge_h platform_thick ramp_length slope side rail_h / dead_edge_plist ramp_plist dead_edge_2_plist platform_center_plist live_edge_plist live_ramp_side_plist live_ramp_side_2_plist newpoint_0 newpoint_1 newpoint_2 newpoint_3 newpoint_4 newpoint_5 newpoint_6 xo_0 yo_0 xo_1 yo_1 xo_2 yo_2 zo_2 xo_3 yo_3 zo_3 xo_4 yo_4 zo_4 xo_5 yo_5 zo_5 xo_6 yo_6 zo_6) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq newpoint_1 (trans (list 0 0 0) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq newpoint_2 (trans (list 0 (- ramp_length) slope) 1 0)) (setq xo_2 (car newpoint_2)) (setq yo_2 (cadr newpoint_2)) (setq zo_2 (caddr newpoint_2)) (setq newpoint_3 (trans (list 0 (- (+ ramp_length edge_h width)) slope) 1 0)) (setq xo_3 (car newpoint_3)) (setq yo_3 (cadr newpoint_3)) (setq zo_3 (caddr newpoint_3)) (setq newpoint_4 (trans (list 0 (- (+ ramp_length edge_h width)) slope) 1 0)) (setq xo_4 (car newpoint_4)) (setq yo_4 (cadr newpoint_4)) (setq zo_4 (caddr newpoint_4)) (setq newpoint_5 (trans (list 0 0 0) 1 0)) (setq xo_5 (car newpoint_5)) (setq yo_5 (cadr newpoint_5)) (setq zo_5 (caddr newpoint_5)) (setq newpoint_6 (trans (list (- width side) 0 0) 1 0)) (setq xo_6 (car newpoint_6)) (setq yo_6 (cadr newpoint_6)) (setq zo_6 (caddr newpoint_6)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq dead_edge_plist (list "dead_edge" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (setq ramp_plist (list "ramp" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "ramp_length" ramp_length) (cons "slope" slope)))) (setq dead_edge_2_plist (list "dead_edge" nil (list (cons "xo" xo_2) (cons "yo" yo_2) (cons "zo" zo_2) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick)))) (setq platform_center_plist (list "platform_center" nil (list (cons "xo" xo_3) (cons "yo" yo_3) (cons "zo" zo_3) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "platform_thick" platform_thick)))) (setq live_edge_plist (list "live_edge" nil (list (cons "xo" xo_4) (cons "yo" yo_4) (cons "zo" zo_4) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "slope" slope) (cons "side" side)))) (setq live_ramp_side_plist (list "live_ramp_side" nil (list (cons "xo" xo_5) (cons "yo" yo_5) (cons "zo" zo_5) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "ramp_length" ramp_length) (cons "slope" slope) (cons "side" side)))) (setq live_ramp_side_2_plist (list "live_ramp_side" nil (list (cons "xo" xo_6) (cons "yo" yo_6) (cons "zo" zo_6) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "ramp_length" ramp_length) (cons "slope" slope) (cons "side" side)))) (nt_composit (list dead_edge_plist ramp_plist dead_edge_2_plist platform_center_plist live_edge_plist live_ramp_side_plist live_ramp_side_2_plist)) ) ;;; "ramp_handrails" definition: ;;; ---------------------------------------------------------------------- (defun ramp_handrails (xo yo zo zaxis rot width edge_h platform_thick ramp_length slope side rail_h / handrail_plist dead_ramp_plist newpoint_0 newpoint_1 xo_0 yo_0 zo_0 xo_1 yo_1 zo_1) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq zo_0 (caddr newpoint_0)) (setq newpoint_1 (trans (list 0 0 0) 1 0)) (setq xo_1 (car newpoint_1)) (setq yo_1 (cadr newpoint_1)) (setq zo_1 (caddr newpoint_1)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq handrail_plist (list "handrail" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "ramp_length" ramp_length) (cons "slope" slope) (cons "side" side) (cons "rail_h" rail_h)))) (setq dead_ramp_plist (list "dead_ramp_side" nil (list (cons "xo" xo_1) (cons "yo" yo_1) (cons "zo" zo) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "ramp_length" ramp_length) (cons "slope" slope) (cons "side" side) (cons "rail_h" rail_h)))) (nt_composit (list handrail_plist dead_ramp_plist)) ) ;;; "support_for_desc_steps" definition: ;;; ---------------------------------------------------------------------- (defun support_for_desc_steps (xo yo zo zaxis rot width edge_h platform_thick step_thick rise run num slope side support_w / support_plist newpoint_0 xo_0 yo_0 zo_0) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq zo_0 (caddr newpoint_0)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq support_plist (list "desc_stair_support" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo_0) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "step_thick" step_thick) (cons "rise" (- rise)) (cons "run" run) (cons "num" num) (cons "support_w" support_w)))) (nt_composit (list support_plist)) ) ;;; "support_for_asc_steps" definition: ;;; ---------------------------------------------------------------------- (defun support_for_asc_steps (xo yo zo zaxis rot width edge_h platform_thick step_thick rise run num slope side support_w / support_plist newpoint_0 xo_0 yo_0 zo_0) ; find the new origin points for the parts and set the ucs. (command "ucs" "world") (command "ucs" "za" (list xo yo zo) (list xo yo (+ zo zaxis))) (command "ucs" "z" rot) ; find the newpoints in the new ucs but relative to the world ucs. (setq newpoint_0 (trans (list 0 0 0) 1 0)) (setq xo_0 (car newpoint_0)) (setq yo_0 (cadr newpoint_0)) (setq zo_0 (caddr newpoint_0)) (command "ucs" "world") ; define the parts with their origin points in the world ucs. (setq support_plist (list "asc_stair_support" nil (list (cons "xo" xo_0) (cons "yo" yo_0) (cons "zo" zo_0) (cons "zaxis" zaxis) (cons "rot" rot) (cons "width" width) (cons "edge_h" edge_h) (cons "platform_thick" platform_thick) (cons "step_thick" step_thick) (cons "rise" (- rise)) (cons "run" run) (cons "num" num) (cons "support_w" support_w)))) (nt_composit (list support_plist)) ) ;;; ;;; ;;; ;;; ;;; TRANSFORMATIONS ;;; ;;; ;;; ;;; ;;; ;;; Transformation "live_edge" -> "extend_platform": ;;; ---------------------------------------------------------------- (nt_def_trans '("live_edge") "extend_platform" 'create_extend_platform nil 'replace) (defun create_extend_platform (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "edge_h" (nt_val "edge_h" edge_parameters)) (cons "platform_thick" (nt_val "platform_thick" edge_parameters)) (cons "slope" (nt_val "slope" edge_parameters)) (cons "side" (nt_val "side" edge_parameters)))) (list nil c_plist) ) ;;; Transformation "live_edge" -> "ascending_steps": ;;; ---------------------------------------------------------------- (nt_def_trans '("live_edge") "ascending_steps" 'create_ascending_steps nil 'replace) (defun create_ascending_steps (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "edge_h" (nt_val "edge_h" edge_parameters)) (cons "platform_thick" (nt_val "platform_thick" edge_parameters)) (cons "slope" (nt_val "slope" edge_parameters)) (cons "side" (nt_val "side" edge_parameters)))) (list nil c_plist) ) ;;; Transformation "live_edge" -> "descending_steps": ;;; ---------------------------------------------------------------- (nt_def_trans '("live_edge") "descending_steps" 'create_descending_steps nil 'replace) (defun create_descending_steps (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "edge_h" (nt_val "edge_h" edge_parameters)) (cons "platform_thick" (nt_val "platform_thick" edge_parameters)) (cons "slope" (nt_val "slope" edge_parameters)) (cons "side" (nt_val "side" edge_parameters)))) (list nil c_plist) ) ;;; Transformation "live_edge" -> "ramp": ;;; ---------------------------------------------------------------- (nt_def_trans '("live_edge") "ramp_and_sides" 'create_ramp_and_sides nil 'replace) (defun create_ramp_and_sides (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "edge_h" (nt_val "edge_h" edge_parameters)) (cons "platform_thick" (nt_val "platform_thick" edge_parameters)) (cons "slope" (nt_val "slope" edge_parameters)) (cons "side" (nt_val "side" edge_parameters)))) (list nil c_plist) ) ;;; Transformation "live_ramp_side" -> "ramp_handrails": ;;; ---------------------------------------------------------------- (nt_def_trans '("live_ramp_side") "ramp_handrails" 'create_handrails nil 'replace) (defun create_handrails (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "edge_h" (nt_val "edge_h" edge_parameters)) (cons "platform_thick" (nt_val "platform_thick" edge_parameters)) (cons "ramp_length" (nt_val "ramp_length" edge_parameters)) (cons "slope" (nt_val "slope" edge_parameters)) (cons "side" (nt_val "side" edge_parameters)) (cons "rail_h" (nt_val "rail_h" edge_parameters)) )) (list nil c_plist) ) ;;; Transformation "desc_steps" -> "support_for_desc_steps": ;;; ---------------------------------------------------------------- (nt_def_trans '("desc_steps") "support_for_desc_steps" 'create_stair_support nil 'add) (defun create_stair_support (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "step_thick" (nt_val "step_thick" edge_parameters)) (cons "rise" (nt_val "rise" edge_parameters)) (cons "run" (nt_val "run" edge_parameters)) (cons "num" (nt_val "num" edge_parameters)) )) (list nil c_plist) ) ;;; Transformation "asc_steps" -> "support_for_asc_steps": ;;; ---------------------------------------------------------------- (nt_def_trans '("asc_steps") "support_for_asc_steps" 'create_stair_support nil 'add) (defun create_stair_support (info_edge trans_plist / edge edge_parameters c_plist) (setq edge (car info_edge)) (setq edge_parameters (nt_plist edge)) (setq c_plist (list (cons "xo" (nt_val "xo" edge_parameters)) (cons "yo" (nt_val "yo" edge_parameters)) (cons "zo" (nt_val "zo" edge_parameters)) (cons "zaxis" (nt_val "zaxis" edge_parameters)) (cons "rot" (nt_val "rot" edge_parameters)) (cons "width" (nt_val "width" edge_parameters)) (cons "step_thick" (nt_val "step_thick" edge_parameters)) (cons "rise" (nt_val "rise" edge_parameters)) (cons "run" (nt_val "run" edge_parameters)) (cons "num" (nt_val "num" edge_parameters)) )) (list nil c_plist) ) ;;; ;;; ;;; ;;; ;;; THE END. ;;; ;;; ;;; ;;; ;;;