This question already has an answer here:
So i'm trying to do this implementation of cellular automaton which replicates some random patterns generated by 3D printers like the ones below.
I'd basically like to create a model which looks something like this
Appreciate all inputs. I'm basically trying to implement a paper which has done this. But I don't see how the simulation happens.
The link for the paper is here. 3D printing simulation The algorithm mentioned by the author is this.
extrudedFilament = 0; for layer in 1, 2, , layers loop // repeat for all layers z = 0.4 * layer; // layer pitch is 0.4 for i in 0, 1, , 4 * 72 loop // repeat for all parts of a circle cell[layer][i] = 0; // clear cells if extrudedFilament >= 1 then // Amount of extruded filament is sufficient. if cell[layer–1][i] > 0 and random() <= pcurrent or // The cell at the same location of previous layer // is filled and the filament is successfully sticked. cell[layer–1][i+1] > 0 and random() <= pnext then // The cell at the next location of previous layer // is filled and the filament is successfully sticked. cell[layer][i] = 1; // fill cell extrudedFilament = 0.0; // clear filament end if end if drawNextArc(cell[layer][i], i, 2); // draw circle part extrudedFilament = extrudedFilament + extrudedFilament1; // newly extruded filament (0 < extrudedFilament1 < 1) end loop cell[layer][steps] = cell[layer]; end loop