AutoHotkey | Android | Arduino | COMM140 | Fractals | Grammar Checkers | Knots | A Million Dots Activity | Processing | Processing for Scratch Users | Redbubble | Tutorials | Weather | World Time Meeting Planner | Favicon Generator.
Home > Tutorials > Processing > Processing Examples > Radiation
https://commons.wikimedia.org/wiki/File:Warning_Radiation_v001.png
// Warning RadiationcSign // https://commons.wikimedia.org/wiki/File:Warning_Radiation_v001.png // I, the copyright holder of this work, release this work into the public domain. This applies worldwide. // In some countries this may not be legally possible; if so: // I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. // by Rupert Russell // http://www.rupert.id.au/tutorials/processing/examples.php // Draws a Radiation warning sign based on the template at: // https://www.osha.gov/OshStd_gif/10ZFZ_10.gif // A local copy of this template is held on my website at: http://www.rupert.id.au/tutorials/processing/examples/radiation/images/10ZFZ_10.gif // see the webpage: https://www.osha.gov/pls/oshaweb/owadisp.show_document?p_table=STANDARDS&p_id=10098 // May 30 2014 v001 // The dimentions of this drawing are all based on the radius of the inner circle "A" int A = 80; // radius of inner circle defines the size of the sign and canvas int screenWidth = 6 * A; int screenHeight = 6 * A; color bgColor = color(255,255,255); PFont font; void setup() { size(screenWidth,screenHeight); ellipseMode(CENTER); fill(255,0,255); // Fill with Magenta smooth(); noLoop(); } void draw() { background(255,255,0); // Define Variables for arcs fill(255,0,255); // Fill with Magenta float a = screenWidth /2; // Center arc in canvas float b = screenWidth /2; // Center arc in canvas float c = 5 * A; float d = 5 * A; float start; float stop; // Draw arc 1 start = radians(-60); stop = radians(0); arc(a, b, c, d, start, stop, PIE ); // Draw arc 2 start = radians(-180); stop = radians(-120); arc(a, b, c, d, start, stop, PIE ); // Draw arc 3 start = radians(-300); stop = radians(-240); arc(a, b, c, d, start, stop, PIE ); // Draw outer cirlce fill(255,255,0); // Fill with yellow noStroke(); ellipseMode(CENTER); // Set ellipseMode to RADIUS ellipse(screenWidth /2, screenHeight /2, A + A/2, A + A/2); // Draw inner cirlce stroke(0); fill(255,0,255); // Fill with Magenta ellipseMode(CENTER); // Set ellipseMode to RADIUS ellipse(screenWidth /2, screenHeight /2, A, A); // Draw the inner outline of the 3 arcs noFill(); stroke(0); c = A + A/2; d = A + A/2; // Draw arc 1 start = radians(-60); stop = radians(0); arc(a, b, c, d, start, stop); // Draw arc 2 start = radians(-180); stop = radians(-120); arc(a, b, c, d, start, stop ); // Draw arc 3 start = radians(-300); stop = radians(-240); arc(a, b, c, d, start, stop); save("Warning_Radiation_v001.png"); }
http://www.onformative.com/codeformatter/
Last refreshed: November 22 2024. 09:51.04 am
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.