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!");
}
previousIndex1=indexes[0];
previousIndex2=indexes[1];
previousIndex3=indexes[2];
// two special cases will improve the computations speed
if(face.getIndexes().size()==3){
triangulatedFaces.add(face.getIndexes().clone());
}elseif(face.getIndexes().size()==4){
// in case face has 4 verts we use the plain triangulation
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);
for(inti=1;i<this.vertexCount()-1;++i){
indexes[1]=this.getIndex(i);
@ -382,11 +397,9 @@ public class Face implements Comparator<Integer> {
intindex2=edge.getSecondIndex();
// 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