# Bringing a Geomerative Library 3D Text Sketch Up to Date

**URL:** <https://discourse.processing.org/t/bringing-a-geomerative-library-3d-text-sketch-up-to-date/21860>\
**Category:** Gallery\
**Created:** [June 14, 2020, 9:45am UTC](https://discourse.processing.org/t/bringing-a-geomerative-library-3d-text-sketch-up-to-date/21860 "2020-06-14T09:45:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [June 14, 2020, 9:45am UTC](https://discourse.processing.org/t/bringing-a-geomerative-library-3d-text-sketch-up-to-date/21860/1 "2020-06-14T09:45:15Z")

</div>

There was a [question](https://discourse.processing.org/t/3d-text-library/21776/5) in the forum about creating 3D text in processing, I found this sketch on [Open Processing](https://www.openprocessing.org/sketch/92050/#) it needed some hacking to get it to work. But I wasn’t happy with the sketch because I hate indexing arrays. Here is my improved version:-

```java
import geomerative.RCommand;
import geomerative.RFont;
import geomerative.RG;
import geomerative.RMesh;
import geomerative.RPoint;
import geomerative.RShape;
import geomerative.RStrip;

RFont f;
RShape grp;
RExtrudedMesh em;

void settings() {
  size(600, 400, P3D);
  smooth();
}

void setup() {
  RG.init(this);
  grp = RG.getText("Depth!", "FreeSans.ttf", 50, CENTER);
  RG.setPolygonizer(RCommand.UNIFORMLENGTH);
  RG.setPolygonizerLength(1);
  em = new RExtrudedMesh(grp);
}

void draw()
{
  background(100);
  lights();
  translate(width / 2, height / 2, 200);
  rotateY(millis()/2000.0);
  fill(255, 100, 0);
  noStroke();
  em.draw();
}

class RExtrudedMesh
{
  float depth = 10;
  RPoint[][] points_array;
  RMesh m;
  RExtrudedMesh(RShape grp, float d)
  {
    depth = d;
    m = grp.toMesh();
    points_array = grp.getPointsInPaths();
  }

  RExtrudedMesh(RShape grp)
  {
    m = grp.toMesh();
    points_array = grp.getPointsInPaths();
  }
  void draw()
  {
    for (RStrip strip : m.strips) {
      beginShape(PConstants.TRIANGLE_STRIP);
      for (RPoint point : strip.vertices){
        vertex(point.x, point.y, depth);
      }
      endShape(PConstants.CLOSE);
    }
    for (RStrip strip : m.strips) {
      beginShape(PConstants.TRIANGLE_STRIP);
      for (RPoint point : strip.vertices){
        vertex(point.x, point.y, -depth);
      }
      endShape(PConstants.CLOSE);
    }
    for (RPoint[] points : points_array) {
      beginShape(PConstants.QUAD_STRIP);
      for (RPoint point : points){
        vertex(point.x, point.y, depth);
        vertex(point.x, point.y, -depth);
      }
      endShape(PConstants.CLOSE);
    }
  }
}

```

![solid_text](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6a71b467a8087c3015626396a8242eadc9c44869.gif)
