├── .gitignore ├── example-001.pdf ├── example-002.pdf ├── example-003.pdf ├── example-004.pdf ├── README.md ├── LICENSE └── ShapeGridCircles └── ShapeGridCircles.pde /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | -------------------------------------------------------------------------------- /example-001.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Shape-Grid-Circles/master/example-001.pdf -------------------------------------------------------------------------------- /example-002.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Shape-Grid-Circles/master/example-002.pdf -------------------------------------------------------------------------------- /example-003.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Shape-Grid-Circles/master/example-003.pdf -------------------------------------------------------------------------------- /example-004.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Shape-Grid-Circles/master/example-004.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shape Grid Circles 2 | 3 | This is a Processing sketch that creates a grid of circles. 4 | 5 | You can adjust the size of the circles, the distance between them, and other things. 6 | 7 | The output is a vector PDF file. 8 | 9 | For my #PlotterTwitter friends, have fun! 10 | 11 | You can read more about this here: 12 | 13 | http://rasterweb.net/raster/2019/09/28/shape-grid-circles/ 14 | 15 | --- 16 | 17 | Pete Prodoehl 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Pete Prodoehl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ShapeGridCircles/ShapeGridCircles.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * ShapeGridCircles.pde 3 | * 4 | * Pete Prodoehl 5 | * 6 | * 7 | * 8 | */ 9 | 10 | import processing.pdf.*; 11 | import java.util.Date; 12 | 13 | 14 | // set width and height of canvas as well as border at edges 15 | int canvasWidth = 800; 16 | int canvasHeight = 600; 17 | 18 | // starting diameter of the shape 19 | int shapeWidth = 50; 20 | 21 | // space between the shapes (also affects other variables) 22 | float spaceBetween = 36; 23 | 24 | // amount we draw the shape smaller each iteration 25 | int shapeDecrement = 10; 26 | 27 | // the smaller diameter shape we draw 28 | int shapeSmallest = 9; 29 | 30 | /* ----------------------------------------------------------- */ 31 | 32 | // other variables 33 | float xPos = spaceBetween; 34 | float yPos = spaceBetween; 35 | float canvasBorder = shapeWidth * 2; 36 | 37 | // get date to use for filename 38 | Date date = new Date(); 39 | long currentTime = date.getTime()/1000; 40 | 41 | 42 | void settings() { 43 | size(canvasWidth, canvasHeight); 44 | } 45 | 46 | void setup() { 47 | background(255); 48 | stroke(0); 49 | strokeWeight(1); 50 | beginRecord(PDF, "output-" + currentTime + ".pdf"); 51 | } 52 | 53 | void draw() { 54 | 55 | noFill(); 56 | 57 | int lineOrNot = int(random(2)); 58 | 59 | if (lineOrNot == 1) { 60 | stroke(0); 61 | circle(xPos, yPos, shapeWidth); 62 | } 63 | 64 | if (xPos > (canvasWidth-canvasBorder)) { 65 | xPos = spaceBetween; 66 | yPos = yPos + spaceBetween; 67 | } 68 | else { 69 | xPos = xPos + spaceBetween; 70 | } 71 | 72 | if (yPos > (canvasHeight-canvasBorder)) { 73 | yPos = spaceBetween; 74 | shapeWidth = shapeWidth - shapeDecrement; 75 | } 76 | 77 | if (shapeWidth < shapeSmallest) { 78 | endRecord(); 79 | exit(); 80 | } 81 | 82 | } 83 | --------------------------------------------------------------------------------