I have recently implemented a recursive search for adjacent faces using a Half Edge data structure and I am facing an issue where the effect is visible on Firefox but not on Chrome. I am seeking assistance in resolving this problem. Any help or suggestions would be greatly appreciated!
function neighbor(color_indices){
var color_indices_length = color_indices.length;
for (var i = 0; i < color_indices_length; i++) {
var adjacentFaces = heData.findAdjacentFacesToFace(color_indices[i]);
for (var k = 0; k < 3; k++){
if(color_indices.indexOf(adjacentFaces[k]) == -1) {
color_indices.push(adjacentFaces[k]);
}
}
}
}
function recursion(recursion_times, color_indices){
for (var z = 1; z <= recursion_times; z++){
neighbor(color_indices)
}
}
function red() {
gl_object.colorsNeedUpdate = true;
for(var j=0; j < red_indices.length; j++){
gl_object.children[0].geometry.faces[red_indices[j]].color = new THREE.Color(0xff0000);
}
}
function red_color() {
red_indices.push(selectedFaces[0].faceIndex);
recursion(11,red_indices);
red();
}
I have also tried an alternative implementation, but unfortunately, it has the same issue with Chrome.
//test
var adjacentFaces = [];
var temp = [];
temp[0] = heData.findAdjacentFacesToFace(color_indices[i])[0];
temp[1] = heData.findAdjacentFacesToFace(color_indices[i])[1];
temp[2] = heData.findAdjacentFacesToFace(color_indices[i])[2];
adjacentFaces.push(temp[0]);
adjacentFaces.push(temp[1]);
adjacentFaces.push(temp[2]);