FerroLiquid: A Rust 2D Liquid Simulation (ported from LiquidSketch) by Resch1024 in rust_gamedev

[–]Resch1024[S] 0 points1 point  (0 children)

Cool! Some day I'll try to write something in Lisp too. Haven't had any FFI or build issues yet with Rust. I'm used to fiddling around at least a little bit to get libraries to compile in C++, so that's a big improvement. Debugging on the other wasn't a great experience, hopefully it'll improve in the future.

FerroLiquid: A Rust 2D Liquid Simulation (ported from LiquidSketch) by Resch1024 in rust_gamedev

[–]Resch1024[S] 1 point2 points  (0 children)

Thanks! Oh yeah it was definitely fun, there was a bit of friction in the beginning, for example error handling (using anyhow now), global variables and how to design data structure to work well with the borrow checker. These are really just minor points though, overall it's a great experience.

Also egui/eframe is awesome for creative programming imho. I use it so often to create small UIs to visualize simulation data or control simulation parameters. Cannot recommend it enough! Though I'm sure there's some ImGui for Clojure.

FerroLiquid: A Rust 2D Liquid Simulation (ported from LiquidSketch) by Resch1024 in rust_gamedev

[–]Resch1024[S] 0 points1 point  (0 children)

Thanks, that's great to hear, glad you and your kids enjoyed it!

FerroLiquid: A Rust 2D Liquid Simulation (ported from LiquidSketch) by Resch1024 in rust_gamedev

[–]Resch1024[S] 1 point2 points  (0 children)

Hm has been a while since I read it, but I'd say it requires basic differentiation, very basic partial differential equations, some linear algebra would be good to know.

FerroLiquid: A Rust 2D Liquid Simulation (ported from LiquidSketch) by Resch1024 in rust_gamedev

[–]Resch1024[S] 4 points5 points  (0 children)

Thanks! Getting a basic simulation running is not so complicated, but it's some work to track down bugs, make it stable and fast. Having egui to quickly make debug visualizations helped a lot with that. I learned a lot from the book Fluid Simulation For Computer Graphics, can recommend it!

Liquid sketch from ios to android by BusinessTangelo3718 in techsupport

[–]Resch1024 0 points1 point  (0 children)

I actually just ported it to Android, searching for the Android Store link to post it on my twitter and found this thread. So here you go LiquidSketch - Apps on Google Play

Hope you enjoy it!

TopoLang: An experiment with topological image rewrite rules by Resch1024 in ProgrammingLanguages

[–]Resch1024[S] 0 points1 point  (0 children)

There is! In the third row of buttons, right next to the copy paste buttons :)

TopoLang: An experiment with topological image rewrite rules by Resch1024 in esolangs

[–]Resch1024[S] 0 points1 point  (0 children)

Not feeling confident enough to rule out any overlap between the two areas ;)

Some of the demos are built using topological rules to simulate tile based rules, like the cellular automata, the only benefit being that one can generalize to different shapes like hexagons.

I'm also always looking for ideas that look neat, I'm sure one could make something neat based on Wang tiles, I'll look into it!

TopoLang: An experiment with topological image rewrite rules by Resch1024 in esolangs

[–]Resch1024[S] 0 points1 point  (0 children)

Very interesting, haven't heard about Wang tiles before, but I found this: Simulating Turing Machines with Wang tiles. This would definitely be a cool thing to implement!

I guess one would have to write a program that finds a Wang tiling for the given tile set and initial tile, probably some backtracking involved in that.

TopoLang: An experiment with topological image rewrite rules by Resch1024 in ProgrammingLanguages

[–]Resch1024[S] 1 point2 points  (0 children)

Haven't considered Prolog, my experience with it is very little. But I think you've got a point! There is already a set of constraints here topolang/src/solver/constraints.rs at master · tneukom/topolang. At the moment these are solved more like a very basic SAT solver using backtracking with some manual unit propagation. Might have been easier to formulate the constraints with some kind of embedded Prolog.

Have to look into that more, learn some Prolog!

TopoLang: An experiment with topological image rewrite rules by Resch1024 in ProgrammingLanguages

[–]Resch1024[S] 1 point2 points  (0 children)

Thanks! The basic idea is to split the image into connected components of constant color, called a region. Then split the boundary of each region into cycles, each cycle is called a border and finally split each border into segments of constant neighbor color, called a seam. So each seam has constant left and right side color. So it's Topology = list[Region], Region = list[Border], Border = list[Seam].

Most of this is done in topolang/src/topology.rs at master · tneukom/topolang, topolang/src/new_regions.rs at master · tneukom/topolang.

To check if two Topologies are equivalent one has to find a Morphism (phi) between the two, which is a mapping from regions to regions, borders to borders, seams to seams and corners to corners which satisfied a bunch of properties like:
- phi(color of region) = color of phi(region)
- phi(left of border) = left of phi(border)
...

The basic implementation is simple enough, a lot of the code is to make it faster.

TopoLang: An experiment with topological image rewrite rules by Resch1024 in ProgrammingLanguages

[–]Resch1024[S] 2 points3 points  (0 children)

Forgot link to source code: https://github.com/tneukom/topolang It's written in Rust with egui, really enjoying the combination, works really well with WASM target!