🆕 blog! “Getting lots of BIMI images using Python”
I've written before about the moribund BIMI specification. It's a way for brands to include a trusted logo when they send emails. It isn't much used and, apparently, is riddled with security issues. I thought it might be fun to grab all the BIMI images from the most popular websites, so I can potentially use […]
Testing/debugging the dynamic tessellation feature of the upcoming thi.ng/geom-webgl interop package... This will provide a single polymorphic function to convert https://thi.ng/geom shapes into WebGL binary data & model/attribute specs, with lots of options for memory layout, indexing, instancing and other advanced usage...
By default (and as shown here), polygons are tessellated via ear cutting[1], but users have a choice of 9 other algorithm presets (or their own custom ones), incl. iterative application of multiple tessellation strategies..
As part of the work on the upcoming thi.ng/geom-webgl package, today I've also been completely rewriting all tessellators in https://thi.ng/geom-tessellate and extending the package with more features, incl. an adapted version of https://github.com/mapbox/earcut to handle complex polygons (with holes, but can also be combined/nested with all the other tessellators, incl. the non-triangular ones)...
Instead of producing an array of faces (each itself an vertex array), all tessellators are now producing/populating/adding to a single tessellation, consisting of a vertex array and another array of face vertex IDs. This makes the result much more flexible for a number of use cases, incl. WebGL/WebGPU conversion.
Very happy with how the new API for both packages is turning out. The last image shows the source code for generating a single frame of the "SB" anim, starting with parsing two SVG paths, grouping & fitting them into a target bounding rect, then tessellating the entire group, rebuilding a new group from the resulting triangles, and finally serializing everything to SVG. For WebGL, there'll be a single asWebGLModel() function which performs shape tessellation automatically behind the scenes (fully configurable, though)...
Current status: Updating the https://thi.ng/geom readme to give a better overview of the full extensive API, ahead of the v8 release (soon)... Attached are screenshots of three sections of the readme showing:
list of 32 shape types (both 2D and 3D)
list of 54 polymorphic functions/operations to manipulate/convert/analyze shapes & shape hierarchies
list of additional 40 shape creation functions
Still to come: Documenting the bundled preset implementations of:
vertex convolution kernels (3)
curve subdivision strategies (8)
polygon/polyline to bezier conversion strategies (3)
polygon tessellators (9)
(...and how most of these can be combined & applied iteratively. Some of the recent/existing examples are already hinting at the potential...)
Added a new small example for a new feature in https://thi.ng/geom, which allows embedding custom https://thi.ng/hiccup data/elements (e.g. for presentation/visualization purposes) into shape/geometry hierarchies...
In the example we're using some gradient definitions and then also show how the same geometry can be drawn to canvas and serialized to SVG
(Again, as with the other recent new examples, this is about an still unreleased feature of the upcoming v8.0.0 of https://thi.ng/geom, one of the biggest updates in recent years...)