#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# font.rh
# text_to_rayshade.c
# This archive created: Wed Jun 22 07:33:54 1994
export PATH; PATH=/bin:$PATH
if test -f 'font.rh'
then
echo shar: will not over-write existing file "'font.rh'"
else
cat << \SHAR_EOF > 'font.rh'
/*
* font.rh - 3D geometries of letters, numbers, and special characters.
*
* Based on upper case letters by Paul Chamberlain (tif@austin.ibm.com)
*
* Lower case letters, numbers, special characters, and small changes
* to upper case letters by Dan Peisach and Eric Fontano,
* Rosenstiel Medical Science Center, Brandeis University.
* (e-mail to peisach@hydra.rose.brandeis.edu)
*/
/*
Un-comment out the TEST line for a test image of the lower case
and numerical characters
*/
/*
#define TEST
*/
#ifndef THICK
#define THICK 0.1 /* Thickness of the letters */
#endif
#ifndef RATIO /* Ratio of height of lower and upper case letters */
#define RATIO 0.7 /* DO NOT SET BELOW 0.6 */
#endif
#define ARATIO (1-RATIO)
#define GAP (1-2*(1-RATIO))
#ifndef HEIGHT
#define HEIGHT 2.0 /* Height (not including lower extensions) of chars */
#endif
/*
This endscale centers the letters at the origin and scales them.
Get rid of the translate statement to place the origin of
letters at the lower left corner.
The rotate statement places the letters in the xy plane rather
than the xz one.
*/
#define endscale end translate -0.5 0 -1 \
/* rotate 1 0 0 -90 */ scale (HEIGHT/2) (HEIGHT/2) (HEIGHT/2)
/*
These are ascii character definitions for your convenience!
*/
#define font_33 font_exclamation
#define font_34 font_quotes
#define font_35 font_pound
#define font_36 font_dollar
#define font_37 font_percent
#define font_38 font_ampersand
#define font_39 font_apostrophe
#define font_40 font_leftp
#define font_41 font_rightp
#define font_42 font_asterisk
#define font_43 font_plus
#define font_44 font_comma
#define font_45 font_minus
#define font_46 font_period
#define font_47 font_slash
#define font_48 font_0
#define font_49 font_1
#define font_50 font_2
#define font_51 font_3
#define font_52 font_4
#define font_53 font_5
#define font_54 font_6
#define font_55 font_7
#define font_56 font_8
#define font_57 font_9
#define font_58 font_colon
#define font_59 font_semicolon
#define font_60 font_less
#define font_61 font_equals
#define font_62 font_greater
#define font_63 font_question
#define font_64 font_at
#define font_65 font_A
#define font_66 font_B
#define font_67 font_C
#define font_68 font_D
#define font_69 font_E
#define font_70 font_F
#define font_71 font_G
#define font_72 font_H
#define font_73 font_I
#define font_74 font_J
#define font_75 font_K
#define font_76 font_L
#define font_77 font_M
#define font_78 font_N
#define font_79 font_O
#define font_80 font_P
#define font_81 font_Q
#define font_82 font_R
#define font_83 font_S
#define font_84 font_T
#define font_85 font_U
#define font_86 font_V
#define font_87 font_W
#define font_88 font_X
#define font_89 font_Y
#define font_90 font_Z
#define font_91 font_leftb
#define font_92 font_backslash
#define font_93 font_rightb
#define font_94 font_carat
#define font_95 font_underscore
#define font_96 font_backapostrophe
#define font_97 font_a
#define font_98 font_b
#define font_99 font_c
#define font_100 font_d
#define font_101 font_e
#define font_102 font_f
#define font_103 font_g
#define font_104 font_h
#define font_105 font_i
#define font_106 font_j
#define font_107 font_k
#define font_108 font_l
#define font_109 font_m
#define font_110 font_n
#define font_111 font_o
#define font_112 font_p
#define font_113 font_q
#define font_114 font_r
#define font_115 font_s
#define font_116 font_t
#define font_117 font_u
#define font_118 font_v
#define font_119 font_w
#define font_120 font_x
#define font_121 font_y
#define font_122 font_z
#define font_123 font_left_brace
#define font_124 font_pipe
#define font_125 font_right_brace
#define font_126 font_tilde
name toparc
intersect
torus 0.5 THICK 0.5 0 1.5 0 1 0
box -1 -1 1.5 2 1 3
end
name botarc
intersect
torus 0.5 THICK 0.5 0 0.5 0 1 0
box -1 -1 -1 2 1 0.5
end
name upperquarter
intersect
torus 0.5 THICK 0.5 0 1.5 0 1 0
box 0.5 -1 1.5 2 1 3
end
name upperleftquarter
intersect
torus 0.5 THICK 0.5 0 1.5 0 1 0
box 0.5 -1 1.5 -2 1 3
end
name upperarc
intersect
torus 0.5 THICK 0.5 0 1.5 0 1 0
box 0.5 -1 0 2 1 3
end
name lowerquarter
intersect
torus 0.5 THICK 0.5 0 0.5 0 1 0
box 0.5 -1 -1 2 1 0.5
end
name lowerleftquarter
intersect
torus 0.5 THICK 0.5 0 0.5 0 1 0
box -1 -1 -1 0.5 1 0.5
end
name lowerarc
intersect
torus 0.5 THICK 0.5 0 0.5 0 1 0
box 0.5 -1 -1 2 1 2
end
name corner
intersect
torus THICK THICK 0 0 0 0 1 0
box 0 -1 0 1 1 1
end
#define upperleft object corner \
rotate 0 1 0 -90 translate THICK 0 (2-THICK)
#define lowerleft object corner \
rotate 0 1 0 180 translate THICK 0 THICK
/*
* A cylinder with a sphere on each end.
*/
#define cylsphere(len) \
list \
cylinder THICK 0 0 0 0 0 (len) \
sphere THICK 0 0 0 \
sphere THICK 0 0 (len) \
end
/*
* A cylinder with a sphere on one end and a disc on the other.
*/
#define cyldisc(len) \
list \
cylinder THICK 0 0 0 0 0 (len) \
sphere THICK 0 0 0 \
end
name font_exclamation
list
sphere THICK 0.5 0 0
cylsphere(1.5) translate 0.5 0 0.5
endscale
name font_quotes
list
cylsphere(0.5) translate 0.3 0 1.5
cylsphere(0.5) translate 0.7 0 1.5
endscale
name font_pound
list
cylinder THICK 0.15 0 0 0.35 0 2
cylinder THICK 0.65 0 0 0.85 0 2
sphere THICK 0.15 0 0
sphere THICK 0.35 0 2
sphere THICK 0.65 0 0
sphere THICK 0.85 0 2
cylinder THICK 0 0 0.667 1 0 0.667
cylinder THICK 0 0 1.333 1 0 1.333
sphere THICK 0 0 0.667
sphere THICK 1 0 0.667
sphere THICK 0 0 1.333
sphere THICK 1 0 1.333
endscale
name font_dollar
list
intersect
torus (RATIO/2) THICK (RATIO/2) 0 (1.5*RATIO) 0 1 0
box -1 -1 (RATIO-THICK) (RATIO/2) 1 3
end translate 0 0 (ARATIO)
intersect
torus (RATIO/2) THICK (1-RATIO/2) 0 (1.5*RATIO) 0 1 0
box (1-RATIO/2) -1 (1.5*RATIO) 2 1 3
end translate 0 0 (ARATIO)
intersect
torus (RATIO/2) THICK (RATIO/2) 0 (.5*RATIO) 0 1 0
box -1 -1 (.5*RATIO) (RATIO/2) 1 -1
end translate 0 0 (ARATIO)
intersect
torus (RATIO/2) THICK (1-RATIO/2) 0 (.5*RATIO) 0 1 0
box (1-RATIO/2) -1 (RATIO+THICK) 2 1 -1
end translate 0 0 (ARATIO)
cylinder THICK (RATIO/2) 0 (ARATIO) (1-RATIO/2) 0 (ARATIO)
cylinder THICK (RATIO/2) 0 1 (1-RATIO/2) 0 1
cylinder THICK (RATIO/2) 0 (1+RATIO) (1-RATIO/2) 0 (1+RATIO)
sphere THICK 0 0 (RATIO/2+ARATIO)
sphere THICK 1 0 (1+0.5*RATIO)
cylsphere(2) translate 0.333 0 0
cylsphere(2) translate 0.667 0 0
endscale
name font_percent
list
torus 0.25 THICK 0.25 0 1.75 0 1 0
torus 0.25 THICK 0.75 0 0.25 0 1 0
cylinder THICK 0 0 0 1 0 2
sphere THICK 0 0 0
sphere THICK 1 0 2
endscale
name font_ampersand
list
sphere THICK 0.5 0 0
endscale
name font_apostrophe
list
cylsphere(0.5) translate 0.5 0 1.5
endscale
name font_leftp
list
intersect
torus .5 THICK 0.75 0 1.5 0 1 0
box -1 -1 1.5 .75 1 3
end
intersect
torus .5 THICK .75 0 .5 0 1 0
box -1 -1 -1 .75 1 .5
end
cylinder THICK 0.25 0 .5 0.25 0 1.5
sphere THICK .75 0 0
sphere THICK .75 0 2
endscale
name font_rightp
list
intersect
torus .5 THICK 0.25 0 1.5 0 1 0
box .25 -1 1.5 2 1 3
end
intersect
torus .5 THICK .25 0 .5 0 1 0
box .25 -1 -1 2 1 .5
end
cylinder THICK 0.75 0 .5 0.75 0 1.5
sphere THICK .25 0 0
sphere THICK .25 0 2
endscale
name font_asterisk
list
cylinder THICK .2 0 .4 .8 0 1.6
cylinder THICK .2 0 1.6 .8 0 .4
cylinder THICK 0 0 1 1 0 1
sphere THICK .2 0 .4
sphere THICK .8 0 .4
sphere THICK 1 0 1
sphere THICK .8 0 1.6
sphere THICK .2 0 1.6
sphere THICK 0 0 1
endscale
name font_plus
list
cylsphere(1) translate 0.5 0 0.5
cylinder THICK 0 0 1 1 0 1
sphere THICK 0 0 1
sphere THICK 1 0 1
endscale
name font_comma
list
cylinder THICK 0.2 0 0.1 0 0 -0.3
sphere THICK 0.2 0 0.1
sphere THICK 0 0 -0.3
endscale
name font_minus
list
cylinder THICK 0 0 1 1 0 1
sphere THICK 0 0 1
sphere THICK 1 0 1
endscale
name font_period
list
sphere THICK 0.5 0 0
endscale
name font_slash
list
cylinder THICK 0 0 0 1 0 2
sphere THICK 0 0 0
sphere THICK 1 0 2
endscale
name font_0
list
object toparc
cylinder THICK 0 0 0.5 0 0 1.5
object botarc
cylinder THICK 1 0 0.5 1 0 1.5
cylinder THICK 0 0 0 1 0 2
sphere THICK 1 0 2
sphere THICK 0 0 0
endscale
name font_1
list
cylsphere(2) translate 0.5 0 0
cylinder THICK 0.5 0 2 0.3 0 1.7
sphere THICK 0.3 0 1.8
endscale
name font_2
list
sphere THICK 0 0 1.5
object toparc
cylsphere(0.125) translate 1 0 1.375
object lowerquarter translate 0 0 0.875
object upperleftquarter translate 0 0 -1.125
cylsphere(0.375) translate 0 0 0
cylinder THICK 0 0 0 1 0 0
sphere THICK 1 0 0
endscale
name font_3
list
object upperarc
object lowerarc
object toparc
object botarc
sphere THICK 0 0 1.5
sphere THICK 0 0 0.5
sphere THICK 0.5 0 1
endscale
name font_4
list
cylsphere(2) translate 0.8 0 0
cylinder THICK 0.8 0 2 0 0 .7
sphere THICK 0 0 0.7
cylinder THICK 0 0 0.7 1 0 0.7
sphere THICK 1 0 0.7
endscale
name font_5
list
object botarc
sphere THICK 0 0 0.5
cylinder THICK 1 0 0.5 1 0 1
object toparc scale 1 1 .75 translate 0 0 -0.125
sphere THICK 0 0 0 scale 1 1 0.75 translate 0 0 1
cylinder THICK 0 0 1 0 0 2
sphere THICK 0 0 2
sphere THICK 1 0 2
cylinder THICK 0 0 2 1 0 2
endscale
name font_6
list
object toparc
object botarc
object toparc translate 0 0 -0.875
cylinder THICK 1 0 0.5 1 0 0.625
cylinder THICK 0 0 0.5 0 0 1.5
sphere THICK 1 0 1.5
endscale
name font_7
list
sphere THICK 0 0 2
cylinder THICK 0 0 2 1 0 2
sphere THICK 1 0 2
cylinder THICK 1 0 2 0.25 0 0
sphere THICK 0.25 0 0
endscale
name font_8
list
object toparc
object toparc translate 0 0 -1
object botarc
object botarc translate 0 0 1
endscale
name font_9
list
object toparc
object botarc
object botarc translate 0 0 0.875
cylinder THICK 1 0 1.5 1 0 0.5
cylinder THICK 0 0 1.5 0 0 1.375
sphere THICK 0 0 0.5
endscale
name font_colon
list
sphere THICK 0.5 0 1.5
sphere THICK 0.5 0 0.5
endscale
name font_semicolon
list
sphere THICK 0.5 0 1.5
cylinder THICK 0.5 0 0.5 0.3 0 0.1
sphere THICK 0.5 0 0.5
sphere THICK 0.3 0 0.1
endscale
name font_less
list
sphere THICK 0.75 0 1.5
cylinder THICK 0.25 0 1 0.75 0 1.5
sphere THICK 0.25 0 1
cylinder THICK 0.25 0 1 0.75 0 0.5
sphere THICK 0.75 0 0.5
endscale
name font_equals
list
sphere THICK 0.1 0 0.75
sphere THICK .9 0 0.75
cylinder THICK 0.1 0 0.75 0.9 0 0.75
cylinder THICK 0.1 0 1.25 0.9 0 1.25
sphere THICK 0.1 0 1.25
sphere THICK 0.9 0 1.25
endscale
name font_greater
list
sphere THICK 0.25 0 1.5
cylinder THICK 0.75 0 1 0.25 0 1.5
sphere THICK 0.75 0 1
cylinder THICK 0.75 0 1 0.25 0 0.5
sphere THICK 0.25 0 0.5
endscale
name font_question
list
sphere THICK 0 0 1.5
object toparc
intersect
torus 0.5 THICK 0.5 0 1.5 0 1 0
box 0.5 -1 0 2 1 1.5
end
intersect
torus 0.25 THICK 0.5 0 0.75 0 1 0
box 0 -1 0.75 0.5 1 2
end
cylinder THICK 0.25 0 .75 0.25 0 0.5
sphere THICK 0.25 0 0.5
sphere THICK 0.25 0 0
endscale
name font_at
list
sphere THICK 0.5 0 0
endscale
name font_A
list
cylinder THICK 0 0 0 0.5 0 2
cylinder THICK 1 0 0 0.5 0 2
cylinder THICK (0.5-0.5*0.5) 0 0.7 (0.5+0.5*0.5) 0 0.7
sphere THICK 0.5 0 2
sphere THICK 0 0 0
sphere THICK 1 0 0
endscale
name font_B
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 2 0.5 0 2
cylinder THICK 0 0 1 0.5 0 1
cylinder THICK 0 0 0 0.5 0 0
object upperarc
object lowerarc
sphere THICK 0 0 0
sphere THICK 0 0 2
endscale
name font_C
list
object toparc
cylinder THICK 0 0 0.5 0 0 1.5
object botarc
sphere THICK 1 0 1.5
sphere THICK 1 0 0.5
endscale
name font_D
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 2 0.5 0 2
cylinder THICK 1 0 0.5 1 0 1.5
cylinder THICK 0 0 0 0.5 0 0
object upperquarter
object lowerquarter
sphere THICK 0 0 0
sphere THICK 0 0 2
endscale
name font_E
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 0 1 0 0
cylinder THICK 0 0 2 1 0 2
cylinder THICK 0 0 1 0.75 0 1
sphere THICK 0 0 0
sphere THICK 0 0 2
sphere THICK 1 0 0
sphere THICK 1 0 2
sphere THICK 0.75 0 1
endscale
name font_F
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 2 1 0 2
cylinder THICK 0 0 1 0.75 0 1
sphere THICK 0 0 0
sphere THICK 0 0 2
sphere THICK 1 0 2
sphere THICK 0.75 0 1
endscale
name font_G
list
object toparc
cylinder THICK 0 0 0.5 0 0 1.5
object botarc
cylinder THICK 1 0 0.8 1 0 0.5
sphere THICK 1 0 1.5
cylinder THICK 0.6 0 0.8 1 0 0.8
sphere THICK 1 0 0.8
sphere THICK 0.6 0 0.8
endscale
name font_H
list
cylsphere(2) translate 0 0 0
cylsphere(2) translate 1 0 0
cylinder THICK 0 0 1 1 0 1
endscale
name font_I
list
cylinder THICK 0.5 0 0 0.5 0 2
cylinder THICK 0 0 0 1 0 0
cylinder THICK 0 0 2 1 0 2
sphere THICK 0 0 0
sphere THICK 1 0 0
sphere THICK 0 0 2
sphere THICK 1 0 2
endscale
name font_J
list
cyldisc(1.5) rotate 0 1 0 180 translate 1 0 2
object botarc
sphere THICK 0 0 0.5
endscale
name font_K
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 1 0 2 0 0 1
cylinder THICK 1 0 0 0.5 0 1.5
sphere THICK 0 0 0
sphere THICK 0 0 2
sphere THICK 1 0 2
sphere THICK 1 0 0
endscale
name font_L
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 0 1 0 0
sphere THICK 0 0 0
sphere THICK 0 0 2
sphere THICK 1 0 0
endscale
name font_M
list
cylsphere(2) translate 0 0 0
cylsphere(2) translate 1 0 0
cylinder THICK 0 0 2 0.5 0 1
cylinder THICK 1 0 2 0.5 0 1
sphere THICK 0.5 0 1
endscale
name font_N
list
cylsphere(2) translate 0 0 0
cylsphere(2) translate 1 0 0
cylinder THICK 0 0 2 1 0 0
endscale
name font_O
list
object toparc
cylinder THICK 0 0 0.5 0 0 1.5
object botarc
cylinder THICK 1 0 0.5 1 0 1.5
endscale
name font_P
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 2 0.5 0 2
cylinder THICK 0 0 1 0.5 0 1
object upperarc
sphere THICK 0 0 0
sphere THICK 0 0 2
endscale
name font_Q
list
object toparc
cylinder THICK 0 0 0.5 0 0 1.5
object botarc
cylinder THICK 1 0 0.5 1 0 1.5
cylinder THICK 1 0 0 0.6 0 0.8
sphere THICK 1 0 0
sphere THICK 0.6 0 0.8
endscale
name font_R
list
cylinder THICK 0 0 0 0 0 2
cylinder THICK 0 0 2 0.5 0 2
cylinder THICK 0 0 1 0.5 0 1
object upperarc
sphere THICK 0 0 0
sphere THICK 0 0 2
object upperarc
object upperquarter translate 0 0 -1
cyldisc(0.5) translate 1 0 0
endscale
name font_S
list
sphere THICK 1 0 1.5
object toparc
object lowerleftquarter translate 0 0 1
object upperquarter translate 0 0 -1
object botarc
sphere THICK 0 0 0.5
endscale
name font_T
list
cyldisc(2) translate 0.5 0 0
cylsphere(1)
rotate 0 1 0 90 translate 0 0 2
endscale
name font_U
list
cylinder THICK 0 0 0.5 0 0 2
object botarc
cylinder THICK 1 0 0.5 1 0 2
sphere THICK 0 0 2
sphere THICK 1 0 2
endscale
name font_V
list
cylinder THICK 0.5 0 0 0 0 2
cylinder THICK 0.5 0 0 1 0 2
sphere THICK 0 0 2
sphere THICK 1 0 2
sphere THICK 0.5 0 0
endscale
name font_W
list
sphere THICK 0 0 2
cylinder THICK 0 0 2 0.15 0 0
sphere THICK 0.15 0 0
cylinder THICK 0.15 0 0 0.5 0 1
sphere THICK 0.5 0 1
cylinder THICK .85 0 0 0.5 0 1
sphere THICK .85 0 0
cylinder THICK .85 0 0 1 0 2
sphere THICK 1 0 2
endscale
name font_X
list
cylinder THICK 1 0 0 0 0 2
cylinder THICK 0 0 0 1 0 2
sphere THICK 0 0 2
sphere THICK 1 0 2
sphere THICK 1 0 0
sphere THICK 0 0 0
endscale
name font_Y
list
cylinder THICK 0 0 2 0.5 0 1
cylinder THICK 1 0 2 0.5 0 1
sphere THICK 0 0 2
sphere THICK 1 0 2
cylsphere(1) translate 0.5 0 0
endscale
name font_Z
list
cylinder THICK 0 0 2 1 0 2
cylinder THICK 0 0 0 1 0 2
cylinder THICK 0 0 0 1 0 0
sphere THICK 0 0 2
sphere THICK 1 0 2
sphere THICK 1 0 0
sphere THICK 0 0 0
endscale
name font_leftb
list
cylsphere(2) translate 0.25 0 0
cylinder THICK 0.25 0 0 0.75 0 0
sphere THICK 0.75 0 0
cylinder THICK 0.25 0 2 0.75 0 2
sphere THICK 0.75 0 2
endscale
name font_backslash
list
cylinder THICK 1 0 0 0 0 2
sphere THICK 1 0 0
sphere THICK 0 0 2
endscale
name font_rightb
list
cylsphere(2) translate 0.75 0 0
cylinder THICK 0.25 0 0 0.75 0 0
sphere THICK 0.25 0 0
cylinder THICK 0.25 0 2 0.75 0 2
sphere THICK 0.25 0 2
endscale
name font_carat
list
cylinder THICK .5 0 2 0 0 1
cylinder THICK .5 0 2 1 0 1
sphere THICK .5 0 2
sphere THICK 0 0 1
sphere THICK 1 0 1
endscale
name font_underscore
list
cylinder THICK 0 0 (-2*THICK) 1 0 (-2*THICK)
sphere THICK 0 0 (-2*THICK)
sphere THICK 1 0 (-2*THICK)
endscale
name font_backapostrophe
list
cylinder THICK 0.6 0 1.6 0.4 0 2
sphere THICK 0.6 0 1.6
sphere THICK 0.4 0 2
endscale
name font_a
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
cylsphere(2*RATIO) translate 1 0 0
endscale
name font_b
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 1 0 0.5 1 0 (0.5+GAP)
cylsphere(2)
endscale
name font_c
list
object toparc translate 0 0 (-2*ARATIO)
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
object botarc
sphere THICK 1 0 (0.5+GAP)
sphere THICK 1 0 0.5
endscale
name font_d
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
cylsphere(2) translate 1 0 0
endscale
name font_e
list
object toparc translate 0 0 (-2*ARATIO)
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
object botarc
sphere THICK 1 0 (0.5+GAP)
cylinder THICK 0 0 (0.5+GAP) 1 0 (0.5+GAP)
sphere THICK 1 0 0.5
endscale
name font_f
list
sphere THICK .5 0 0
cylinder THICK .5 0 0 .5 0 1.5
object upperleftquarter translate 0.5 0 0
sphere THICK 1 0 2
cylinder THICK 0.2 0 1 0.8 0 1
sphere THICK 0.2 0 1
sphere THICK 0.8 0 1
endscale
name font_g
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
cylinder THICK 1 0 (2*RATIO) 1 0 (0-GAP)
object botarc translate 0 0 (-0.5-GAP)
sphere THICK 1 0 (2*RATIO)
sphere THICK 0 0 (0-GAP)
endscale
name font_h
list
object toparc translate 0 0 (-2*ARATIO)
cylsphere(2)
cylinder THICK 1 0 0 1 0 (0.5+GAP)
sphere THICK 1 0 0
endscale
name font_i
list
cylsphere(2*RATIO) translate 0.5 0 0
sphere THICK 0.5 0 (2*RATIO+GAP+THICK)
endscale
name font_j
list
cylinder THICK 1 0 (2*RATIO) 1 0 (0-GAP)
object botarc translate 0 0 (-0.5-GAP)
sphere THICK 1 0 (2*RATIO)
sphere THICK 0 0 (0-GAP)
sphere THICK 1 0 (2*RATIO+GAP+THICK)
endscale
name font_k
list
cylsphere(2)
cylinder THICK 0 0 (0.6*RATIO) 1 0 (2*RATIO)
cylinder THICK 0.4 0 (0.6*RATIO+0.4*1.4*RATIO) 1 0 0
sphere THICK 1 0 0
sphere THICK 1 0 (2*RATIO)
endscale
name font_l
list
cylsphere(2) translate 0.5 0 0
endscale
name font_m
list
intersect
torus 0.25 THICK 0.25 0 (2*RATIO-0.25) 0 1 0
box -1 -1 (2*RATIO-0.25) 1 1 3
end
intersect
torus 0.25 THICK 0.25 0 (2*RATIO-0.25) 0 1 0
box -1 -1 (2*RATIO-0.25) 1 1 3
end translate 0.5 0 0
cylsphere(2*RATIO)
cylinder THICK 0.5 0 0 0.5 0 (2*RATIO-0.25)
cylinder THICK 1.0 0 0 1.0 0 (2*RATIO-0.25)
sphere THICK 0.5 0 0
sphere THICK 1 0 0
endscale
name font_n
list
object toparc translate 0 0 (-2*ARATIO)
cylsphere(2*RATIO)
cylinder THICK 1 0 0 1 0 (0.5+GAP)
sphere THICK 1 0 0
endscale
name font_o
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
cylinder THICK 1 0 0.5 1 0 (0.5+GAP)
endscale
name font_p
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 1 0 0.5 1 0 (0.5+GAP)
cylinder THICK 0 0 (2*RATIO) 0 0 (0-2*GAP)
sphere THICK 0 0 (2*RATIO)
sphere THICK 0 0 (0-2*GAP)
endscale
name font_q
list
object toparc translate 0 0 (-2*ARATIO)
object botarc
cylinder THICK 0 0 0.5 0 0 (0.5+GAP)
cylinder THICK 1 0 (2*RATIO) 1 0 (0-2*GAP)
sphere THICK 1 0 (2*RATIO)
sphere THICK 1 0 (0-2*GAP)
endscale
name font_r
list
object toparc translate 0 0 (-2*ARATIO)
cylsphere(2*RATIO)
sphere THICK 1 0 (0.5+GAP)
endscale
name font_s
list
intersect
torus (RATIO/2) THICK (RATIO/2) 0 (1.5*RATIO) 0 1 0
box -1 -1 (RATIO-THICK) (RATIO/2) 1 3
end
intersect
torus (RATIO/2) THICK (1-RATIO/2) 0 (1.5*RATIO) 0 1 0
box (1-RATIO/2) -1 (1.5*RATIO) 2 1 3
end
intersect
torus (RATIO/2) THICK (RATIO/2) 0 (.5*RATIO) 0 1 0
box -1 -1 (.5*RATIO) (RATIO/2) 1 -1
end
intersect
torus (RATIO/2) THICK (1-RATIO/2) 0 (.5*RATIO) 0 1 0
box (1-RATIO/2) -1 (RATIO+THICK) 2 1 -1
end
cylinder THICK (RATIO/2) 0 0 (1-RATIO/2) 0 0
cylinder THICK (RATIO/2) 0 (RATIO) (1-RATIO/2) 0 (RATIO)
cylinder THICK (RATIO/2) 0 (2*RATIO) (1-RATIO/2) 0 (2*RATIO)
sphere THICK 0 0 (RATIO/2)
sphere THICK 1 0 (1.5*RATIO)
endscale
name font_t
list
cylsphere(2) translate 0.5 0 0
cylinder THICK 0.2 0 (2*RATIO) 0.8 0 (2*RATIO)
sphere THICK 0.2 0 (2*RATIO)
sphere THICK 0.8 0 (2*RATIO)
endscale
name font_u
list
object botarc
cylinder THICK 0 0 0.5 0 0 (2*RATIO)
cylsphere(2*RATIO) translate 1 0 0
sphere THICK 0 0 (2*RATIO)
endscale
name font_u.new
list
intersect
torus (RATIO/2) THICK (RATIO/2) 0 (.5*RATIO) 0 1 0
box -1 -1 (.5*RATIO) (RATIO/2) 1 -1
end
intersect
torus (RATIO/2) THICK (1-RATIO/2) 0 (.5*RATIO) 0 1 0
box (1-RATIO/2) -1 (.5*RATIO) 2 1 -1
end
cylinder THICK (RATIO/2) 0 0 (1-RATIO/2) 0 0
cylinder THICK 0 0 (RATIO/2) 0 0 (2*RATIO)
cylsphere(2*RATIO) translate 1 0 0
sphere THICK 0 0 (2*RATIO)
endscale
name font_v
list
cylinder THICK 0 0 (2*RATIO) 0.5 0 0
cylinder THICK 1 0 (2*RATIO) 0.5 0 0
sphere THICK 1 0 (2*RATIO)
sphere THICK 0 0 (2*RATIO)
sphere THICK 0.5 0 0
endscale
name font_w
list
cylinder THICK 0 0 (2*RATIO) 0.15 0 0
cylinder THICK 1 0 (2*RATIO) 0.85 0 0
sphere THICK 0 0 (2*RATIO)
sphere THICK 1 0 (2*RATIO)
sphere THICK 0.15 0 0
sphere THICK 0.85 0 0
cylinder THICK 0.15 0 0 0.5 0 RATIO
cylinder THICK 0.85 0 0 0.5 0 RATIO
sphere THICK 0.5 0 RATIO
endscale
name font_w2
list
sphere THICK 0 0 (2*RATIO)
cylinder THICK 0 0 (2*RATIO) 0.25 0 0
sphere THICK 0.25 0 0
cylinder THICK 0.5 0 (2*RATIO) 0.25 0 0
sphere THICK 0.5 0 (2*RATIO)
cylinder THICK 0.5 0 (2*RATIO) 0.75 0 0
sphere THICK 0.75 0 0
cylinder THICK 1 0 (2*RATIO) 0.75 0 0
sphere THICK 1 0 (2*RATIO)
endscale
name font_x
list
cylinder THICK 0 0 (2*RATIO) 1 0 0
cylinder THICK 0 0 0 1 0 (2*RATIO)
sphere THICK 0 0 0
sphere THICK 0 0 (2*RATIO)
sphere THICK 1 0 0
sphere THICK 1 0 (2*RATIO)
endscale
name font_y
list
object botarc
cylinder THICK 0 0 0.5 0 0 (2*RATIO)
cylinder THICK 1 0 (2*RATIO) 1 0 (0-GAP)
object botarc translate 0 0 (-0.5-GAP)
sphere THICK 0 0 (2*RATIO)
sphere THICK 1 0 (2*RATIO)
sphere THICK 0 0 (0-GAP)
endscale
name font_z
list
cylinder THICK 0 0 (2*RATIO) 1 0 (2*RATIO)
cylinder THICK 1 0 (2*RATIO) 0 0 0
cylinder THICK 0 0 0 1 0 0
sphere THICK 0 0 (2*RATIO)
sphere THICK 1 0 (2*RATIO)
sphere THICK 0 0 0
sphere THICK 1 0 0
endscale
name font_left_brace
list
object upperleftquarter translate 0.5 0 0
object lowerquarter translate -0.5 0 1
object upperquarter translate -0.5 0 -1
object lowerleftquarter translate 0.5 0 0
sphere THICK 0 0 1
sphere THICK 1 0 2
sphere THICK 1 0 0
endscale
name font_pipe
list
cylsphere(0.75) translate 0.5 0 0
cylsphere(0.75) translate 0.5 0 1.25
endscale
name font_right_brace
list
object upperquarter translate -0.5 0 0
object lowerleftquarter translate 0.5 0 1
object upperleftquarter translate 0.5 0 -1
object lowerquarter translate -0.5 0 0
sphere THICK 0 0 2
sphere THICK 1 0 1
sphere THICK 0 0 0
endscale
name font_tilde
list
intersect
torus 0.25 THICK 0.25 0 1.75 0 1 0
box -1 -1 1.75 1 1 3
end
intersect
torus 0.25 THICK 0.75 0 1.75 0 1 0
box -1 -1 0 2 1 1.75
end
sphere THICK 0 0 1.75
sphere THICK 1 0 1.75
endscale
name font_angstrom
list
cylinder THICK 0 0 0 0.5 0 2
cylinder THICK 1 0 0 0.5 0 2
cylinder THICK (0.5-0.5*0.5) 0 0.7 (0.5+0.5*0.5) 0 0.7
sphere THICK 0 0 0
sphere THICK 1 0 0
torus 0.25 (THICK / 2) 0.5 0 2.2 0 1 0
endscale
name font_angstrom.dan
list
cylinder THICK 0 0 0 0.5 0 2
cylinder THICK 1 0 0 0.5 0 2
cylinder THICK (0.5-0.5*0.5) 0 0.7 (0.5+0.5*0.5) 0 0.7
sphere THICK 0.5 0 2
sphere THICK 0 0 0
sphere THICK 1 0 0
torus 0.25 (THICK / 2) 0.5 0 2.7 0 1 0
endscale
#ifdef TEST
surface gray
ambient 0.15 0.15 0.15
diffuse 0.7 0.7 0.7
surface orange
ambient 0.3 0.1 0
diffuse 0.7 0.4 0.1
reflect 0.15
surface green
ambient 0.262745 0.262745 0.262745
diffuse 0.039216 0.639216 0.039216
surface redshine
ambient 0.3 0 0
diffuse 0.9 0 0
specular 0.4 0.4 0.4
specpow 10
surface blueshine
ambient 0 0 0.02
diffuse 0 0 0.5
specular 0.4 0.4 0.6
specpow 100
reflect 1
surface lampshade
ambient 0.4 0.4 0.4
diffuse 0.4 0.4 0.4
transp 0.05
translu 0.95 1.0 1.0 1.0 100
surface glass
diffuse .00 .00 .00 specular .5 .5 .5 specpow 2
reflect .45 transp .9 body 1 .9 0 index 1.3
up 0 0 1
fov 25
screen 320 200
maxdepth 4
background 0 0 0
/* eyep 24 -40 9
lookp 5.75 0 (3.25+THICK*4) */
eyep 0 -20 0
lookp 3 1 0
/*
* Uncomment these for slower tracing
sample 4
contrast .1 .1 .1
*/
/*
* Uncomment these for faster tracing
*/
sample 1 nojitter
contrast .5 .5 .5
light .8 point 20 30 66
light 1.2 point 0 -20 10
/*
* Floor
plane blueshine 0 0 (-1.5-THICK) 0 0 1
*/
applysurf orange
object font_tilde translate 1.5 0 0
object font_right_brace translate 3.0 0 0
object font_pipe translate 4.5 0 0
object font_backapostrophe translate 6 0 0
/*
object font_a translate 0 0 (7.5+THICK*6)
object font_b translate 1.5 0 (7.5+THICK*6)
object font_c translate 3.0 0 (7.5+THICK*6)
object font_d translate 4.5 0 (7.5+THICK*6)
object font_e translate 6.0 0 (7.5+THICK*6)
object font_f translate 7.5 0 (7.5+THICK*6)
object font_g translate 9 0 (7.5+THICK*6)
object font_h translate 10.5 0 (7.5+THICK*6)
object font_i translate -0.75 0 (5+THICK*4)
object font_j translate 0.75 0 (5+THICK*4)
object font_k translate 2.25 0 (5+THICK*4)
object font_l translate 3.75 0 (5+THICK*4)
object font_m translate 5.25 0 (5+THICK*4)
object font_n translate 6.75 0 (5+THICK*4)
object font_o translate 8.25 0 (5+THICK*4)
object font_p translate 9.75 0 (5+THICK*4)
object font_q translate 11.25 0 (5+THICK*4)
object font_r translate -0.75 0 (2.5+THICK*2)
object font_s translate 0.75 0 (2.5+THICK*2)
object font_t translate 2.25 0 (2.5+THICK*2)
object font_u translate 3.75 0 (2.5+THICK*2)
object font_v translate 5.25 0 (2.5+THICK*2)
object font_w translate 6.75 0 (2.5+THICK*2)
object font_x translate 8.25 0 (2.5+THICK*2)
object font_y translate 9.75 0 (2.5+THICK*2)
object font_z translate 11.25 0 (2.5+THICK*2)
object font_0 translate -1.5 0 -.5
object font_1 translate 0 0 -.5
object font_2 translate 1.5 0 -.5
object font_3 translate 3.0 0 -.5
object font_4 translate 4.5 0 -.5
object font_5 translate 6.0 0 -.5
object font_6 translate 7.5 0 -.5
object font_7 translate 9 0 -.5
object font_8 translate 10.5 0 -.5
object font_9 translate 12.0 0 -.5
*/
#endif
SHAR_EOF
fi # end of overwriting check
if test -f 'text_to_rayshade.c'
then
echo shar: will not over-write existing file "'text_to_rayshade.c'"
else
cat << \SHAR_EOF > 'text_to_rayshade.c'
/*
* text_to_rayshade.c
*
* This program reads text from standard in and writes geometries to standard
* out. Compile with the command:
*
* cc -o text_to_rayshade text_to_rayshade.Run
*
* Then run by typing:
*
* text_to_rayshade < textfile > rayshadefile
*
* Kludged together by Dan Peisach and Eric Fontano
* (email to peisach@hydra.rose.brandeis.edu)
*/
#include
#include
main()
{
void translate();
char word[81];
int maxwidth;
float line;
printf ("name text list\n");
while (gets(word) != NULL)
{
if (strlen(word) > maxwidth)
maxwidth = strlen(word);
translate(word, line);
line++;
};
printf ("end translate (%.3f*HEIGHT) 0 (%.3f*(HEIGHT+THICK))\n",
(-0.375)*(float)(maxwidth-1), 0.75*(line-1.0));
}
void translate (string,line)
char *string;
float line;
{
float count;
while (*string)
{
if ( (*string >= '!' && *string <= '~') )
{
printf("object font_%d translate ", *string);
printf("(%.3f*HEIGHT) 0 (%.3f*(HEIGHT+THICK))\n",
0.75*count, -1.5*line);
}
count++;
string++;
}
}
SHAR_EOF
fi # end of overwriting check
# End of shell archive
exit 0
|