I'm trying to port a very basic dual contouring algorithm written in Python (here) to C++. I'm not a Python programmer so some of the language syntax is a bit foreign to me.
Specifically, this block of code is giving me trouble:
# Estimate hermite data h_data = [estimate_hermite(f, df, o+cube_verts[e], o+cube_verts[e]) for e in cube_edges if cube_signs[e] != cube_signs[e]]
The part that doesn’t make sense is that
e is defined in the third line for the
for loop, but is then used in the second line. In this case, is the declaration of the loop defined after the content of the loop? I've tried to find other cases of this in Python, but have failed so far.