// two special cases will improve the computations speed
// two special cases will improve the computations speed
if(face.getIndexes().size()==3){
if(face.getIndexes().size()==3){
@ -287,10 +288,12 @@ public class Face implements Comparator<Integer> {
LOGGER.finer("Veryfying improper triangulation of the temporal mesh.");
LOGGER.finer("Veryfying improper triangulation of the temporal mesh.");
if(indexes[0]<0||indexes[1]<0||indexes[2]<0){
if(indexes[0]<0||indexes[1]<0||indexes[2]<0){
thrownewBlenderFileException("Unable to find two closest vertices while triangulating face in mesh: "+temporalMesh+"Please apply triangulation modifier in blender as a workaround and load again!");
thrownewBlenderFileException("Infinite loop detected during triangulation of mesh: "+temporalMesh+"Please apply triangulation modifier in blender as a workaround and load again!");
warning=TriangulationWarning.INFINITE_LOOP;
break;
}
}
previousIndex1=indexes[0];
previousIndex1=indexes[0];
previousIndex2=indexes[1];
previousIndex2=indexes[1];
@ -304,6 +307,10 @@ public class Face implements Comparator<Integer> {
}
}
}catch(BlenderFileExceptione){
}catch(BlenderFileExceptione){
LOGGER.log(Level.WARNING,"Errors occured during face triangulation: {0}. The face will be triangulated with the most direct algorithm, but the results might not be identical to blender.",e.getLocalizedMessage());
LOGGER.log(Level.WARNING,"Errors occured during face triangulation: {0}. The face will be triangulated with the most direct algorithm, but the results might not be identical to blender.",e.getLocalizedMessage());
warning=TriangulationWarning.UNKNOWN;
}
if(warning!=TriangulationWarning.NONE){
LOGGER.finest("Triangulation the face using the most direct algorithm.");
indexes[0]=this.getIndex(0);
indexes[0]=this.getIndex(0);
for(inti=1;i<this.vertexCount()-1;++i){
for(inti=1;i<this.vertexCount()-1;++i){
indexes[1]=this.getIndex(i);
indexes[1]=this.getIndex(i);
@ -311,6 +318,32 @@ public class Face implements Comparator<Integer> {