![]() Getting the outline of my giraffe was easy using imager::cannyedges, but this doesn’t put them in order. The RTriangle package can do constrained triangulation, but you need to specify a set of ordered edge points. What I really want is a constrained Delaunay triangulation, which as it turns out, is much harder to do. Technically this is what I asked R to do, but it’s not what I wanted it to do. The first thing I got working looked like this. The pixel sampling relies on high-contrast so a perfect silhouette is the ideal example to start with… little did I know this would influence my final outcome quite a bit. My image of choice was a black and white silhouette of a giraffe, because I think giraffes are cute. Using these points we calculate the delaunay triangulation using the deldir package (Fronkonstin calculated the voronoi tessellation, which is the dual graph of the Delaunay triangulation-more on that later). Here we take an image, convert it to greyscale, then sample points based on the darkness of each pixel. This excellent post from Fronkonstin (an amazing math art R blog) did most of the work for me. I started out trying to calculate the Delaunay triangulation of an image. But like most things, it morphed into something completely different along the way. The original idea was to make an image triangulator to take an image and turn it into a series of triangles that would recapitulate the original image. I’ve always loved the aesthetics of low-poly animal sketches, so I set out to see if I could recreate this in R. ![]() Read more about my reasons and expectations for this project in my intro post. Welcome to the inaugural post of my 12 months of aRt project! In these posts I’ll walk through my motivations, technical aspects, and design choices for various generative/data art projects I make using R. Tessellated Menagerie (12 months of aRt, January)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |