fogleman / primitive

Reproducing images with geometric primitives.
https://primitive.lol/
MIT License
12.35k stars 608 forks source link

Adding modes for other combinations of shapes #10

Open schollz opened 7 years ago

schollz commented 7 years ago

Is it possible to add a mode that combines only 2 of the shapes (e.g. rectangle + triangle)?

garethlewin commented 7 years ago

Here is the code where the shapes are chosen, adding additional modes should be pretty trivial https://github.com/fogleman/primitive/blob/c0c2307296c54625b378f6d9b6b34597f0821e88/primitive/model.go#L160-L175

schollz commented 7 years ago

Cool! Thanks, I can play with that. I'll submit a pull request if I get anything useful.

fogleman commented 7 years ago

I suppose we could support multiple -m arguments and use only those specified.

ropery commented 7 years ago

Can we have them weighted too? Like -m 1 -m 1 -m 2 would give 1 2/3 chance?

ZaLiTHkA commented 7 years ago

Great minds think alike... After about the 20th image I generated, my next idea was to try combine 2 or 3 of the rendering modes. Very keen to see what "beziers + ellipses" would look like.

The weighted idea is also really nice, but I think it should be configurable; perhaps off by default (equal chances for modes) and then apply weighted by order of parameters with a -w parameter.

I'm having way too much fun with this, I need more!! 😁