SVG Shape manipulation

I am doing a project which involves deforming text in this fashion, both for a static and an animated result:

Recurso%201

So far I’ve been successful getting that effect by loading the text as an image, loading the pixels and manipulating them, but that is not very efficient, especially for animation. I would really like to get this effect with vector images. Is there a way to do manipulate PShapes (combine with boolean operations á la illustrator pathfinder, crop, distort…)?

1 Like

There are at least two ways to do this.

One is what you request: altering vertices. If you load the SVG into a PShape, you can access the vertices. The tricky part in your examples is that you would need to insert new vertices at the intersection points. Doable, but I’ll let others suggest how to do that.

The other approach is by using shaders, which is much more efficient than copying pixels around in the CPU. Here a simple example: https://www.shadertoy.com/view/wdSXRW or a more fun alternative https://www.shadertoy.com/view/wsSXRW :slight_smile:

2 Likes

If you want to manage and manipulate the vertices of text, rather than pixels, I would recommend using the geomerative library – for example, create an RFont, use RFont.toGroup to create an RGroup out of a text string, and then retrieve the vertex points for manipulation with getPoints().

Here is one past example project:

and a search on the current forum:

https://discourse.processing.org/search?q=geomerative

2 Likes

Thanks @jeremydouglass, that seems like it could do the trick!