The actual problem starts in line 165, where the edge belonging to face i is not assigned the color of face i but the color of edge i.
current code:
Code: Select all
if (coords[1] != null) eAdapters.set(Position.class, e, coords[1][i]);
maybe right code:
Code: Select all
if (coords[1] != null) eAdapters.set(Position.class, e, coords[2][i]);
This is because coords[2] are face attributes , coords[1] are edge attributes and coords[0] point attributes I believe.
Code: Select all
/// some facts:
int numV = 0;
if (coords[0] != null) numV = coords[0].length;
int numE = 0;
if (indices[1] != null) numE = indices[1].length;
int numF = 0;
if (indices[2] != null) numF = indices[2].length;
The same applies to lines 166-171
An example that failed for me was creating a closed IndexedFaceSet, converting it to Heds, then setting the color value of an edge, and finally converting it a few times back and forth. This would eventually result in many other edges also being colored.