;;;;Drawing Egg shape ;;;; Ref. Mathographics by Robert Dixon ;;;;Draw a egg shape and modify it by moving the evolute points ;;;; by Takaya Iwamoto ;;;;add slow_arc_1 function ;;;;SLOW_ARC_1(n_speed layer_name color_code pnt_center pnt_start travel_angle ang_dir) ;;;; ;;;; ;;;; egg_BASIC ;;;; egg_Thom1 2 points case ;;;; egg_Thom2 ;;;; egg_MOSS 3 points ;;;; egg_4PT ;;;; egg_5PT ;;;; egg_MULPT ;;;; ;;;update 6/18/2006 added draw_4pt_egg & draw_5pt_egg ;;;;Main function ;;;; ;;;;********************************************************** ;;;;******main routine for Drawing eggs****** ;;;;********************************************************** ;;;; (prompt "\nLoading Egg_Draw") ;;;; Egg_draw ;;;; (defun c:Egg_draw() (setq dcl_id (load_dialog "egg_draw.dcl")) (if (not (new_dialog "egg_draw" dcl_id)) (exit) ) (setq egg_list '("egg_basic" "Thom_1" "Thom_2" "Moss_egg" "4_point" "5_point" "Multi_pt" "Golden" "Sqrt327" "Add3" ) ) (foreach sld_name egg_list (start_image sld_name) (slide_image 0 0 (- (dimx_tile sld_name) 1) (- (dimy_tile sld_name) 1) (strcat "egg_draw" "(" sld_name ")") ) (end_image) );;;end of foreach loop (setq sel_key "egg_basic") (mode_tile sel_key 4) (foreach pd0 egg_list (action_tile pd0 "(mode_tile sel_key 4) (setq sel_key $key)(mode_tile sel_key 4)" ) ) ;(action_tile "help" "(help \"\" \"ddptype\")") ;;help index (start_dialog) ;;;execute the selected program (cond ((= sel_key "egg_basic") (c:egg_basic) ) ((= sel_key "Thom_1") (c:egg_thom1) ) ((= sel_key "Thom_2") (c:egg_thom2) ) ((= sel_key "Moss_egg") (c:egg_moss) ) ((= sel_key "4_point") (c:egg_4pt) ) ((= sel_key "5_point") (c:egg_5pt) ) ((= sel_key "Multi_pt") (c:egg_mltpt) ) ((= sel_key "Golden") (c:egg_golden) ) ((= sel_key "Sqrt327") (c:egg_sqrt327) ) ((= sel_key "Add3") (c:egg_add3) ) (t nil) );;;end of cond );;;Egg_draw ;;; (prompt "\nLoading Egg_Basic") ;;; ;;;******EGG_basic****** ;;; (defun C:egg_BASIC() (setup_eggdraw) (alert "\nStart now for Egg Draw") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) ;(command "_.arc" "_c" pt1 pt0 "_a" angle_0) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- pi (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) ;(command "_.arc" "_c" pt2 s1 "_a" angle_1) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) ; (command "_.arc" "_c" pt3 s2 "_a" angle_2) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;fourth point as a pivot (setq radius_3 (+ radius_2 (distance pt3 pt4))) ;radius (setq theta_3 (angle_3p pt4 pt3 pt5)) (setq angle_3 (rtd theta_3)) ;(command "_.arc" "_c" pt4 s3 "_a" angle_3) (SLOW_ARC_1 n_speed "0" 4 pt4 s3 angle_3 0) (setq ent_list_4 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_4)) ) (setq origin_x (car pt4)) (setq origin_y (cadr pt4)) (setq s4_x (+ origin_x (* radius_3 (cos rad_end)))) (setq s4_y (+ origin_y (* radius_3 (sin rad_end)))) (setq s4 (list s4_x s4_y)) ;end of the newly drawn arc (getpoint "\npress return key for the next step") ;fifth point as a pivot (setq radius_4 (- radius_3 (distance pt4 pt5))) ;radius (setq theta_4 (- pi (angle_3p pt5 pt6 pt4))) (setq angle_4 (rtd theta_4)) ;(command "_.arc" "_c" pt5 s4 "_a" angle_4) (SLOW_ARC_1 n_speed "0" 5 pt5 s4 angle_4 0) (setq ent_list_5 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_5)) ) (setq origin_x (car pt5) origin_y (cadr pt5)) (setq s5_x (+ origin_x (* radius_4 (cos rad_end))) s5_y (+ origin_y (* radius_4 (sin rad_end))) s5 (list s5_x s5_y) ) ;end of the newly drawn arc ;(command "_.line" pt5 s5 "") (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt6 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (prompt "\nLoading Setup_EggDraw") ;;; (defun setup_eggdraw() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(5.5 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(5.5 2.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(5.0 3.5) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(4.0 4.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(1.0 3.5) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) (command "_.point" (setq pt5 '(5.5 7.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list5 (list (read ent_id) 'pt5)) (command "_.point" (setq pt6 '(5.5 10.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list6 (list (read ent_id) 'pt6)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 list5 list6)) (make_line "0" 8 pt0 pt6) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGGDRAW ;;;*******EGG_BASIC****** ;;; (prompt "\nLoading Egg_Thom1") ;;; ;;;******EGG_Thom1****** ;;; (defun C:egg_Thom1() (setup_eggthom1) (alert "\nStart now for Egg Draw") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- (angle_3p pt1 pt2 pt0)) ) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (- radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- pi (angle_3p pt2 pt0 s1) ) ) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2) origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end))) s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt0)) ;radius theta_2 (- (angle_3p pt0 pt3 pt2) ) angle_2 (rtd theta_2) ) (SLOW_ARC_1 n_speed "0" 3 pt0 s2 angle_2 0) (setq ent_list_3 (entget (entlast)) rad_end (cdr (assoc 51 ent_list_3)) origin_x (car pt3) origin_y (cadr pt3) s3_x (+ origin_x (* radius_2 (cos rad_end))) s3_y (+ origin_y (* radius_2 (sin rad_end))) s3 (list s3_x s3_y) ) ;end of the newly drawn arc (command "_.delay" 500) ;(make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt3 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_eggthom1() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0.0 -1.5) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast)))) list0 (list (read ent_id) 'pt0) ) (command "_.point" (setq pt1 '(0.0 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(0.5 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(0.0 1.5) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 )) (my_block_insert "thom_1" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGGTHOM1 ;;;*******EGG_THOM1****** ;;; ;;; (prompt "\nLoading Egg_Moss") ;;;******EGG_Moss****** ;;; (defun C:egg_moss() (setup_eggmoss) (alert "\nStart now for Egg Moss") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_eggmoss() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0.0 -1.) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(0.0 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(-1.0 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(0.0 1.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(0.0 1.75) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 )) (my_block_insert "Moss_egg" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGGMOSS ;;;*******EGG_MOSS****** ;;; ;;; (prompt "\nLoading Egg_Thom2") ;;;******EGG_THOM2****** ;;; (defun C:egg_thom2() (setup_eggthom2) (alert "\nStart now for Egg Moss") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_eggthom2() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0.0 -1.75) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(0.0 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(-0.75 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(0.0 1.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(0.0 2.3) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 )) (my_block_insert "egg_thom2" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGGTHOM2 ;;;*******EGG_THOM2****** ;;; (prompt "\nLoading Egg_4PT") ;;;************************************************************* ;;;******EGG_4PT****** ;;;************************************************************* ;;; (defun C:egg_4PT() (setup_egg4PT) (alert "\nStart now for Egg Draw") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) ;(command "_.arc" "_c" pt1 pt0 "_a" angle_0) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- pi (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) ;(command "_.arc" "_c" pt2 s1 "_a" angle_1) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius ;(setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq theta_2 (- (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) ; (command "_.arc" "_c" pt3 s2 "_a" angle_2) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;fourth point as a pivot (setq radius_3 (+ radius_2 (distance pt3 pt4))) ;radius (setq theta_3 (angle_3p pt4 s3 pt5) ) (setq angle_3 (rtd theta_3)) ;(command "_.arc" "_c" pt4 s3 "_a" angle_3) (SLOW_ARC_1 n_speed "0" 4 pt4 s3 angle_3 0) (setq ent_list_4 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_4)) ) (setq origin_x (car pt4)) (setq origin_y (cadr pt4)) (setq s4_x (+ origin_x (* radius_3 (cos rad_end)))) (setq s4_y (+ origin_y (* radius_3 (sin rad_end)))) (setq s4 (list s4_x s4_y)) ;end of the newly drawn arc (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt5 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_egg4PT() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0. -1.2426) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(0. -0.4142) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(-0.4142 0.) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(-1 0.) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(0. 1) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) (command "_.point" (setq pt5 '(0. 1.7154) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list5 (list (read ent_id) 'pt5)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 list5 )) (my_block_insert "4_point" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGG4PT ;;;*******EGG_4PT****** ;;; ;;; (prompt "\nLoading Egg_5PT") ;;;******EGG_5PT****** ;;; (defun C:egg_5PT() (setup_egg5PT) (alert "\nStart now for Egg Draw") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) ;(command "_.arc" "_c" pt1 pt0 "_a" angle_0) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- pi (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) ;(command "_.arc" "_c" pt2 s1 "_a" angle_1) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) ; (command "_.arc" "_c" pt3 s2 "_a" angle_2) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;fourth point as a pivot (setq radius_3 (+ radius_2 (distance pt3 pt4))) ;radius (setq theta_3 (angle_3p pt4 pt3 pt5)) (setq angle_3 (rtd theta_3)) ;(command "_.arc" "_c" pt4 s3 "_a" angle_3) (SLOW_ARC_1 n_speed "0" 4 pt4 s3 angle_3 0) (setq ent_list_4 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_4)) ) (setq origin_x (car pt4)) (setq origin_y (cadr pt4)) (setq s4_x (+ origin_x (* radius_3 (cos rad_end)))) (setq s4_y (+ origin_y (* radius_3 (sin rad_end)))) (setq s4 (list s4_x s4_y)) ;end of the newly drawn arc (getpoint "\npress return key for the next step") ;fifth point as a pivot (setq radius_4 (- radius_3 (distance pt4 pt5))) ;radius (setq theta_4 (- pi (angle_3p pt5 pt6 pt4))) (setq angle_4 (rtd theta_4)) ;(command "_.arc" "_c" pt5 s4 "_a" angle_4) (SLOW_ARC_1 n_speed "0" 5 pt5 s4 angle_4 0) (setq ent_list_5 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_5)) ) (setq origin_x (car pt5) origin_y (cadr pt5)) (setq s5_x (+ origin_x (* radius_4 (cos rad_end))) s5_y (+ origin_y (* radius_4 (sin rad_end))) s5 (list s5_x s5_y) ) ;end of the newly drawn arc ;(command "_.line" pt5 s5 "") (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt6 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_egg5PT() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0. -2) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(0 -0.5) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(-0.2279 0.0263) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(-0.6186 0.2143) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(-1.7321 0.) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) (command "_.point" (setq pt5 '(0. 2.) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list5 (list (read ent_id) 'pt5)) (command "_.point" (setq pt6 '(0. 3.5) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list6 (list (read ent_id) 'pt6)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 list5 list6)) (my_block_insert "5_point" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGG5PT ;;;*******EGG_5PT****** ;;; ;;; (prompt "\nLoading Egg_Golden") ;;; ;;;********************************************************************* ;;;******EGG_GOLDEN****** ;;;********************************************************************* ;;; (defun C:egg_golden() (setup_egggolden) (alert "\nStart now for Egg- Golden Ratio") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_egggolden() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0.0 -2.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(0.0 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(-1.2360679 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(0.0 1.5723027) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(0.0 2.8) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 )) (my_block_insert "egg_golden" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGGGOLDEN ;;;*******EGG_GOLDEN****** ;;; ;;; (prompt "\nLoading Egg_SQRT327") ;;; ;;;******EGG_SQRT327****** ;;; (defun C:egg_sqrt327() (setup_eggsqrt327) (alert "\nStart now for Egg sqrt_327") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;; ;;; (defun setup_eggsqrt327() (setup_sysvar) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. ;define construction points (command "_.point" (setq pt0 '(0.0 -1.1340) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list0 (list (read ent_id) 'pt0)) (command "_.point" (setq pt1 '(0.0 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list1 (list (read ent_id) 'pt1)) (command "_.point" (setq pt2 '(-0.8660 0.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list2 (list (read ent_id) 'pt2)) (command "_.point" (setq pt3 '(0.0 1.0) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list3 (list (read ent_id) 'pt3)) (command "_.point" (setq pt4 '(0.0 1.6771) ) ) (setq ent_id (cdr (assoc 5 (entget (entlast))))) (setq list4 (list (read ent_id) 'pt4)) ;listing for all the construction points---ref_list (setq ref_list (list list0 list1 list2 list3 list4 )) (my_block_insert "egg_sqrt327" '(0 0) 1.0 ) (command "_.regen") (command "_.zoom" "_EXTENT") );SETUP_EGGSQRT327 ;;;*******EGG_SQRT327****** ;;; ;;; (prompt "\nLoading Angle_3P") ;;; ;;;ANAGLE_3P ;;; ; compute angle between two intersecting line elements ; ratio of vector product and scalar product is tangent (defun angle_3p(pt0 pt1 pt2) ;coordinate data (setq x0 (car pt0) y0 (cadr pt0) x1 (car pt1) y1 (cadr pt1) x2 (car pt2) y2 (cadr pt2) ) ;vector components (setq v1x (- x1 x0) v1y (- y1 y0) v2x (- x2 x0) v2y (- y2 y0) ) ;vector product (setq vector_prod (- (* v1x v2y) (* v2x v1y))) ;distance or vector length (setq v1 (distance pt0 pt1) v2 (distance pt1 pt2) ) (setq scalar_prod (+ (* v1x v2x) (* v1y v2y))) (atan vector_prod scalar_prod) ;result in radian );angle_3p ;;; ;;; ;;; Function: SLOW_ARC_1 Variation of SLOW_ARC ;;;*** added ;;; ;;; (prompt "\nLoading SLOW_ARC_1") ;;;draw an arc slowly given center and starting point & travel_angle ;;; (defun SLOW_ARC_1(n_speed layer_name color_code pnt_center pnt_start travel_angle ang_dir / ) (setq s_color (getvar "cecolor") s_angdir (getvar "angdir") sblip (getvar "blipmode") scmde (getvar "cmdecho") ) (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "angdir" ang_dir) (setvar "cecolor" (itoa color_code)) ;;;*** (make_line "0" color_code pnt_center pnt_start) ;;;*** (setq radius (distance pnt_center pnt_start) unit_step (/ travel_angle (float n_speed)) nstep 1 pnt_ref (list (+ (car pnt_center) radius) (cadr pnt_center)) base_pos (angle pnt_center pnt_start) ;;in radian *** ) (while (< nstep n_speed ) (progn (setq step (* nstep unit_step)) (command "_.arc" "_C" pnt_center pnt_start "_A" step) (entdel (entlast)) (setq pnt_end (polar pnt_center (+ base_pos (dtr step)) radius)) ;;;*** (grdraw pnt_center pnt_end color_code) ;;; *** ) (setq nstep (+ 1 nstep)) );while loop (command "_.arc" "_C" pnt_center pnt_start "_A" travel_angle) ;final displayed arc (setvar "blipmode" sblip) (setvar "cmdecho" scmde) (setvar "angdir" s_angdir) (setvar "cecolor" s_color) ;;;*** );SLOW_ARC_1 ;;; ;;;*********************************************************************************************** ;;;*************************Define Evolute , then draw arcs in one executable********************* ;;;*********************************************************************************************** ;;; draw_4pt_egg ;;; ;;;draw_4pt_egg ;;;draw Dixon's 4 pt Euclidean egg (prompt "\nLoading draw_4pt_egg") ;;; (defun c:draw_4pt_egg() (setup_sysvar) (setq pnt_org '(0 0) pnt_3 '(-1 0) pnt_3r '(1 0) sqrt_2 (sqrt 2.) chr_size 0.1 sqrt_2_m_1 (- sqrt_2 1.) two_m_sqrt_2 (- 2. sqrt_2) rad_1 (* 2. sqrt_2_m_1) three_m_sqrt_2 (- 3 sqrt_2) pnt_5 (list 0 three_m_sqrt_2) pnt_0 (list 0 (- (* 3. sqrt_2_m_1))) y_up pnt_5 y_down pnt_0 ) ;;draw_X-Y axis (make_line "0" 8 pnt_3 pnt_3r) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;create a point at (-1,0) and name it as "3" (alert "\nDraw a upper semi_circle with unit radius centered at (0 0) ") (make_arc_cbe "0" 8 pnt_org pnt_3r pnt_3) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (make_pt "0" 8 pnt_3r) (mark_point pnt_3r 0. 0. "3'" chr_size) ;;draw circles with its center at the orgin , radius=1.0. It cuts Y-axis at pnt_4 ;(alert "\nDraw a semi-circle at the origin, radius=1.0,upper-half") ;(make_arc_cbe "0" 8 pnt_org pnt_3r pnt_3) (setq pnt_4 '(0 1)) (make_pt "0" 1 pnt_4) (mark_point pnt_4 -1. 0. "4" chr_size) ;;draw a circle center at pnt_3r , radius = sqrt_2 = len 3-4. It intersects X-axis at pnt_2 (alert "\nDraw an arc with its center at 3', radius=3'4\n starts at 4 and ends at x-axis") (make_arc_cbe "0" 8 pnt_3r pnt_4 pnt_3) (setq pnt_2 (list (- 1. sqrt_2) 0) pnt_2r (list (- sqrt_2 1.) 0)) (make_pt "0" 1 pnt_2) (make_pt "0" 8 pnt_2r) (mark_point pnt_2 -1. 0. "2" chr_size) (mark_point pnt_2r 0. 0. "2'" chr_size) ;;;draw a circle , center at '(0 0), radius (- sqrt_2 1.) it intersects y_axis at pnt_1 (alert "\nDraw a circle with its center at the origin,\ndiameter 2-2'") (make_circle "0" 8 pnt_org sqrt_2_m_1) (setq pnt_1 (list 0 (- sqrt_2_m_1)) pnt_1u (list 0 sqrt_2_m_1) ) (make_pt "0" 1 pnt_1) (make_pt "0" 8 pnt_1u) (mark_point pnt_1 0. 0. "1" chr_size) (make_pt "0" 8 (list 0 sqrt_2_m_1)) ;;draw a circle ,center at pnt_1, rad_1 (alert "\nDraw a circle ithits center at 1, radius=2*sqrt_2 - 2") (make_circle "0" 8 pnt_1 rad_1) (make_pt "0" 1 (list 0 (- (* 3. sqrt_2_m_1))) ) (mark_point pnt_0 0. 0. "0" chr_size) (command "_.delay" 500) ;;draw a circle ,center at pnt_4, radius 2 - sqrt_2 (alert "\nDraw a circle with its center at 4 ,radius=2 - sqrt_2") (make_circle "0" 8 pnt_4 two_m_sqrt_2) (make_pt "0" 1 (list 0 three_m_sqrt_2)) (mark_point pnt_5 0. 0. "5" chr_size) (command "_.zoom" "_Extent") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 pt5 pnt_5) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart drawing arcs using evolute points.") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) ;(command "_.arc" "_c" pt1 pt0 "_a" angle_0) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- pi (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) ;(command "_.arc" "_c" pt2 s1 "_a" angle_1) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius ;(setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq theta_2 (- (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) ; (command "_.arc" "_c" pt3 s2 "_a" angle_2) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;fourth point as a pivot (setq radius_3 (+ radius_2 (distance pt3 pt4))) ;radius (setq theta_3 (angle_3p pt4 s3 pt5) ) (setq angle_3 (rtd theta_3)) ;(command "_.arc" "_c" pt4 s3 "_a" angle_3) (SLOW_ARC_1 n_speed "0" 4 pt4 s3 angle_3 0) (setq ent_list_4 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_4)) ) (setq origin_x (car pt4)) (setq origin_y (cadr pt4)) (setq s4_x (+ origin_x (* radius_3 (cos rad_end)))) (setq s4_y (+ origin_y (* radius_3 (sin rad_end)))) (setq s4 (list s4_x s4_y)) ;end of the newly drawn arc (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt5 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_4PT_EGG ;;; ;;; (prompt "\nLoading draw_5pt_egg") ;;; ;;;************************************** ;;; draw_5pt_egg ;;;************************************** ;;; ;;;draw_5pt_egg ;;;draw Dixon's 5 pt Euclidean egg ;;; (defun c:draw_5pt_egg() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq unit_rad 1.0 pnt_c1 '(0 -1) pnt_c2 '(0 0) pnt_c3 '(0 1) pnt_5 '(0 2) pnt_0 '(0 -2) pnt_6 '(0 3) pt_c1 '(1 -1) pt_c2 '(1 0) pt_c3 '(1 1) pt_c4 '(1 2) pnt_org '(0 0) chr_size 0.1 y_up pnt_6 y_down pnt_0 x_left '(-2 0) x_right '(2 0) sqrt_3 (sqrt 3.) half_sqrt_3 (* 0.5 sqrt_3) pnt_p (list (- half_sqrt_3) -0.5) pnt_pd (list half_sqrt_3 -0.5) pnt_q (list (- half_sqrt_3) 0.5) pnt_qd (list half_sqrt_3 0.5) pnt_r (list (- half_sqrt_3) 1.5) pnt_rd (list half_sqrt_3 1.5) pnt_1 (list 0 -0.5) pnt_2 (list (- (* sqrt_3 (/ 5. 38.))) (/ 1. 38.)) pnt_3 (list (- (* sqrt_3 (/ 5. 14.))) (/ 3. 14.)) pnt_4 (list (- sqrt_3 ) 0) ) ;;draw_X-Y axis (make_line "0" 8 x_left x_right) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw 4 unit cicles along Y-axis , and name them C1 - C4 (alert "\nDraw 4 unit circles with unit distance apart and \ncall them C1, C2 ,C3 & C4") (make_circle "0" 8 pnt_c1 unit_rad) (make_circle "0" 8 pnt_c2 unit_rad) (make_circle "0" 8 pnt_c3 unit_rad) (make_circle "0" 8 pnt_5 unit_rad) (make_pt "0" 1 pnt_5) (mark_point pnt_5 -1. 0. "5" chr_size) (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (make_pt "0" 1 pnt_6) (mark_point pnt_6 -1. 0. "6" chr_size) (mark_point pt_c1 0. 0. "C1" chr_size) (mark_point pt_c2 0. 0. "C2" chr_size) (mark_point pt_c3 0. 0. "C3" chr_size) (mark_point pt_c4 0. 0. "C4" chr_size) ;;;create points P,Q,R and P',Q' & R' (make_pt "0" 8 pnt_p) (make_pt "0" 8 pnt_pd) (mark_point pnt_p -1. 0. "P" chr_size) (mark_point pnt_pd 0. 0. "P'" chr_size) (make_pt "0" 8 pnt_q) (make_pt "0" 8 pnt_qd) (mark_point pnt_q -1. 0. "Q" chr_size) (mark_point pnt_qd 0. 0. "Q'" chr_size) (make_pt "0" 8 pnt_r) (make_pt "0" 8 pnt_rd) (mark_point pnt_r -1. 0. "R" chr_size) (mark_point pnt_rd 0. 0. "R'" chr_size) (make_line "0" 8 pnt_p pnt_pd) (make_pt "0" 1 pnt_1) (mark_point pnt_1 0. 0. "1" chr_size) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw circles with its center at the orgin , radius=1.0. It cuts Y-axis at pnt_4 (alert "\nDraw lines P5 and R1. \nIntersection with C3 is point 3 & 2 , respectivley") (make_line "0" 8 pnt_p pnt_5) (make_line "0" 8 pnt_r pnt_1) (make_pt "0" 1 pnt_2) (mark_point pnt_2 0. 0. "2" chr_size) (make_pt "0" 1 pnt_3) (mark_point pnt_3 0. 0. "3" chr_size) (alert "\nDraw a unit circle at Q and Q', and call them C5 & C6. \nIntersection with C5 and Q'3 is point 4.") (make_circle "0" 8 pnt_q unit_rad) (make_circle "0" 8 pnt_qd unit_rad) (mark_point '(-1.44 -0.34) 0. 0. "C5" chr_size) (mark_point '(1.44 -0.34) 0. 0. "C6" chr_size) (make_pt "0" 1 pnt_4) (mark_point pnt_4 0. 0. "4" chr_size) (command "_.zoom" "_Extent") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 pt5 pnt_5 pt6 pnt_6) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart drawing arcs using evolute points.") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) ;(command "_.arc" "_c" pt1 pt0 "_a" angle_0) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- pi (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) ;(command "_.arc" "_c" pt2 s1 "_a" angle_1) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) ; (command "_.arc" "_c" pt3 s2 "_a" angle_2) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;fourth point as a pivot (setq radius_3 (+ radius_2 (distance pt3 pt4))) ;radius (setq theta_3 (angle_3p pt4 pt3 pt5)) (setq angle_3 (rtd theta_3)) ;(command "_.arc" "_c" pt4 s3 "_a" angle_3) (SLOW_ARC_1 n_speed "0" 4 pt4 s3 angle_3 0) (setq ent_list_4 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_4)) ) (setq origin_x (car pt4)) (setq origin_y (cadr pt4)) (setq s4_x (+ origin_x (* radius_3 (cos rad_end)))) (setq s4_y (+ origin_y (* radius_3 (sin rad_end)))) (setq s4 (list s4_x s4_y)) ;end of the newly drawn arc (getpoint "\npress return key for the next step") ;fifth point as a pivot (setq radius_4 (- radius_3 (distance pt4 pt5))) ;radius (setq theta_4 (- pi (angle_3p pt5 pt6 pt4))) (setq angle_4 (rtd theta_4)) ;(command "_.arc" "_c" pt5 s4 "_a" angle_4) (SLOW_ARC_1 n_speed "0" 5 pt5 s4 angle_4 0) (setq ent_list_5 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_5)) ) (setq origin_x (car pt5) origin_y (cadr pt5)) (setq s5_x (+ origin_x (* radius_4 (cos rad_end))) s5_y (+ origin_y (* radius_4 (sin rad_end))) s5 (list s5_x s5_y) ) ;end of the newly drawn arc ;(command "_.line" pt5 s5 "") (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt6 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_5PT_EGG ;;; ;;; (prompt "\nLoading draw_sqrt327_egg") ;;; ;;;************************************** ;;; draw_sqrt327_egg (3 points egg) ;;;************************************** ;;; ;;;draw_sqrt327_egg ;;;draw Dixon's sqrt 327 Euclidean egg ;;; (defun c:draw_sqrt327_egg() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq unit_rad 1.0 pnt_c1 '(0 0.5) pnt_c2 '(0 1.5) pnt_c3 '(0 1) pnt_5 '(0 2) pnt_0 '(0 -1.5) pnt_6 '(0 2) pt_c1 '(0.5 -0.5) pt_c2 '(0.5 0.5) pt_c3 '(1 1) pt_c4 '(1 2) pnt_org '(0 0) chr_size 0.1 sqrt_3 (sqrt 3.) half_sqrt_3 (* 0.5 sqrt_3) pnt_p (list (- half_sqrt_3) 1.0) pnt_q (list half_sqrt_3 1.0) pnt_1 (list 0 0 ) pnt_2 (list (- half_sqrt_3) 0 ) pnt_3 (list 0 1.0) rad_2Q (distance pnt_2 pnt_q) rad_34 (- rad_2Q (distance pnt_2 pnt_3)) pnt_r (pld pnt_2 pnt_1 rad_2Q) pnt_rd (list (- (car pnt_r)) 0) ang_123 (rtd (angle pnt_2 pnt_3)) rad_1r (distance pnt_1 pnt_r) pnt_0 (list 0 (- rad_1r)) sqrt_7 (sqrt 7.) four_m_sqrt_7 (- 4. sqrt_7) x_end (/ (* (sqrt 21.) four_m_sqrt_7) 14.) y_end (+ (/ four_m_sqrt_7 sqrt_7) 1.) pnt_23_end (list x_end y_end) pnt_4 (list 0 (+ 1. rad_34)) pnt_0 (list 0 (- (car pnt_r)) ) y_up pnt_4 y_down pnt_0 x_right pnt_r x_left (list (- (car pnt_r)) 0) ) ;;draw_X-Y axis (make_line "0" 8 x_left x_right) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw 4 unit cicles along Y-axis , and name them C1 & C2 (alert "\nDraw 2 unit circles with its center at \n (0 0.5) and (0 1.5)") (make_circle "0" 8 pnt_c1 unit_rad) (make_circle "0" 8 pnt_c2 unit_rad) (make_pt "0" 1 pnt_1) (mark_point pnt_1 -1. 0. "1" chr_size) (make_pt "0" 1 pnt_2) (mark_point pnt_2 -1. 0. "2" chr_size) (mark_point pt_c1 0. 0. "C1" chr_size) (mark_point pt_c2 0. 0. "C2" chr_size) ;;;create points P,Q,R and P',Q' & R' (make_pt "0" 8 pnt_p) (mark_point pnt_p -1. 0. "P" chr_size) (make_pt "0" 8 pnt_q) (mark_point pnt_q 0. 0. "Q" chr_size) (make_line "0" 8 pnt_p pnt_q) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw circles with its center at the orgin , radius=1.0. It cuts Y-axis at pnt_4 (alert "\nDraw lines 23 and Q2. \nLocate point R on X-axis such that 2Q = 2R") (make_line "0" 8 pnt_2 pnt_3) (make_line "0" 8 pnt_2 pnt_q) (make_pt "0" 1 pnt_r) (mark_point pnt_r 0. 0. "R" chr_size) (alert "\nDraw an arc starting from point R,then ends at line 23.") (make_arc_cbe "0" 8 pnt_2 pnt_r pnt_3) (command "_.delay" 500) ` (alert "\nDraw an arc circle on the top.") (make_arc_cbe "0" 8 pnt_3 pnt_23_end pnt_4) (make_pt "0" 1 pnt_4) (mark_point pnt_4 -1. 0. "4" chr_size) (command "_.delay" 500) (alert "\nDraw a circle on the bottom.") (make_arc_cbe "0" 8 pnt_1 pnt_rd pnt_r) (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (command "_.zoom" "_Extents") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 ) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart now for Egg sqrt_327") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_sqrt327_EGG ;;; ;;; ;;; (prompt "\nLoading draw_Moss_egg") ;;; ;;;************************************** ;;; draw_Moss_egg (very simple 3 points egg) ;;;************************************** ;;; ;;;draw_Moss_egg ;;;draw Dixon's Moss' Euclidean egg ;;; (defun c:draw_Moss_egg() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq unit_rad 1.0 sqrt_2 (sqrt 2.) pnt_0 '(0 -1) pnt_1 '(0 0) pnt_2 '(-1 0) pnt_3 '(0 1) pnt_2R '(1 0) pnt_4 (list 0 (- 3. sqrt_2)) rad_34 (- 2 sqrt_2) pnt_org '(0 0) chr_size 0.1 y_up pnt_4 y_down pnt_0 x_right pnt_2r x_left pnt_2 pnt_23_end (list (- sqrt_2 1.) sqrt_2) ) ;;draw_X-Y axis (make_line "0" 8 x_left x_right) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw a unit circle with its center at (0 0) (alert "\nDraw a unit circle with its center at ( 0 0)") (make_circle "0" 8 pnt_1 unit_rad) (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (make_pt "0" 1 pnt_1) (mark_point pnt_1 -1. 0. "1" chr_size) (make_pt "0" 1 pnt_2) (mark_point pnt_2 -1. 0. "2" chr_size) (make_pt "0" 8 pnt_2r) (mark_point pnt_2r 0. 0. "2R" chr_size) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw a circle with its center at point 2, and radius=2.0 (alert "\nDraw an arc starting from point 2R,then ends at line 23.") (make_arc_cbe "0" 8 pnt_2 pnt_2r pnt_3) (make_line "0" 8 pnt_2 pnt_23_end) (command "_.delay" 500) (alert "\nDraw an arc on the top.") (make_arc_cbe "0" 8 pnt_3 pnt_23_end pnt_4) (make_pt "0" 1 pnt_4) (mark_point pnt_4 -1. 0. "4" chr_size) (command "_.delay" 500) (alert "\nMark point 0.") (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (command "_.zoom" "_Extents") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 ) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart now for Egg sqrt_327") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_Moss_EGG ;;; ;;; ;;; (prompt "\nLoading draw_Golden_egg") ;;; ;;;************************************** ;;; draw_Golden_egg ;;;************************************** ;;; ;;;draw_Golden_egg ;;;draw Dixon's Golden Euclidean egg ;;; (defun c:draw_Golden_egg() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq unit_rad 1.0 sqrt_2 (sqrt 2.) pnt_c1 '(0 -1) pnt_1 '(0 0) pnt_c2 '(0 1) pnt_0 '(0 -2) pnt_p '(-1 0) pnt_pd '(1 0) pnt_q '(0 2) pnt_2R '(1 0) pnt_4 (list 0 (- 3. sqrt_2)) rad_34 (- 2 sqrt_2) pnt_org '(0 0) chr_size 0.15 sqrt_5 (sqrt 5.) pnt_2 (list (- 1. sqrt_5) 0) pnt_2r (list (- sqrt_5 1.) 0) pnt_23_end (list (- sqrt_2 1.) sqrt_2) sqrt_2sqrt_5_m_1 (sqrt (* 2. (- sqrt_5 1.))) pnt_3 (list 0 sqrt_2sqrt_5_m_1) pnt_3d (list 0 (- sqrt_2sqrt_5_m_1)) big_rad (+ sqrt_5 1.) pnt_4 (list 0 (+ (cadr pnt_3) (- big_rad 2.)) ) y_up pnt_4 y_down pnt_0 x_right '(2 0) x_left '(-2 0) ) ;;draw_X-Y axis (make_line "0" 8 x_left x_right) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw a unit circle with its center at (0 0) (alert "\nDraw 3 unit circle with its center at\n (0 -1) ,(0 0) & ( 0 1)") (make_circle "0" 8 pnt_c1 unit_rad) (make_circle "0" 8 pnt_1 unit_rad) (make_circle "0" 8 pnt_c2 unit_rad) (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (make_pt "0" 1 pnt_1) (mark_point pnt_1 -1. 0. "1" chr_size) (make_pt "0" 8 pnt_p) (mark_point pnt_p -1. 0. "P" chr_size) (make_pt "0" 8 pnt_pd) (mark_point pnt_pd 0. 0. "P'" chr_size) (make_pt "0" 8 pnt_q) (mark_point pnt_q -1. 0. "Q" chr_size) (make_pt "0" 8 x_right) (make_pt "0" 8 x_left) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw a circle with its center at point 2, and radius=2.0 (alert "\nDraw an arc centered at P \nstarting from point 0,then ends at Q. \nDo the same for point P' .") (make_arc_cbe "0" 8 pnt_p pnt_0 pnt_q) (make_arc_cbe "0" 8 pnt_pd pnt_q pnt_0) (command "_.delay" 500) (make_pt "0" 1 pnt_2) (mark_point pnt_2 -1. 0. "2" chr_size) (make_pt "0" 8 pnt_2r) (mark_point pnt_2r 0. 0. "2R" chr_size) (command "_.delay" 500) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (make_pt "0" 8 pnt_3d) (mark_point pnt_3d -1. 0. "3'" chr_size) (command "_.delay" 500) (alert "\nDraw an arc with its center at 2,\nradius=2.0 from 3' to 3") (make_arc_cbe "0" 8 pnt_2 pnt_3d pnt_3) (command "_.delay" 500) (make_pt "0" 1 pnt_4) (mark_point pnt_4 -1. 0. "4" chr_size) (command "_.delay" 500) ;(alert "\nMark point 0.") ;(make_pt "0" 1 pnt_0) ;(mark_point pnt_0 -1. 0. "0" chr_size) (command "_.zoom" "_Extents") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 ) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart now for Egg- Golden Ratio") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_Golden_EGG ;;; ;;; ;;; (prompt "\nLoading draw_Thom_egg") ;;; ;;;************************************** ;;; draw_Thom_egg ;;;************************************** ;;; ;;;draw_Thom_egg ;;;draw Dixon's Thom Euclidean egg ;;; (defun c:draw_Thom_egg() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq unit_rad 1.0 sqrt_2 (sqrt 2.) pnt_1 '(0 0) pnt_3 '(0 1) pnt_c1 '(-0.25 0) pnt_2 '(-0.75 0) pnt_2R '(0.75 0) rad_34 1.25 pnt_p '(0.75 2.) pnt_4 '(0 2.25) pnt_0 (list 0 (- (/ 7. 4.))) pnt_org '(0 0) chr_size 0.15 sqrt_5 (sqrt 5.) y_up pnt_4 y_down pnt_0 x_right (list (/ 7. 4.) 0) x_left (list (- (/ 7. 4.)) 0) pnt_q x_right ) ;;draw_X-Y axis (make_line "0" 8 x_left x_right) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw a unit circle with its center at (0 0)-point 1 (alert "\nDraw a unit circle with its center at (0 0)\nIt cuts Y-axis at point 3") (make_circle "0" 8 pnt_1 unit_rad) (make_pt "0" 1 pnt_1) (mark_point pnt_1 -1. 0. "1" chr_size) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (make_pt "0" 8 pnt_c1) (command "_.delay" 500) ;;draw a circle with its center at point (-0.25 0) and radius=0.5 (alert "\nDraw a circle at (-0.25 0) , radius = 0.5\nIt cuts X-axis at point 2") (make_circle "0" 8 pnt_c1 0.5) (make_pt "0" 1 pnt_2) (mark_point pnt_2 -1. 0. "2" chr_size) (make_pt "0" 8 pnt_2R) (mark_point pnt_2R 0. 0. "2R" chr_size) (command "_.delay" 500) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (command "_.delay" 500) (alert "\nDraw a line 23. extend it to P\nsuch that 2P is twice 23 length.") (make_pt "0" 8 pnt_p) (mark_point pnt_p -1. 0. "P" chr_size) (make_arc_cbe "0" 8 pnt_2 x_right pnt_p) (make_pt "0" 1 pnt_4) (mark_point pnt_4 -1. 0. "4" chr_size) (command "_.delay" 500) (alert "\nDraw an arc from P to 4") (make_arc_cbe "0" 8 pnt_3 pnt_p pnt_4) (make_pt "0" 8 pnt_q) (mark_point pnt_q 0. 0. "Q" chr_size) (command "_.delay" 500) (alert "\nMark point 0 such that 10 = 1Q.") (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (command "_.delay" 500) (alert "\nDraw an arc from O to Q.") (make_arc_cbe "0" 8 pnt_1 pnt_0 pnt_q) (command "_.zoom" "_Extents") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 ) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart now for Egg- Golden Ratio") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_Thom_EGG ;;; ;;; ;;; (prompt "\nLoading draw_Cundy_Rollett_egg") ;;; ;;;************************************** ;;; draw_Cundy_Rollett_egg ;;;************************************** ;;; ;;;draw_Cundy_Rollett_egg ;;;draw Cundy & Rollett's Euclidean egg ;;; (defun c:draw_Cundy_Rollett_egg() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq sqrt_3 (sqrt 3.) pnt_0 '(0 -2) pnt_1 '(0 0) pnt_2 '(-1 0) pnt_2R '(1 0) pnt_3 (list 0 sqrt_3) pnt_4 (list 0 (+ 1 sqrt_3)) pnt_p '(2 0) pnt_q (list 0.5 (* 1.5 sqrt_3)) chr_size 0.2 y_up pnt_4 y_down pnt_0 x_right '(2 0) x_left '(-2 0) ) ;;draw_X-Y axis (make_line "0" 8 x_left x_right) (make_line "0" 8 y_up y_down) (command "_.zoom" "_E") (command "_.delay" 500) ;;draw a unit circle with its center at (0 0)-point 1 (alert "\nDraw a semi_circle with its center at (0 0) and radius = 2.0") (make_arc_cbe "0" 8 pnt_1 x_left x_right) (make_pt "0" 1 pnt_1) (mark_point pnt_1 -1. 0. "1" chr_size) (make_pt "0" 1 pnt_0) (mark_point pnt_0 -1. 0. "0" chr_size) (make_pt "0" 8 x_left) (make_pt "0" 8 pnt_p) (mark_point pnt_p 0. 0. "P" chr_size) (command "_.delay" 500) ;;draw a circle with its center at point (-0.25 0) and radius=0.5 (alert "\nDefine points 2 & 2R at unit distance from point 1.\nDraw an arc with its center at 2 ,radius 2-2R \nIt cuts Y-axis at point 3") (make_arc_cbe "0" 8 pnt_2 pnt_2R pnt_3) (make_pt "0" 1 pnt_2) (mark_point pnt_2 -1. 0. "2" chr_size) (make_pt "0" 8 pnt_2R) (mark_point pnt_2R 0. 0. "2R" chr_size) (command "_.delay" 500) (make_pt "0" 1 pnt_3) (mark_point pnt_3 -1. 0. "3" chr_size) (command "_.delay" 500) (alert "\nDraw a line 23. extend it to P\nsuch that 2P is 1.5 times 23 length.") (make_line "0" 8 pnt_2 pnt_3) (make_line "0" 8 pnt_3 pnt_q) (make_pt "0" 8 pnt_q) (mark_point pnt_q 0. 0. "Q" chr_size) (command "_.delay" 500) (alert "\nDraw an arc PQ with its center at 2") (make_arc_cbe "0" 8 pnt_2 pnt_p pnt_q) (make_pt "0" 1 pnt_4) (mark_point pnt_4 -1. 0. "4" chr_size) (command "_.delay" 500) (alert "\nDraw an arc from Q to 4") (make_arc_cbe "0" 8 pnt_3 pnt_q pnt_4) (command "_.delay" 500) (command "_.zoom" "_Extents") (command "_.regen") ;;;---------------------draw arcs----------------------- (setq pt0 pnt_0 pt1 pnt_1 pt2 pnt_2 pt3 pnt_3 pt4 pnt_4 ) (setvar "PDMODE" 35) (setq n_speed 100) ;;;This controls the speed bigger the nummber, the slower. (alert "\nStart now for Egg- Golden Ratio") ;compute starting points for arc (setq s0 pt0) ;s0 is pt0 ;first point as a pivot (setq radius_0 (distance pt0 pt1)) ;radius (setq theta_0 (- pi (angle_3p pt1 pt2 pt0))) (setq angle_0 (rtd theta_0)) (SLOW_ARC_1 n_speed "0" 1 pt1 pt0 angle_0 0) (setq ent_list_1 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_1)) ) (setq origin_x (car pt1)) (setq origin_y (cadr pt1)) (setq s1_x (+ origin_x (* radius_0 (cos rad_end)))) (setq s1_y (+ origin_y (* radius_0 (sin rad_end)))) (setq s1 (list s1_x s1_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 2 pt1 pt2) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;second point as a pivot (setq radius_1 (+ radius_0 (distance pt1 pt2))) ;radius (setq theta_1 (- (angle_3p pt2 pt3 pt1))) (setq angle_1 (rtd theta_1)) (SLOW_ARC_1 n_speed "0" 2 pt2 s1 angle_1 0) (setq ent_list_2 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_2)) ) (setq origin_x (car pt2)) (setq origin_y (cadr pt2)) (setq s2_x (+ origin_x (* radius_1 (cos rad_end)))) (setq s2_y (+ origin_y (* radius_1 (sin rad_end)))) (setq s2 (list s2_x s2_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 3 pt2 pt3) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;third point as a pivot (setq radius_2 (+ radius_1 (distance pt2 pt3))) ;radius (setq theta_2 (- pi (angle_3p pt3 pt4 pt2))) (setq angle_2 (rtd theta_2)) (SLOW_ARC_1 n_speed "0" 3 pt3 s2 angle_2 0) (setq ent_list_3 (entget (entlast))) (setq rad_end (cdr (assoc 51 ent_list_3)) ) (setq origin_x (car pt3)) (setq origin_y (cadr pt3)) (setq s3_x (+ origin_x (* radius_2 (cos rad_end)))) (setq s3_y (+ origin_y (* radius_2 (sin rad_end)))) (setq s3 (list s3_x s3_y)) ;end of the newly drawn arc (command "_.delay" 500) (make_line "0" 4 pt3 pt4) (command "_.delay" 500) (getpoint "\npress return key for the next step") ;create a mirror image (setq ss1 (ssget "X" '((0 . "ARC"))) ) (command "_.mirror" ss1 "" pt4 pt0 "_N") (command "_.delay" 2000) (command "_.regen") (reset_sysvar) );;;DRAW_Cundy_Rollett_EGG ;;;