// in case face has 4 verts we use the plain triangulation
indexes[0]=face.getIndex(0);
LOGGER.finer("Veryfying improper triangulation of the temporal mesh.");
indexes[1]=face.getIndex(1);
if(indexes[0]<0||indexes[1]<0||indexes[2]<0){
indexes[2]=face.getIndex(2);
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!");
LOGGER.finer("Veryfying improper triangulation of the temporal mesh.");
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!");
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());
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);
@ -382,11 +397,9 @@ public class Face implements Comparator<Integer> {
intindex2=edge.getSecondIndex();
intindex2=edge.getSecondIndex();
// check if the line between the vertices is not a border edge of the face
// check if the line between the vertices is not a border edge of the face
thrownewIllegalStateException("There MUST be at least 2 crossing vertices!");
}
// checking if all crossing vectors point to the same direction (if yes then the edge is outside the face)
floatdirection=Math.signum(distinctCrossingVectors.get(0).dot(edgeNormal));// if at least one vector has different direction that this - it means that the edge is inside the face