Skip to content

Commit

Permalink
Fixed edge effects in FCC3333/random.vtu - now off-grid cells are hel…
Browse files Browse the repository at this point in the history
…d at zero which at least looks less wrong.
  • Loading branch information
timhutton committed Jan 21, 2019
1 parent 045be07 commit 8c8762a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Patterns/CellularAutomata/FCC3333/random.vtu
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,17 @@
int num_neighbors = 0;
for(int i = 0; i < max_neighbors; i++)
{
num_neighbors += a_in[neighbor_indices[offset+i]] > 0.5f ? 1 : 0;
num_neighbors += (neighbor_weights[offset+i] > 0.0f && a_in[neighbor_indices[offset+i]] > 0.5f ) ? 1 : 0;
}
a_out[index_x] = (num_neighbors == 3) ? 1.0f : 0.0f;
}
</kernel>
</rule>
<initial_pattern_generator apply_when_loading="true" zero_first="true">
<overlay chemical="a">
<overwrite/>
<constant value="0"/>
<everywhere/>
</overlay>
<overlay chemical="a">
<overwrite/>
<white_noise low="0" high="1"/>
<rectangle>
<point3D x="0.1" y="0.1" z="0.1"/>
<point3D x="0.9" y="0.9" z="0.9"/>
</rectangle>
<everywhere/>
</overlay>
</initial_pattern_generator>
<render_settings>
Expand Down

0 comments on commit 8c8762a

Please sign in to comment.