Geomerative

Introduction

Geomerative is a library for Processing. It extends 2D geometry operations to facilitate generative geometry. Includes a TrueType font and an SVG interpreters. This library exposes the shapes (such as vector drawings or typographies) in a more approchable way. Geomerative makes it easy to access the paths, the handles and the points, making it easy to develop generative typography and geometry pieces in Processing.

You may find the old (deprecated) version of Geomerative here.

Download

Geomerative (latest)

unzip the contents of this file to /path/to/sketchbook/libraries

use this version for Processing 2.*

use this version for Processing 1.*

Credits

Creator:
Ricard Marxer Follow ricardmp on Twitter
Collaborator:
Mark Luffel
Overview, examples and bug fixes:
Florian Jenett

Works

Geomerative has been used in the following projects:

Tutorials

The tutorials are not available online yet. They can be found in the tutorials directory inside the zip file.

Documentation

The documentation is available online here.
It can also be found in the documentation directory inside the zip file.

Changelog

rev 43 (14 - March - 2018):
  • Fix from +euphy for bug in SVG parser.
rev 39 (30 - April - 2013):
  • Small fix the the boolean operations code.
rev 38 (8 - March - 2013):
  • Update to Processing 2.0b8. Thanks to Antony74 who also made an ant build script!
  • Remove a useless print.
rev 37 (20 - November - 2012):
  • Fix the drawing of multiple contour shapes.
rev 36 (7 - October - 2012):
  • Update to work with Processing 2.0. Thanks to fjenett for some help.
  • Update to work with Processing's Android mode.
rev 34 (25 - October - 2010):
  • Small fix in getTanget(). Thanks to maharishi for reporting.
rev 33 (19 - October - 2010):
  • Small fix to SVG parsing.
rev 32 (15 - July - 2010):
  • Parse the width and height of the SVG document and make it available from the shape as width and height attributes.
rev 31 (13 - July - 2010):
  • Fixed a bug in the SVG parser. Thanks to "rapatski" for the failing svg file.
  • Added two links to the web.
rev 30 (27 - February - 2010):
  • Add methods for saving shapes RG.saveShape(String filename, RShape shape). This saves the shape as an SVG maintaining the groups and hierarchy
  • Add method for getting the closest points between two shapes RClosest RShape.getClosest(RShape other).
rev 29 (27 - December - 2009):
  • Add methods for getting the intersecting points between shapes RShape.getIntersections(RShape other).
  • Improve the binary operations so that they are potentially faster (haven't tested yet) and mantain the style of the first shape.
rev 28 (28 - May - 2009):
  • Fix bug of lacking vertex in RG.beginShape()/RG.endShape().
  • Fix error string bug.
  • Again thanks to Florain Jenett and his students for spotting these.
rev 27 (18 - May - 2009):
  • New documentation build system. Thanks to Florian Jenett for the tips, script and stylesheets.
  • Small fix to a regression introduced in the last revision about the sizes of ellipses in SVG.
rev 26 (15 - May - 2009):
  • Added a fix to RG.polygonize(myShape) when myShape had no root level paths. Patch provided by Florian Jenett.
  • Fix binary operations of shapes. Now Tutorial 17 should work correctly.
  • Modified RG.getEllipse(x, y, w, h) to take width and height as arguments to be consistent with Processing's API.
  • Added RG.getRect(x, y, w, h). This returns a rectangle in the form of a RShape.
  • Added RG.getRing(x, y, widthBig, widthSmall). This returns a ring in the form of a RShape.
  • Added RG.getStar(x, y, widthBig, widthSmall, spikes). This returns a star in the form of a RShape.
rev 25 (4 - March - 2009):
  • Modified the behaviour of RG.shape(myShape, x, y, w, h) to match that of Processing's PShape in order to avoid confusion. If you want the shape to fit in the rect defined by x, y, w and h, use myShape.transform(x, y, w, h).
rev 24 (3 - March - 2009):
  • Added the method RG.createShape(RPoint[][] points) for easy building shapes from arrays of point arrays.
rev 23 (3 - March - 2009):
  • Added the so needed getChild(String target) method to RShape. This method returns an RShape whose id mathces target or null if no match has been found.
rev 22 (25 - February - 2009):
  • Removed obsolete tutorials and fixed some that were broken.
  • Fixed the PDF output so it is not tesselated (when it can it uses the breakShape() method of the backend). PDF is still tesselated when using beginRecord()/endRecord() in backends that don't support breakShape() such as OPENGL, P3D and P2D. In those cases createGraphics() should be used. Look at the Tutorial about SVG to PDF to see how.
rev 21 (19 - February - 2009):
  • Added the methods .scale(s, p), .scale(s, x, y), .scale(sx, sy, p) and .scale(sx, sy, x, y) to allow scaling relative to a given point.
  • Fix the .getArea() method. It is now calculated using the points of the curve and not the handles and it will not return negative values.
rev 20 (14 - February - 2009):
  • Added the methods .contains(shp), .containsBounds(shp), .containsHandles(shp) and .intersects(shp), .intersectsBounds(shp), .intersectsHandles(shp) to all geometric elements.
rev 19 (29 - November - 2008):
  • Added the methods .getX and .getY() to all geometric elements. This should finally deprecate the use of .getBounds()
rev 18 (26 - November - 2008):
  • Major addition of a RG static class that contains most functions available in the library and that resembles more to the Processing way of doing things (RG.loadShape(), RG.loadFont(), RG.beginShape(),...).
  • Updated the examples to use the new RG interface.
  • Renamed RGeomerative.init() -> RG.init()
  • Changed the way getBounds() works. It now returns an instance of type RRectangle.
  • RGroup will soon become deprecated. Please start using RShape everywhere and it's method children. This will allow us a smoother transition to Processing's PShape.
rev 15 (06 - October - 2008):
  • Major bug fixes
  • Renamed RSubshape -> RPath
  • Renamed getPoints -> getHandles
  • Renamed getCurvePoints -> getPoints
  • Added method getHeight returns the height of a geometric element
  • Added method getWidth returns the width of a geometric element
  • Added method transform rescales the geometric element to fit a rectangle
  • Added method contains takes as input an RPoint returns True if inside the geometric element False otherwise
  • Added method split returns an array of RGroup containing the two geometric elements resulting in splitting the geometric element at the advancement passed as input
  • Added method splitPaths returns an array of RGroup containing the two geometric elements resulting in splitting each of the paths of the geometric element at the advancement passed as input
  • Added method insertHandle inserts a new handle in the geometric element at the advancement passed as input
  • Added method insertHandleInPaths inserts a new handle in each of the paths of the geometric element at the advancement passed as input
  • Added method getPointsInPaths returns an array of arrays of RPoint for the point on each of the paths of the geometric element
  • Added method getHandlesInPaths returns an array of arrays of RPoint for the handle on each of the paths of the geometric element
  • Added method getTangentsInPaths returns an array of arrays of RPoint for the tangent on each of the paths of the geometric element
  • Mark Luffel made the clipping (used for the binary operations and for rendering in OPENGL) faster and better
  • Mark Luffel made the buildsystem using Makefile
rev 12 (05 - May - 2008):
  • Partial support for SVG styles
  • Fixes in SVG commands: line, polyline, path, etc...
rev 11 (28 - April - 2008):
  • Partial support for SVG transformations
  • Partial support for SVG commands: line, polyline, path, etc...
  • Introduction of RGeomerative.init(PApplet applet)