;;;Egg_shape.lsp ;;;display all 8 types of egg shapes ;;; ;;; May 30, 2006 Takaya Iwamoto ;;; ;;; (defun C:Egg_Shape() (setup_sysvar) (setq chr_size 0.1) ;;;place 8 egg shapes in 2 rows (my_block_insert "Egg_Cylindrical_2" '(-2.25 0.25 ) 1.0) (my_block_insert "Egg_Conical_2" '(-1 0.25 ) 1.0) (my_block_insert "Egg_Pyriform_2" '( 0.75 0.25 ) 1.0) (my_block_insert "Egg_Biconical_2" '( 2.0 0.25 ) 1.0) (my_block_insert "Egg_Oval_2" '(-2.25 -1.25) 1.0) (my_block_insert "Egg_Elliptical_2" '(-1 -1.25) 1.0) (my_block_insert "Egg_Spherical_2" '( 0.75 -1.25) 1.0) (my_block_insert "Egg_Longitudinal_2" '( 2.0 -1.25) 1.0) ;;;add text (textdisplay "Cylindrical" '(-2.58 0.) chr_size 0.) (textdisplay "Conical" '(-1.25 0.) chr_size 0.) (textdisplay "Pyriform" '(0.5 0.) chr_size 0.) (textdisplay "Biconical" '(1.75 0.) chr_size 0.) (textdisplay " Oval" '(-2.42 -1.5) chr_size 0.) (textdisplay "Elliptical" '(-1.25 -1.5) chr_size 0.) (textdisplay "Spherical" '(0.46 -1.5) chr_size 0.) (textdisplay "Longitudinal" '(1.64 -1.5) chr_size 0.) (command "_.zoom" "_Extent") (command "_.regen") (reset_sysvar) );;;Egg_shape ;;; (defun C:Compare_Shape() (setup_sysvar) (setq chr_size 0.1 pnt_org '(0 0)) ;;;place 8 egg shapes in 2 rows (my_block_insert "Egg_Cylindrical_3" pnt_org 1.0) (my_block_insert "Egg_Conical_3" pnt_org 1.0) (my_block_insert "Egg_Pyriform_3" pnt_org 1.0) (my_block_insert "Egg_Biconical_3" pnt_org 1.0) (my_block_insert "Egg_Oval_3" pnt_org 1.0) (my_block_insert "Egg_Elliptical_3" pnt_org 1.0) (my_block_insert "Egg_Spherical_3" pnt_org 1.0) (my_block_insert "Egg_Longitudinal_3" pnt_org 1.0) ;;;add text ;(textdisplay "Cylindrical" '(-2.58 0.) chr_size 0.) ;(textdisplay "Conical" '(-1.25 0.) chr_size 0.) ;(textdisplay "Pyriform" '(0.5 0.) chr_size 0.) ;(textdisplay "Biconical" '(1.75 0.) chr_size 0.) ;(textdisplay " Oval" '(-2.42 -1.5) chr_size 0.) ;(textdisplay "Elliptical" '(-1.25 -1.5) chr_size 0.) ;(textdisplay "Spherical" '(0.46 -1.5) chr_size 0.) ;(textdisplay "Longitudinal" '(1.64 -1.5) chr_size 0.) (command "_.zoom" "_Extent") (command "_.regen") (reset_sysvar) );;;Compare_shape ;;; ;;; (defun C:Egg_Shape_3() (setup_sysvar) (setq chr_size 0.1) ;;;place 8 egg shapes in 2 rows (my_block_insert "Egg_Cylindrical_3" '(-2.25 0.25 ) 1.0) (my_block_insert "Egg_Conical_3" '(-1 0.25 ) 1.0) (my_block_insert "Egg_Pyriform_3" '( 0.75 0.25 ) 1.0) (my_block_insert "Egg_Biconical_3" '( 2.0 0.25 ) 1.0) (my_block_insert "Egg_Oval_3" '(-2.25 -1.25) 1.0) (my_block_insert "Egg_Elliptical_3" '(-1 -1.25) 1.0) (my_block_insert "Egg_Spherical_3" '( 0.75 -1.25) 1.0) (my_block_insert "Egg_Longitudinal_3" '( 2.0 -1.25) 1.0) ;;;add text (textdisplay "Cylindrical" '(-2.58 0.) chr_size 0.) (textdisplay "Conical" '(-1.25 0.) chr_size 0.) (textdisplay "Pyriform" '(0.5 0.) chr_size 0.) (textdisplay "Biconical" '(1.75 0.) chr_size 0.) (textdisplay " Oval" '(-2.42 -1.5) chr_size 0.) (textdisplay "Elliptical" '(-1.25 -1.5) chr_size 0.) (textdisplay "Spherical" '(0.46 -1.5) chr_size 0.) (textdisplay "Longitudinal" '(1.64 -1.5) chr_size 0.) (command "_.zoom" "_Extent") (command "_.regen") (reset_sysvar) );;;Egg_shape_3 ;;; ;;; ;;;Compute 3 measures to define Egg Shapes ;;; (defun C:comp_measure() (setq STOP 0) (while (= STOP 0) (setq b (getreal "\nInput width :") Rp (getreal "\nSmall end Radius :") Rb (getreal "\nBlunt end Radius :") ) (setq b_sqr (* b b) R_dif (- Rb Rp) R_sum (+ Rb Rp) F_Asym (/ R_dif b_sqr) F_Bicone (- (/ R_sum b_sqr) 1.) F_Elong (/ 1. b) Asym (rtos F_Asym 2 3) Bicone (rtos F_Bicone 2 3) Elong (rtos F_Elong 2 3) output (strcat "Asym Bicone Elong = " Asym " : " Bicone " : " Elong) ) (princ output)(terpri) );;;while loop );;;measure ;;; ;;; ;;;Make_Frame ;;;make a window frame for viewing normalized egg drawing ;;; 2 corners' coordinates are (-0.51, -0.05) & (0.51 , 1.05) ;;; (defun C:Set_Egg_Frame() (setq lower_left '(-0.51 -0.05) upper_right '(0.51 1.05) ) (command "_.zoom" "_W" lower_left upper_right) (command "_.regen") );;;SET_EGG_FRAME ;;; ;;; ;;;End_Radius ;;;Tool for for finding the radius along a line (in this case Y-axis) ;;; (defun C:End_Radius() ;set up (setvar "OSMODE" 8) (setq pnt_end (getpoint "\nPick the end point ")) (alert "Place the cursor near the point \"H\", then click left mouse to start.") (setq answer (getpoint "\nPress left mouse to start.Click mouse to stop."))(terpri) (while (and (setq key (grread T)) (= (car key) 5) ) (setq pnt_tmp (list 0 (cadr (cadr key))) temp_rad (distance pnt_tmp pnt_end) ) (make_circle "0" 0 pnt_tmp temp_rad) ) );;; ;;; ;;;Compare 98 types of EUclidean Eggs' shapes ;;; (defun C:Compare_Euclidean_Egg() (setup_sysvar) (setq chr_size 0.1 pnt_org '(0 0)) ;;;place 8 egg shapes in one location for comparison (my_block_insert "Egg_Euclidean_4pt_Normalized_1" pnt_org 1.0) (my_block_insert "Egg_Euclidean_5pt_Normalized_1" pnt_org 1.0) (my_block_insert "Egg_Euclidean_Moss_Normalized_1" pnt_org 1.0) (my_block_insert "Egg_Euclidean_Thom_Normalized_1" pnt_org 1.0) (my_block_insert "Egg_Euclidean_Golden_Normalized_1" pnt_org 1.0) (my_block_insert "Egg_Euclidean_sqrt327_Normalized_1" pnt_org 1.0) (my_block_insert "Egg_Euclidean_Cundy_Rollett_Normalized_1" pnt_org 1.0) ;;;add text ;(textdisplay "Elliptical" '(-1.25 -1.5) chr_size 0.) ;(textdisplay "Spherical" '(0.46 -1.5) chr_size 0.) ;(textdisplay "Longitudinal" '(1.64 -1.5) chr_size 0.) (command "_.zoom" "_Extent") (command "_.regen") (reset_sysvar) );;;Compare_Euclidean_Egg ;;; ;;; ;;;Show_Euclidean_Egg ;;;Show all 7 types of Euclidean Eggs ;;; (defun C:Show_Euclidean_Egg() (setup_sysvar) (setq chr_size 0.1) ;;;place 8 egg shapes in 2 rows (my_block_insert "Egg_Euclidean_4pt_Normalized_1" '(-2.25 0.25 ) 1.0) (my_block_insert "Egg_Euclidean_5pt_Normalized_1" '(-1 0.25 ) 1.0) (my_block_insert "Egg_Euclidean_Moss_Normalized_1" '( 0.75 0.25 ) 1.0) (my_block_insert "Egg_Euclidean_Thom_Normalized_1" '( 2.0 0.25 ) 1.0) (my_block_insert "Egg_Euclidean_Golden_Normalized_1" '(-2.25 -1.25) 1.0) (my_block_insert "Egg_Euclidean_sqrt327_Normalized_1" '(-1 -1.25) 1.0) (my_block_insert "Egg_Euclidean_Cundy_Rollett_Normalized_1" '( 0.75 -1.25) 1.0) ;;;add text (textdisplay "4 Points" '(-2.50 0.) chr_size 0.) (textdisplay "5 Points" '(-1.25 0.) chr_size 0.) (textdisplay "Moss' Egg" '(0.5 0.) chr_size 0.) (textdisplay "Thom's Egg" '(1.75 0.) chr_size 0.) (textdisplay "Golden Egg" '(-2.6 -1.5) chr_size 0.) (textdisplay "Sqrt 327" '(-1.25 -1.5) chr_size 0.) (textdisplay "Cundy & Rollett" '(0.36 -1.5) chr_size 0.) (command "_.zoom" "_Extent") (command "_.regen") (reset_sysvar) );;;Show_Euclidean_Egg ;;;