Example #1
0
    // -----------------------------------------------
    public PShape stem() {

      PShape s = createShape();

      s.beginShape();
      s.noFill();
      s.stroke(255);
      s.strokeWeight(1);
      s.scale(ratio);

      s.rotate(angle);

      // First point
      s.curveVertex(skeleton.position.get(0).x, skeleton.position.get(0).y);

      // Middle points
      for (PVector p : skeleton.position) s.curveVertex(p.x, p.y);

      // Last point
      s.curveVertex(
          skeleton.position.get(skeleton.position.size() - 1).x,
          skeleton.position.get(skeleton.position.size() - 1).y);

      s.endShape();
      return s;
    }
Example #2
0
    // -----------------------------------------------
    public PShape leafveins() {

      PShape master = createShape(GROUP);

      for (Veins v : veins) {

        PShape s = createShape();
        s.beginShape();
        s.noFill();
        s.stroke(255);
        s.strokeWeight(1);
        s.scale(ratio);

        s.rotate(angle);
        s.vertex(v.begin.x, v.begin.y);
        s.vertex(v.begin.x, v.begin.y);
        s.vertex(v.end.x, v.end.y);
        s.vertex(v.end.x, v.end.y);
        s.endShape();

        master.addChild(s);
      }

      return master;
    }
Example #3
0
    // --------------------------------------------------------
    public PShape form() {

      PShape f;

      f = createShape();
      f.beginShape();
      f.noFill();
      f.stroke(0, 255, 0);
      f.strokeWeight(5);
      f.strokeJoin(ROUND);
      f.curveVertex(position.get(0).x, position.get(0).y);

      for (PVector p : position) f.curveVertex(p.x, p.y);

      f.curveVertex(position.get(position.size() - 1).x, position.get(position.size() - 1).y);
      f.endShape();

      return f;
    }