{"id":19883,"date":"2023-07-05T11:33:00","date_gmt":"2023-07-05T18:33:00","guid":{"rendered":"https:\/\/www.kith.org\/jed\/?page_id=19883"},"modified":"2025-09-20T23:42:01","modified_gmt":"2025-09-21T06:42:01","slug":"biohazard-symbol-in-postscript","status":"publish","type":"page","link":"https:\/\/www.kith.org\/jed\/hodgepodge\/code\/biohazard-symbol-in-postscript\/","title":{"rendered":"Biohazard symbol in PostScript"},"content":{"rendered":"\r\n<pre style=\"overflow-x:auto;\">\r\n%! biohazard.ps: draw a biohazard warning symbol\r\n%% \r\n%% Version 1.01, copyright 1994 by Jed Hartman.\r\n%% Last modification (to notes\/docs only): 5 July 2023.\r\n%%\r\n%% Permission to use, copy, modify, and distribute this software\r\n%% and its (ha!) documentation, in whole or in part, for any\r\n%% purpose and without fee is hereby granted, provided that: (a)\r\n%% the above copyright notice appear in all copies; (b) both the\r\n%% copyright notice and this permission notice appear in\r\n%% supporting documentation; and (c) no fee is charged for further\r\n%% redistribution of the software. This software is provided \"as\r\n%% is\" without express or implied warranty.\r\n%% \r\n%% Thanks to Scott Byer for help with the ring-drawing routine,\r\n%% and Jef Poskanzer for the permission-to-use notice. I'm fairly\r\n%% new to PostScript programming; comments on style and algorithm\r\n%% from experienced PS programmers would be more than welcome.\r\n%% Address all comments to logos@kith.org. Note that the\r\n%% proportions of this version were approximated by\r\n%% reverse-engineering an Adobe Illustrator version Jef sent me\r\n%% which had the standard proportions; if anyone could tell me\r\n%% what the relative sizes and positions of the components are\r\n%% really supposed to be, I'd be grateful. At any rate, this\r\n%% version does scale easily; just change outcent, and everything\r\n%% else should scale accordingly.\r\n%% \r\n%% Note that this version is only in black and white, and relies\r\n%% on the page background being white (there are several instances\r\n%% of drawing white over black).\r\n\r\n\r\n\/in  { 72 mul } def                        % 1 inch\r\n\r\n\/outcent { 100 } def                       % center of black circles\r\n\/incent { outcent 11 mul 8 div } def       % center of white circles\r\n\/inrad { outcent 9 mul 10 div } def        % radius of white circles\r\n\/outrad { outcent 5 mul 4 div } def        % radius of black circles\r\n\r\n\/ringrad { outcent 9 mul 10 div } def      % radius of ring\r\n\/ringwidth { outcent 8 div } def           % half of width of ring\r\n\/ringcutwidth { outcent 25 div } def       % width of cuts in ring\r\n\/centcutwidth { outcent 10 div } def       % width of cuts in center area\r\n\/centrad { outcent 3 mul 8 div } def       % radius of central white circle\r\n\r\n\/center { 4.25 in 5.5 in translate } def   % command to center symbol\r\n\/circle { 0 360 arc } def                  % draw a ccw circle\r\n\/circlen { 360 0 arcn } def                % draw a cw circle\r\n\r\n\r\ngsave\r\n\r\ncenter    % Center the design on an 8.5\" x 11\" letter-sized page.\r\n\r\n\r\n%%\r\n%% Draw the main shape.  This could be done by tracing the\r\n%% boundary of the shape, but it's simpler (and easier to\r\n%% generalize) to draw more than necessary and then paint over\r\n%% part of it in white.\r\n%%\r\n\r\n% Start with three overlapping black circles:\r\n0 setgray\r\n3 {\r\n    0 outcent outrad circle fill\r\n    -120 rotate\r\n} repeat\r\n\r\n% Then cover part of each black circle with a white circle:\r\n1 setgray\r\n3 {\r\n    0 incent inrad circle fill\r\n    -120 rotate\r\n  } repeat\r\n0 setgray\r\n\r\n\r\n%%\r\n%% Draw a ring all the way around the center.\r\n%%\r\n\r\nnewpath\r\nringrad ringwidth add 0 moveto 0 0 ringrad ringwidth add circle closepath\r\nringrad ringwidth sub 0 moveto 0 0 ringrad ringwidth sub circlen closepath\r\nfill\r\n\r\n\r\n%%\r\n%% Now cut the ring with white arcs and the center with white segments.\r\n%% \r\n\r\n1 setgray\r\n\r\ngsave\r\n\r\nringcutwidth setlinewidth\r\n3 {\r\n    % Draw a 180-degree white curve (which is longer than strictly necessary):\r\n    0 incent inrad ringcutwidth 2 div sub 0 180 arcn stroke\r\n    -120 rotate\r\n  } repeat\r\n\r\ncentcutwidth setlinewidth\r\n3 {\r\n    % Make the little cuts in the center part:\r\n    0 0 moveto\r\n    0 incent 2 div lineto stroke\r\n    -120 rotate\r\n  } repeat\r\n\r\ngrestore\r\n\r\n\r\n%%\r\n%% Finally, put a small white circle in the very center.\r\n%%\r\n\r\n0 0 centrad circle fill\r\n\r\n0 setgray\r\n\r\n\r\n%%\r\n%% All done.\r\n%%\r\n\r\ngrestore    % Are nested gsave\/grestores okay?  Seems to work...\r\n\r\nshowpage\r\n<\/pre>\r\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"parent":5479,"menu_order":40,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-19883","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/19883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/comments?post=19883"}],"version-history":[{"count":9,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/19883\/revisions"}],"predecessor-version":[{"id":19892,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/19883\/revisions\/19892"}],"up":[{"embeddable":true,"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/pages\/5479"}],"wp:attachment":[{"href":"https:\/\/www.kith.org\/jed\/wp-json\/wp\/v2\/media?parent=19883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}