Introduction

The PostScript programming language is designed to describe the layout of graphics and text on the printed page. This website provides online utilities that show examples in actual practice.

10.25.2009

CAD Example :: DISC

postscript postscript_cad-disc

PostScript :: CAD Example - DISC

Example : CAD Example - DISC

disc

%!
/inch {72 mul} def
/cm {inch 2.54 div } def
/mm {cm 10 div } def

/RECTANGLE {
 1 index 1 index moveto
 3 index 1 index lineto
 3 index 3 index lineto
 1 index 3 index lineto
 1 index 1 index lineto
 clear
 } def

/CIRCLE {
 2 index 2 index moveto
 0 index 0 rmoveto
 0 360 arc
 clear
 } def

/HCenterLine {
-50 mm 0 rmoveto
100 mm 0 rlineto
-50 mm 0 rmoveto
 } def

/VCenterLine {
0 -50 mm rmoveto
0 100 mm rlineto
0 -50 mm rmoveto
 } def

/FrontView {
0 mm 0 mm 40 mm CIRCLE
} def

/SideView {
-5 mm -40 mm 5 mm 40 mm RECTANGLE
} def

newpath
400 600 translate 
0 0 moveto
HCenterLine
VCenterLine
FrontView

-200 0 translate 
0 0 moveto
HCenterLine
SideView

stroke
showpage

postscript postscript_cad-disc