;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;; DANIEL CARDOSO ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;; MELNIKOV GRAMMAR ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;; FORMAL DESIGN KNOWLEDGE ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;; SPRING 2006 ;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Main Characteristics ;Collision Detection: ON ;Termination Rules: OFF ;Spatial Constraints: OFF ;Geometry Type: 120 and 180 degrees ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; LITERAL TYPE DEFINITIONS ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ( nt_def_type "ar120_part" 'ar120_part '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120_end" 'ar120_end '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120_link" 'ar120_link '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_part" 'ar180_part '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_end" 'ar180_end '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_link" 'ar180_link '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120to180_link" 'ar120to180_link '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180to120_link" 'ar180to120_link '( ( "xo" . 0 ) ( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; PREPARING DRAWING ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (command "osnap" "off") (command "ucs" "world") (command "-layer" "make" "geometry" "color" "white" "geometry" "") (command "-layer" "make" "cons120" "color" "blue" "cons120" "") (command "-layer" "make" "cons180" "color" "green" "cons180" "") (command "-layer" "make" "endlines" "color" "red" "endlines" "") (command "-view" "top") (command "zoom" "scale" 0.015) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; GEOMETRY DEFINITIONS - LITERAL TYPES ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; END 120 ------------------------------------------------------------------------------------------------------ ( defun ar120_end ( xo yo zo rot / rad1 rad2 height arc1 arc2 l1 l2 const1 const2 part end1 end2 end3 end120) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part ( entlast ) ) ; creating subsidiary lines ( command "layer" "set" "cons120" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 120 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ; creating end lines ( command "layer" "set" "endlines" "") ( command "line" ( list 0 0 0 ) ( list 12 0 0 ) "" ) ( setq end1 ( entlast ) ) ( command "rotate" end1 "" ( list 0 0 0 ) 20 ) ( command "line" ( list 0 0 0 ) ( list 12 0 0 ) "" ) ( setq end2 ( entlast ) ) ( command "rotate" end2 "" ( list 0 0 0 ) 60 ) ( command "line" ( list 0 0 0 ) ( list 12 0 0 ) "" ) ( setq end3 ( entlast ) ) ( command "rotate" end3 "" ( list 0 0 0 ) 100 ) ;creating block ( setq end120 ( nt_make_ablock ( list const1 const2 end1 end2 end3 part ) ) ) ; rotating and moving block ( command "rotate" end120 "" ( list 0 0 0 ) rot ) ( command "move" end120 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part end120 ) ; END 180 ------------------------------------------------------------------------------------------------------ ( defun ar180_end ( xo yo zo rot / rad1 rad2 height arc1 arc2 l1 l2 const1 const2 part end1 end2 end3 end180) ; geometry ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part ( entlast ) ) ; creating subsidiary lines ( command "layer" "set" "cons180" "") ( command "line" ( list 0 0 0 ) ( list 12 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 180 ) ( command "line" ( list 0 0 0 ) ( list 12 0 0 )"" ) ( setq const2 ( entlast ) ) ; creating end lines ( command "layer" "set" "endlines" "") ( command "line" ( list 0 0 0 ) ( list 12 0 0 ) "" ) ( setq end1 ( entlast ) ) ( command "rotate" end1 "" ( list 0 0 0 ) 50 ) ( command "line" ( list 0 0 0 ) ( list 12 0 0 ) "" ) ( setq end2 ( entlast ) ) ( command "rotate" end2 "" ( list 0 0 0 ) 90 ) ( command "line" ( list 0 0 0 ) ( list 12 0 0 ) "" ) ( setq end3 ( entlast ) ) ( command "rotate" end3 "" ( list 0 0 0 ) 130 ) ;creating block ( setq end180 ( nt_make_ablock ( list const1 const2 end1 end2 end3 part ) ) ) ; rotating and moving block ( command "rotate" end180 "" ( list 0 0 0 ) rot ) ( command "move" end180 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part end180 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; GEOMETRY DEFINITIONS - COMPOUND TYPES ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SEED 120 ----------------------------------------------------------------------------------------------------------------------------------------------------- ; 1. Declaring types and parameters for seed 120 ( nt_def_type "seed120" 'parameter_function_seed120 '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120_part" 'geometry_function_ar120_part '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ; 2. Defining Geometry function for ar120_part (literal type) ( defun geometry_function_ar120_part ( xo yo zo rot ) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part ( entlast ) ) ; now rotate and move the part ( command "rotate" part "" ( list 0 0 0 ) rot ) ( command "move" part "" ( list 0 0 0 ) ( list xo yo zo ) ) ; creating subsidiary lines ( command "layer" "set" "cons120" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 120 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ; rotating and moving subsidiary lines ( command "rotate" const1 "" ( list 0 0 0 ) rot ) ( command "rotate" const2 "" ( list 0 0 0 ) rot ) ( command "move" const1 "" ( list 0 0 0 ) ( list xo yo zo ) ) ( command "move" const2 "" ( list 0 0 0 ) ( list xo yo zo ) ) ;creating block ( setq part120 ( nt_make_ablock ( list const1 const2 part ) ) ) ; returning the part part120 ) ; 3. Defining Parameter function for seed120 (compound type) ( defun parameter_function_seed120 ( xo yo zo rot ) ; Getting the params of the literal type ar120_part ( setq component_par_list_ar120_part1 ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" rot ) ) ) ) ( setq component_par_list_ar120_part2 ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 120) ) ) ) ) ( setq component_par_list_ar120_part3 ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 240) ) ) ) ) ( nt_composit ( list component_par_list_ar120_part1 component_par_list_ar120_part2 component_par_list_ar120_part3 ) ) ) ; LINKED 120 ----------------------------------------------------------------------------------------------------------------------------------------------------- ; 1. Declaring types and parameters for LINKED 120 ( nt_def_type "linked120" 'parameter_function_linked120 '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120_part" 'geometry_function_ar120_part '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120_link" 'geometry_function_ar120_link '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ; 2. Defining Geometry function for ar120_part and ar120_link (literal types) ( defun geometry_function_ar120_part ( xo yo zo rot ) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part ( entlast ) ) ; now rotate and move the part ( command "rotate" part "" ( list 0 0 0 ) rot ) ( command "move" part "" ( list 0 0 0 ) ( list xo yo zo ) ) ; creating subsidiary lines ( command "layer" "set" "cons120" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 120 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ; rotating and moving subsidiary lines ( command "rotate" const1 "" ( list 0 0 0 ) rot ) ( command "rotate" const2 "" ( list 0 0 0 ) rot ) ( command "move" const1 "" ( list 0 0 0 ) ( list xo yo zo ) ) ( command "move" const2 "" ( list 0 0 0 ) ( list xo yo zo ) ) ;creating block ( setq part120 ( nt_make_ablock ( list const1 const2 part ) ) ) ; returning the part part120 ) ( defun geometry_function_ar120_link ( xo yo zo rot ) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part ( entlast ) ) ( command "mirror" part "" ( list 15 0 0 ) ( list -7.5 12.99 0 ) "" ) ( setq partb ( entlast ) ) ;creating block ( setq link120 ( nt_make_ablock ( list part partb ) ) ) ; now rotate and move the part ( command "rotate" link120 "" ( list 0 0 0 ) rot ) ( command "move" link120 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part link120 ) ; 3. Defining Parameter function for linked120 (compound type) ( defun parameter_function_linked120 ( xo yo zo rot ) ; Getting the params of the literal type ar120_part ( setq component_par_list_link120 ( list "ar120_link" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" rot ) ) ) ) ( setq component_par_list_ar120_part1 ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 120) ) ) ) ) ( setq component_par_list_ar120_part2 ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 240) ) ) ) ) ( nt_composit ( list component_par_list_ar120_part1 component_par_list_ar120_part2 component_par_list_link120 ) ) ) ;;; ; LINKED 120 to 180 ----------------------------------------------------------------------------------------------------------------------------------------------------- ; 1. Declaring types and parameters for LINKED 120 ( nt_def_type "linked120to180" 'parameter_function_linked120to180 '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_part" 'geometry_function_ar180_part '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180to120_link" 'geometry_function_ar180to120_link '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ; 2. Defining Geometry function for ar180_part and ar120to180_link (literal types) ( defun geometry_function_ar180_part ( xo yo zo rot ) ; geometry ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part ( entlast ) ) ; creating subsidiary lines ( command "layer" "set" "cons180" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 180 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ;creating block ( setq part180 ( nt_make_ablock ( list const1 const2 part ) ) ) ; rotating and moving subsidiary lines ( command "rotate" part180 "" ( list 0 0 0 ) rot ) ( command "move" part180 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part part180 ) ( defun geometry_function_ar180to120_link ( xo yo zo rot ) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part120 ( entlast ) ) ; 180 arc ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part180 ( entlast ) ) ; moving / rotating 120 arc ( command "rotate" part120 "" ( list 0 0 0 ) 210 ) ( command "move" part120 "" ( list 0 0 0) ( list 0 15 ) ) ;creating block ( setq part180to120 ( nt_make_ablock ( list part120 part180 ) ) ) ; now rotate and move the part ( command "rotate" part180to120 "" ( list 0 0 0 ) rot ) ( command "move" part180to120 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part part180to120 ) ; 3. Defining Parameter function for linked120to180 (compound type) ( defun parameter_function_linked120to180 ( xo yo zo rot / dx dy angleInRadians newAngle ) ; Getting the params of the literal type ar180_part ( setq component_par_list_ar120to180_part ( list "ar180to120_link" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (- rot 30) ) ) ) ) ( setq component_par_list_ar180_part ( list "ar180_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 150) ) ) ) ) ( nt_composit ( list component_par_list_ar120to180_part component_par_list_ar180_part ) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; LINKED 180 to 120 ----------------------------------------------------------------------------------------------------------------------------------------------------- ; 1. Declaring types and parameters for LINKED 120 ( nt_def_type "linked180to120" 'parameter_function_linked180to120 '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120_part" 'geometry_function_ar120_part '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar120to180_link" 'geometry_function_ar120to180_link '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ; 2. Defining Geometry function for ar120_part and ar120to180_link (literal types) ( defun geometry_function_ar120_part ( xo yo zo rot / rad1 rad2 height arc1 arc2 l1 l2 const1 const2 part part120) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part ( entlast ) ) ; now rotate and move the part ( command "rotate" part "" ( list 0 0 0 ) rot ) ( command "move" part "" ( list 0 0 0 ) ( list xo yo zo ) ) ; creating subsidiary lines ( command "layer" "set" "cons120" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 120 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ; rotating and moving subsidiary lines ( command "rotate" const1 "" ( list 0 0 0 ) rot ) ( command "rotate" const2 "" ( list 0 0 0 ) rot ) ( command "move" const1 "" ( list 0 0 0 ) ( list xo yo zo ) ) ( command "move" const2 "" ( list 0 0 0 ) ( list xo yo zo ) ) ;creating block ( setq part120 ( nt_make_ablock ( list const1 const2 part ) ) ) ; returning the part part120 ) ( defun geometry_function_ar120to180_link ( xo yo zo rot / part120 part180 rad1 rad2 height arc1 arc2 l1 l2 const1 const2 part part120to180) ; geometry ; 120 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -5 8.6603 ) "line" ( list -4.3750 7.5777 ) "arc" "ce" ( list 0 0 ) "angle" -120 "close" ) ( setq part120 ( entlast ) ) ; 180 arc ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part180 ( entlast ) ) ; moving / rotating 180 arc ( command "rotate" part180 "" ( list 0 0 0 ) 150 ) ( command "move" part180 "" ( list 0 0 0) ( list 7.5 12.9904 ) ) ;creating block ( setq part120to180 ( nt_make_ablock ( list part120 part180 ) ) ) ; now rotate and move the part ( command "rotate" part120to180 "" ( list 0 0 0 ) ( - rot 30 ) ) ( command "move" part120to180 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part part120to180 ) ; 3. Defining Parameter function for linked180to120 (compound type) ( defun parameter_function_linked180to120 ( xo yo zo rot / dx dy angleInRadians newAngle ) ; Getting the params of the literal type ar120_part ( setq component_par_list_ar120to180_link ( list "ar120to180_link" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (- rot 30) ) ) ) ) ( setq component_par_list_ar120_part ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 60) ) ) ) ) ( setq component_par_list_ar120_part1 ( list "ar120_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 180) ) ) ) ) ( nt_composit ( list component_par_list_ar120to180_link component_par_list_ar120_part1 component_par_list_ar120_part ) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; SEED 180 ------------------------------------------------------------------------------------------------- ; 1. Declaring types and parameters for seed 180 ( nt_def_type "seed180" 'parameter_function_seed180 '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_part" 'geometry_function_ar180_part '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ; 2. Defining Geometry function for ar180_part (literal type) ( defun geometry_function_ar180_part ( xo yo zo rot / rad1 rad2 height arc1 arc2 l1 l2 const1 const2 part part180) ; geometry ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part ( entlast ) ) ; creating subsidiary lines ( command "layer" "set" "cons180" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 180 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ; creating block ( setq part180 ( nt_make_ablock ( list const1 const2 part ) ) ) ; rotating and moving subsidiary lines ( command "rotate" part180 "" ( list 0 0 0 ) rot ) ( command "move" part180 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part part180 ) ; 3. Defining Parameter function for seed180 (compound type) ( defun parameter_function_seed180 ( xo yo zo rot ) ; Getting the params of the literal type ar120_part ( setq component_par_list_ar180_part1 ( list "ar180_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" rot ) ) ) ) ( setq component_par_list_ar180_part2 ( list "ar180_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 180) ) ) ) ) ( nt_composit ( list component_par_list_ar180_part2 component_par_list_ar180_part1 ) ) ) ; LINKED 180 ----------------------------------------------------------------------------------------------- ; 1. Declaring types and parameters for LINKED 180 ( nt_def_type "linked180" 'parameter_function_linked180 '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_part" 'geometry_function_ar180_part '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ( nt_def_type "ar180_link" 'geometry_function_ar180_link '( ( "xo". 0 )( "yo" . 0 ) ( "zo" . 0 ) ( "rot" . 0 ) ) ) ; 2. Defining Geometry function for ar180_part and ar180_link (literal types) ( defun geometry_function_ar180_part ( xo yo zo rot ) ; geometry ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part ( entlast ) ) ; creating subsidiary lines ( command "layer" "set" "cons180" "") ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const1 ( entlast ) ) ( command "rotate" const1 "" ( list 0 0 0 ) 180 ) ( command "line" ( list 0 0 0 ) ( list 15 0 0 )"" ) ( setq const2 ( entlast ) ) ;creating block ( setq part180 ( nt_make_ablock ( list const1 const2 part ) ) ) ; rotating and moving subsidiary lines ( command "rotate" part180 "" ( list 0 0 0 ) rot ) ( command "move" part180 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part part180 ) ( defun geometry_function_ar180_link ( xo yo zo rot ) ; geometry ; 180 arc ( command "layer" "set" "geometry" "") ( command "pline" ( list 8.75 0 ) ( list 10 0 ) "arc" "ce" ( list 0 0 ) ( list -10 0 ) "line" ( list -8.75 0 ) "arc" "ce" ( list 0 0 ) "angle" -180 "close" ) ( setq part ( entlast ) ) ( command "mirror" part "" ( list -10 7.5 0 ) ( list 10 7.5 0 ) "" ) ( setq partb ( entlast ) ) ;creating block ( setq link180 ( nt_make_ablock ( list part partb ) ) ) ; now rotate and move the part ( command "rotate" link180 "" ( list 0 0 0 ) rot ) ( command "move" link180 "" ( list 0 0 0 ) ( list xo yo zo ) ) ; returning the part link180 ) ; 3. Defining Parameter function for linked180 (compound type) ( defun parameter_function_linked180 ( xo yo zo rot ) ; Getting the params of the literal type ar120_part ( setq component_par_list_link180 ( list "ar180_link" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" rot ) ) ) ) ( setq component_par_list_ar180_part1 ( list "ar180_part" nil ( list ( cons "xo" xo ) ( cons "yo" yo ) ( cons "zo" zo ) ( cons "rot" (+ rot 180) ) ) ) ) ( nt_composit ( list component_par_list_ar180_part1 component_par_list_link180 ) ) ) ;; 180 to 120 (nt_add_seed_type "seed120") (nt_add_seed_type "seed180") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; TRANSFORMATIONS ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RULE OF TRANSFORMATION 1A --------------------------------------------------------------------------------- ; CONTINUING IN 120 GEOMETRY ; 1. Declare Transformation and Parameters ( nt_def_trans '("ar120_part") ; starting entity "linked120" ; resulting entity '(continue120 continue120_test_func) ; name of the function nil 'replace ) ; type of operation ; 2. Define Transformation Function ( defun continue120 ( info_arc120 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newAngle) ( setq arc120 ( car info_arc120 ) ) ( setq arc120_parameters ( nt_plist arc120 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc120_parameters )) ( setq original-y ( nt_val "yo" arc120_parameters )) ( setq original-z ( nt_val "zo" arc120_parameters )) ( setq original-ang ( nt_val "rot" arc120_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 60 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ( setq c_plist ( list ( cons "rot" (+ 180 original-ang ) ) ( cons "xo" ( + original-x deltaX ) ) ( cons "yo" ( + original-y deltaY ) ) ( cons "zo" original-z ) ) ) ( list f_plist c_plist ) ) ; 2a. Define test Function ( defun continue120_test_func ( info_arc120 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newX newY newZ newAngle dis veredict object allObjects) ( setq arc120 ( car info_arc120 ) ) ( setq arc120_parameters ( nt_plist arc120 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc120_parameters )) ( setq original-y ( nt_val "yo" arc120_parameters )) ( setq original-z ( nt_val "zo" arc120_parameters )) ( setq original-ang ( nt_val "rot" arc120_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 60 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ;Declaring variables of the new center point for future comparison ( setq origPoint ( list original-x original-y original-z ) ) ( setq newX ( + original-x deltaX ) ) ( setq newY ( + original-y deltaY ) ) ( setq newZ 0 ) ( setq newPoint ( list newX newY newZ ) ) ;Retrieving information on the other objects ( setq allObjects ( nt_visible_literal_geometries ) ) ( setq flag 0 ) ( while allObjects ( setq this ( car allObjects ) ) ( setq this_pList ( nt_plist this ) ) ( setq thisX ( nt_val "xo" this_pList ) ) ( setq thisY ( nt_val "yo" this_pList ) ) ( setq thisZ ( nt_val "zo" this_pList ) ) ( setq thisPoint ( list thisX thisY thisZ ) ) ;This is the distance from the point on Evaluation to the new Point") ( setq dis_current_to_new ( distance thisPoint newPoint ) ) ; This is the conditional that prevents collisions ( if ( and ( < dis_current_to_new 15.1 ) ( not ( and ( eq original-x thisX ) ( eq original-y thisY) ) ) ) ( progn ( setq flag 1 ) ) ) ( setq allObjects ( cdr allObjects ) ) ) ( if ( = flag 0 ) t nil ) ) ; RULE OF TRANSFORMATION 2A --------------------------------------------------------------------------------- ; CHANGING FROM 120 TO 180 GEOMETRY ; 1. Declare Transformation and Parameters ( nt_def_trans '("ar120_part") ; starting entity "linked120to180" ; resulting entity '(change120to180 change120to180_test_func) ; name of the function nil 'replace ) ; type of operation ; 2. Define Transformation Function ( defun change120to180 ( info_arc120 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newAngle) ( setq arc120 ( car info_arc120 ) ) ( setq arc120_parameters ( nt_plist arc120 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc120_parameters )) ( setq original-y ( nt_val "yo" arc120_parameters )) ( setq original-z ( nt_val "zo" arc120_parameters )) ( setq original-ang ( nt_val "rot" arc120_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 60 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ( setq c_plist ( list ( cons "rot" (+ 180 original-ang ) ) ( cons "xo" ( + original-x deltaX ) ) ( cons "yo" ( + original-y deltaY ) ) ( cons "zo" original-z ) ) ) ( list f_plist c_plist ) ) ; 2a. Define test Function ( defun change120to180_test_func ( info_arc120 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newX newY newZ newAngle dis veredict object allObjects) ( setq arc120 ( car info_arc120 ) ) ( setq arc120_parameters ( nt_plist arc120 ) ) ( print "120 to 180 go" ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc120_parameters )) ( setq original-y ( nt_val "yo" arc120_parameters )) ( setq original-z ( nt_val "zo" arc120_parameters )) ( setq original-ang ( nt_val "rot" arc120_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 60 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ;Declaring variables of the new center point for future comparison ( setq origPoint ( list original-x original-y original-z ) ) ( setq newX ( + original-x deltaX ) ) ( setq newY ( + original-y deltaY ) ) ( setq newZ 0 ) ( setq newPoint ( list newX newY newZ ) ) ;Retrieving information on the other objects ( setq allObjects ( nt_visible_literal_geometries ) ) ( setq flag 0 ) ( while allObjects ( setq this ( car allObjects ) ) ( setq this_pList ( nt_plist this ) ) ( setq thisX ( nt_val "xo" this_pList ) ) ( setq thisY ( nt_val "yo" this_pList ) ) ( setq thisZ ( nt_val "zo" this_pList ) ) ( setq thisPoint ( list thisX thisY thisZ ) ) ;This is the distance from the point on Evaluation to the new Point") ( setq dis_current_to_new ( distance thisPoint newPoint ) ) ; This is the conditional that prevents collisions ( if ( and ( < dis_current_to_new 15.1 ) ( not ( and ( eq original-x thisX ) ( eq original-y thisY) ) ) ) ( progn ( setq flag 1 ) ) ) ( setq allObjects ( cdr allObjects ) ) ) ( if ( = flag 0 ) t nil ) ) ; RULE OF TRANSFORMATION 3A --------------------------------------------------------------------------------- ; TERMINATING 120 GEOMETRY ; RULE OF TRANSFORMATION 1B --------------------------------------------------------------------------------- ; CONTINUING IN 180 GEOMETRY ; 1. Declare Transformation and Parameters ( nt_def_trans '("ar180_part") ; starting entity "linked180" ; resulting entity ;'continue180 ; name of the function '(continue180 continue180_test_func) nil 'replace ) ; type of operation ; 2. Define Transformation Function ( defun continue180 ( info_arc180 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newAngle) ( setq arc180 ( car info_arc180 ) ) ( setq arc180_parameters ( nt_plist arc180 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc180_parameters )) ( setq original-y ( nt_val "yo" arc180_parameters )) ( setq original-z ( nt_val "zo" arc180_parameters )) ( setq original-ang ( nt_val "rot" arc180_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 90 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ( setq c_plist ( list ( cons "rot" (+ 180 original-ang ) ) ( cons "xo" ( + original-x deltaX ) ) ( cons "yo" ( + original-y deltaY ) ) ( cons "zo" original-z ) ) ) ( list f_plist c_plist ) ) ; 2a. Define test Function ( defun continue180_test_func ( info_arc180 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newX newY newZ newAngle dis veredict object allObjects) ( setq arc180 ( car info_arc180 ) ) ( setq arc180_parameters ( nt_plist arc180 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc180_parameters )) ( setq original-y ( nt_val "yo" arc180_parameters )) ( setq original-z ( nt_val "zo" arc180_parameters )) ( setq original-ang ( nt_val "rot" arc180_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 90 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ;Declaring variables of the new center point for future comparison ( setq origPoint ( list original-x original-y original-z ) ) ( setq newX ( + original-x deltaX ) ) ( setq newY ( + original-y deltaY ) ) ( setq newZ 0 ) ( setq newPoint ( list newX newY newZ ) ) ;Retrieving information on the other objects ( setq allObjects ( nt_visible_literal_geometries ) ) ( setq flag 0 ) ( while allObjects ( setq this ( car allObjects ) ) ( setq this_pList ( nt_plist this ) ) ( setq thisX ( nt_val "xo" this_pList ) ) ( setq thisY ( nt_val "yo" this_pList ) ) ( setq thisZ ( nt_val "zo" this_pList ) ) ( setq thisPoint ( list thisX thisY thisZ ) ) ;This is the distance from the point on Evaluation to the new Point") ( setq dis_current_to_new ( distance thisPoint newPoint ) ) ; This is the conditional that prevents collisions ( if ( and ( < dis_current_to_new 15.1 ) ( not ( and ( eq original-x thisX ) ( eq original-y thisY) ) ) ) ( progn ( setq flag 1 ) ) ) ( setq allObjects ( cdr allObjects ) ) ) ( if ( = flag 0 ) t nil ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RULE OF TRANSFORMATION 2B --------------------------------------------------------------------------------- ; 180 to 120 ; 1. Declare Transformations and Parameters ( nt_def_trans '("ar180_part") ;starting entity "linked180to120" ;resulting entity ; 'change180to120 ;name of the function '(change180to120 change180to120_test_func) nil 'replace ) ;type of operation ; 2. Define Transformation Function ( defun change180to120 ( info_arc180 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newAngle) ( setq arc180 ( car info_arc180 ) ) ( setq arc180_parameters ( nt_plist arc180 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc180_parameters )) ( setq original-y ( nt_val "yo" arc180_parameters )) ( setq original-z ( nt_val "zo" arc180_parameters )) ( setq original-ang ( nt_val "rot" arc180_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 90 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ( setq c_plist ( list ( cons "rot" (+ (- 0 90) original-ang ) ) ( cons "xo" ( + original-x deltaX ) ) ( cons "yo" ( + original-y deltaY ) ) ( cons "zo" original-z ) ) ) ( list f_plist c_plist ) ) ; 2a. Define test Function ( defun change180to120_test_func ( info_arc180 trans_plist / f_plist c_plist original-x original-y original-z original-z deltaX deltaY newX newY newZ newAngle dis veredict object allObjects) ( setq arc180 ( car info_arc180 ) ) ( setq arc180_parameters ( nt_plist arc180 ) ) ; no free parameters: ( setq f_plist nil ) ; these are the constrained parameters ( setq original-x ( nt_val "xo" arc180_parameters )) ( setq original-y ( nt_val "yo" arc180_parameters )) ( setq original-z ( nt_val "zo" arc180_parameters )) ( setq original-ang ( nt_val "rot" arc180_parameters )) ; finding the displacement of the new center with respect to the original one, and setting the new "rot" ( setq newAngle ( + original-ang 90 ) ) ; Rotation ( setq angleInRadians ( * newAngle 0.0174532925 ) ) ; Angle in radians ( setq deltaX ( * ( cos angleInRadians ) 15 ) ) ; X displacement ( setq deltaY ( * ( sin angleInRadians ) 15 ) ) ; Y displacement ;Declaring variables of the new center point for future comparison ( setq origPoint ( list original-x original-y original-z ) ) ( setq newX ( + original-x deltaX ) ) ( setq newY ( + original-y deltaY ) ) ( setq newZ 0 ) ( setq newPoint ( list newX newY newZ ) ) ;Retrieving information on the other objects ( setq allObjects ( nt_visible_literal_geometries ) ) ( setq flag 0 ) ( while allObjects ( setq this ( car allObjects ) ) ( setq this_pList ( nt_plist this ) ) ( setq thisX ( nt_val "xo" this_pList ) ) ( setq thisY ( nt_val "yo" this_pList ) ) ( setq thisZ ( nt_val "zo" this_pList ) ) ( setq thisPoint ( list thisX thisY thisZ ) ) ;This is the distance from the point on Evaluation to the new Point") ( setq dis_current_to_new ( distance thisPoint newPoint ) ) ; This is the conditional that prevents collisions ( if ( and ( < dis_current_to_new 15.1 ) ( not ( and ( eq original-x thisX ) ( eq original-y thisY) ) ) ) ( progn ( setq flag 1 ) ) ) ( setq allObjects ( cdr allObjects ) ) ) ( if ( = flag 0 ) t nil ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RULE OF TRANSFORMATION 3B --------------------------------------------------------------------------------- ; TERMINATING 180 GEOMETRY