Creating predesigned dynamic logo(paid work)

Hi guys,

I am looking for someone to create a dynamic logo for me. I am not quite skilled enough to do it in processing quite yet

The logo will look like this as a phase. logoblk6

Generated based upon this shape(a hexagon with a hexagon removed from the centre); hex

I have began to write the rules for creating it(or what I would imagine they are);

Processing will define randomly sized and positioned segments of the hexagonal shape and randomly colour one of those segments yellow. 1 - There must be no overlapped segments 2 - Total area of all the segments must equal half the area of the whole hexagonal shape 3 - The wedges are defined by bounding lines that radiate out from the centre of the hexagonal shape 4 - The area of each segment is randomly generated 5 - The minimum area of a segment is 1/20th the area of the whole hexagonal shape 6- It would need to change after .5 seconds

If you are interested in creating this, please contact me via pm or on johnegan@bimscript.com

Thanks,

Tagged:

Answers

  • it's a start:

    // acd 2014
    // hexlogo
    
    private static int MIN = 18;  // 1/20th of 360
    private static int HALF = 180;
    private static int QUARTER = 90;
    private static int RAD = 500;
    
    // lazy variable names
    int a, b, c, d, e, f, g;
    
    void setup() {
      size(700, 700);
      smooth();
      ellipseMode(RADIUS);
    }
    
    void initHex() {
      boolean valid = false;
      while (!valid) {
        // choose random size
        a = (int)random(MIN, QUARTER);
        b = (int)random(MIN, QUARTER);
        c = (int)random(MIN, QUARTER);
        d = (int)random(MIN, QUARTER);
        e = (int)random(MIN, QUARTER);
        f = (int)random(MIN, QUARTER);
        g = HALF - (a + c + e);
        //println(a + ":" + b + ":" + c + ":" + d + ":" + e);
        if (g >= MIN && (b + d + f + MIN) <= HALF) {
          //println("Accepted: " + a + ":" + b + ":" + c + ":" + d + ":" + e);
          valid = true;
        }
      }
      // convert increments to absolutes
      b = b + a;
      c = c + b;
      d = d + c;
      e = e + d;
      f = f + e;
      g = g + f;
      //println("Summed: " + a + ":" + b + ":" + c + ":" + d + ":" + e);
    }
    
    void draw() {
      initHex();
      delay(500);
      translate(width / 2, height / 2);
      background(255);
      // draw black hex
      drawHex(330, 0);
      // draw white hex
      drawHex(95, 255);
      // draw negative space segments
      noStroke();
      fill(255);
      pushMatrix();
      rotate(random(TWO_PI));
      arc(0, 0, RAD, RAD, radians(0), radians(a));
      arc(0, 0, RAD, RAD, radians(b), radians(c));
      arc(0, 0, RAD, RAD, radians(d), radians(e));
      arc(0, 0, RAD, RAD, radians(f), radians(g));
      popMatrix();
    }
    
    float ANGLE = TWO_PI / 6.0--;
    void drawHex(float radius, int colour) {
      stroke(colour);
      fill(colour);
      beginShape(POLYGON);
      for (int i = 0 ; i < 6 ; i++) {
        vertex(radius * sin(i * ANGLE), radius * cos(i * ANGLE));
      }
      endShape(CLOSE);
    }
    

    4 segments, all solid black. segments add up to 180 degrees, which isn't necessarily half the area but will be close enough. and .5 seconds is too quick (change delay())

  • outline version. no yellow segment as yet... (i'm thinking of a seed-fill)

    // acd 2014
    // hexlogo outline
    import java.awt.geom.Line2D;
    
    private static int MIN = 18;  // 1/20th of 360
    private static int HALF = 180;
    private static int QUARTER = 90;
    private static int RAD = 500;
    
    // lazy variable names
    float a, b, c, d, e, f, g;
    List<Line2D> innerLines;
    List<Line2D> outerLines;
    
    void setup() {
      size(700, 700);
      smooth();
      // 6 lines for big hex, 6 for small
      outerLines = initLines(330);
      innerLines = initLines(95);
      initHex();
    
      // for debug
      ellipseMode(RADIUS);
    }
    
    void initHex() {
      boolean valid = false;
      while (!valid) {
        a = (int)random(MIN, QUARTER);
        b = (int)random(MIN, QUARTER);
        c = (int)random(MIN, QUARTER);
        d = (int)random(MIN, QUARTER);
        e = (int)random(MIN, QUARTER);
        f = (int)random(MIN, QUARTER);
        g = HALF - (a + c + e);
        //println(a + ":" + b + ":" + c + ":" + d + ":" + e);
        if (g >= MIN && (b + d + f + MIN) <= HALF) {
          //println("Accepted: " + a + ":" + b + ":" + c + ":" + d + ":" + e);
          valid = true;
        }
      }
      // convert from relative to absolute
      b = b + a;
      c = c + b;
      d = d + c;
      e = e + d;
      f = f + e;
      g = g + f;
      // convert to radians
      a = radians(a);
      b = radians(b);
      c = radians(c);
      d = radians(d);
      e = radians(e);
      f = radians(f);
      g = radians(g);
    }
    
    void draw() {
      initHex();
      delay(1000); // delay is usually a bad idea, but is ok here.
      translate(width / 2, height / 2);
      background(0);
    
      stroke(255);
      strokeWeight(2);
      // draw outer hex
      drawHex(330, 0);
      // draw inter hex
      drawHex(95, 255);
    
      // draw gaps
      pushMatrix();
      float angle = random(TWO_PI);
      rotate(angle);
    
      // draw arcs (blanking out hex lines)
      noStroke();
      fill(0);
      arc(0, 0, RAD, RAD, 0, a);
      arc(0, 0, RAD, RAD, b, c);
      arc(0, 0, RAD, RAD, d, e);
      arc(0, 0, RAD, RAD, f, g);
      popMatrix();
    
      // draw lines (radial edges)
      stroke(255);
      strokeWeight(2);
      drawLine(angle + 0);
      drawLine(angle + a);
      drawLine(angle + b);
      drawLine(angle + c);
      drawLine(angle + d);
      drawLine(angle + e);
      drawLine(angle + f);
      drawLine(angle + g);
    
      // optional save frame  
      saveFrame("hex####.png");
    }
    
    float ANGLE = TWO_PI / 6;
    void drawHex(float radius, int colour) {
      for (int i = 0 ; i < 6 ; i++) {
        line(radius * cos(i * ANGLE), radius * sin(i * ANGLE), radius * cos((i + 1) * ANGLE), radius * sin((i + 1) * ANGLE));
      }
    }
    
    // creates a  list of lines that make up the hex
    ArrayList<Line2D> initLines(float radius) {
      ArrayList<Line2D> lines = new ArrayList<Line2D>(6);
      for (int i = 0 ; i < 6 ; i++) {
        lines.add(new Line2D.Float(radius * cos(i * ANGLE), radius * sin(i * ANGLE), radius * cos((i + 1) * ANGLE), radius * sin((i + 1) * ANGLE)));
      }
      return lines;
    }
    
    // a is the angle of a line
    // draws a line between the two points that intersect
    void drawLine(float angle) {
      //println("drawLine: " + degrees(angle));
      Line2D l = new Line2D.Float(0, 0, RAD * cos(angle), RAD * sin(angle));
      //line(0, 0, RAD * cos(angle), RAD * sin(angle));
    
      // p1 and p2 are the intersection points
      PVector p1 = null, p2 = null;
      for (int i = 0 ; i < innerLines.size() ; i++) {
        p1 = intersect(l, innerLines.get(i));
        if (p1 != null) {
          break;
        }
      }
      //println("P1: " + p1);
      for (int i = 0 ; i < outerLines.size() ; i++) {
        p2 = intersect(l, outerLines.get(i));
        if (p2 != null) {
          break;
        }
      }
      //println("P2: " + p2);
      // debug
      //fill(255, 0, 0);
      //ellipse(p1.x, p1.y, 5, 5);
      //ellipse(p2.x, p2.y, 5, 5);
      line(p1.x, p1.y, p2.x, p2.y);
    }
    
    PVector intersect(Line2D l1, Line2D l2) {
      PVector p = null;
      double x1 = l1.getX1();
      double y1 = l1.getY1();
      double x2 = l1.getX2();
      double y2 = l1.getY2();
      double x3 = l2.getX1();
      double y3 = l2.getY1();
      double x4 = l2.getX2();
      double y4 = l2.getY2();
    
      // use Line2D method to decide whether to calculate
      if (!l1.intersectsLine(l2)) {
        //println("no intersect");
        return p;
      } else {
        //println("intersect");
      }
      //println("x1:" + x1 + ":" + y1);
      //println("x2:" + x2 + ":" + y2);
      //println("x3:" + x3 + ":" + y3);
      //println("x4:" + x4 + ":" + y4);
    
      // unfortunately Line2D doesn't give you the intersection point
      // this is from here
      // http://www.ahristov.com/tutorial/geometry-games/intersection-lines.html
      double d = ((x1 - x2) * (y3 - y4)) - ((y1 - y2) * (x3 - x4));
      if (d != 0) {
        // should always be true as intersectsLine has done this already
        //println("Intersects");
        double f1 = (x1 * y2) - (y1 * x2);
        double f2 = (x3 * y4) - (y3 * x4);
        double x = (((x3 - x4) * f1) - ((x1 - x2) * f2)) / d;
        double y = (((y3 - y4) * f1) - ((y1 - y2) * f2)) / d;
        p = new PVector((float)x, (float)y);
      }
      return p;
    }
    
Sign In or Register to comment.