Closed mastef closed 5 years ago
Hi, do you just mean do a little animation or actually change the main algorithm to shift existing shapes around? At the moment shapes are added one by one there's no global optimization.
I'd say animations are better suited as transformations to exported shape data. These are a bit rough but there are some examples of that. First one might kill your computer.
https://tweens.geometrize.co.uk/ http://tweenoptimizer.geometrize.co.uk/ https://twitter.com/JoeCreates/status/927623110962053123
Hey, actually I meant shifting existing shapes around as part of the step process - as other positions might be better suited. It might also looks nicer as the painting progresses
I would find optimal solutions using a library like nlopt to do that. The current algorithm hillclimbs to add one shape at a time and isn't suited for looking back and improving previous shapes.
Making the progression look nicer visually is best as a postprocessing option. It would be possible to do that "live" if you added shapes being produced by the library to an animated SVG for example.
I take advantage of this issue to ask something that seems related.
In shape's mutate methods I see fixed numbers to move / rotate randomly https://github.com/Tw1ddle/geometrize-haxe/blob/f002c86c01cdc80373ed7437741175301fd2c219/geometrize/shape/RotatedEllipse.hx#L58
The values are consistent between all shapes (16 for translation, 4 for angles, and I think I also saw a 32 but no more. If I'n not missing something important I think those can be changed safely right @Tw1ddle . And make them configurable could add some value to users ? I will try to test how the result change,
Also, for bounds, wouldn't be better that instead of fixed values they are are proportional with image height/width ? Perhaps I'm totally wrong, or this will break some aesthetics I don't understand ?
Thanks
What was being asked here is a little different: for the algorithm to randomly move already-added shapes. I'd rather leave that to another project using a different algorithm or as a postprocessing effect as I mentioned (so closing this issue).
To answer your question, the values used for the shape setup and mutation could certainly be pulled out and made configurable. Customizing would change the final results, depends on the image used.
In my desktop C++/Qt application I made those functions rebindable, and then added additional versions of these as Chaiscript scripts e.g: https://github.com/Tw1ddle/geometrize-scripts/blob/783e5c670d0aca2394d9a81308c7b77fa4fe39db/scripts/default_shape_mutators/mutateCircle.chai - something similar would also be possible using HxScript (https://github.com/HaxeFoundation/hscript), I expect this would run a lot slower than the C++/Chaiscript implementation though.
The algo could also try moving existing shapes randomly a few pixels left and right. Would make for a nice effect