Skip lines between and inside glyphs, perhaps with Geomerative

I need to "separate" glyphs, and also glyphs into sub-glyphs.
When one glyph's done I want to skip a line,

Also some glyphs that contaion "holes" will need additional skips

% Just having all the points is not enough information, need to know where the skips are

Just need help interpreting the file, got the geometry figured out

Might not even need geomerative for this?

EDIT:
Just one idea, perhaps every skip happens on a point which has already been visited?
If that's the case just the points should be enough information after all.
Seems to be the case

Answers

  • heres my code, modified Tutorial_07

    import geomerative.*;
    //import Mesh.*;
    
    // Declare the objects we are going to use, so that they are accesible from setup() and from draw()
    RFont f;
    RShape grp;
    RPoint[] points;
    float[] verts;
    
    void setup(){
      // Initilaize the sketch
      size(600,400);
      frameRate(24);
    
      // Choice of colors
      background(255);
      fill(255,102,0);
      stroke(0);
    
      // VERY IMPORTANT: Allways initialize the library in the setup
      RG.init(this);
    
      //  Load the font file we want to use (the file must be in the data folder in the sketch floder), with the size 60 and the alignment CENTER
      grp = RG.getText("Hello world!", "FreeSans.ttf", 72, CENTER);
    
      // Enable smoothing
      smooth();
    }
    
    void draw(){
      // Clean frame
      background(255);
    
      // Set the origin to draw in the middle of the sketch
      translate(width/2, 3*height/4);
    
      // Get the points on the curve's shape
      RG.setPolygonizer(RG.UNIFORMSTEP);
      points = grp.getPoints();
    
      // If there are any points
      if(points != null){
        noFill();
        stroke(0,200,0);
        RPoint jump = points[0];
        int ju=0;
        int len = points.length;
        boolean jum =false;
        for(int i=0; i<len; i++){
          RPoint A = points[i];
          RPoint B = points[(i+1)%len];
          RPoint C = points[(i+2)%len];
          jum = A.x == jump.x && A.y == jump.y;
          if(jum && i!=ju){
            jump=C;
            ju=i+2;
            if(frameCount%30<15){i++; continue;}
            else{fill(#ff0000);
            ellipse(A.x,A.y,3,3);}
        }
          line(A.x,A.y,B.x,B.y);
        }
        fill(0);
        stroke(0);
      }
    }
    
Sign In or Register to comment.