HHogg / antwerp

Application for Nets and Tessellations With Edge-to-edge Regular Polygons
https://antwerp.hogg.io
MIT License
20 stars 0 forks source link

Add a license? #24

Open FlorisSteenkamp opened 2 months ago

FlorisSteenkamp commented 2 months ago

Hi Harrison

It goes without saying that this is an amazing library/site. 😊

Would it be possible to add a license (e.g. MIT) or do you prefer keeping it proprietary?

I would like to use the library part (not the website).

Thank you!

HHogg commented 2 months ago

Hi @FlorisSteenkamp. Thanks for comments, yeah totally happy to add a license and for you to use it how you want to.

Just a heads up that I've actually rebuilt this project in Rust with a slightly amended version of the notation (like a v1.1 of the original), and that it now searches to discovers the notations. That's to say I'm not really doing any active development on this site/version.

It will be here https://github.com/HHogg/hogg.io/tree/master/workspaces/tilings though it's not documented or ready really to use. There's a preview here.

HHogg commented 2 months ago

I'd also be curious to hear how you're planning on using it if you wanted to share.

HHogg commented 2 months ago

License added @FlorisSteenkamp !

FlorisSteenkamp commented 2 months ago

Hi Harrison.

Brilliant! Thank you very much.

Yes, I want to use it for colrv1 font backgrounds on a website I'm busy with.

I should have a preview version in the next couple of weeks and then I'll post the address here.

FlorisSteenkamp commented 1 month ago

Hi Harrison.

To make a long story short the tiling algorithm ran a bit slow for me so I modified it to run in linear time in the number of shapes tiled, n, i.e. in O(n) vs the O(n^3) that it was.

I managed to do this in 2 steps (along with other modifications):

  1. on each transformation iteration only necessary shapes are copied; O(n^3) -> O(n^2)
  2. when adding a new shape only a single hash lookup is used to check if the shape already exists at a spot - the hash basically maps the centroid of the shapes onto a grid (1, or in rare cases 2 or 4 "buckets" per shape) and packs the hash into an array buffer crafted to be able to expand as memory is needed (uses a spiral of grid points around the origin); O(n^2) -> O(n).

I've posted the result on Github

and the demo

It can also now be installed as a package on npm called gomjau-hogg.

Please let me know if you want something changed on the Github readme or if in the future you want to add links or something to your work. I can also make you an admin of the repo if you're interested.

HHogg commented 1 month ago

That's amazing @FlorisSteenkamp really good job, it's so much quicker.

I think I'll just remove the implementation in this app, and use the library that you've published. I'd be happy with collabing as an admin on your repo, if you'd like to. My eventual plan was to deprecate this site and forward over to a new one I'm building on my main site.

I mentioned above that I've been working on a Rust version of this which 'searches' for distinct valid tilings, and part of it is trying to get it to run as fast as possible. I've made some optimizations, maybe similar to what you've mentioned above but I'm going to take a look at your version and see if there's any of the optimisations I can transfer across.