removed some more extraneous hidden faces

0.6.0-stable
Dahlia Trimble 2008-10-12 09:36:01 +00:00
parent 116a08f42e
commit f2700590d7
1 changed files with 23 additions and 9 deletions

View File

@ -1166,6 +1166,10 @@ namespace PrimMesher
} }
} }
bool hasProfileCut = false;
if (profileStart > 0.0f || profileEnd < 1.0f)
hasProfileCut = true;
bool needEndFaces = false; bool needEndFaces = false;
if (this.pathCutBegin != 0.0 || this.pathCutEnd != 1.0) if (this.pathCutBegin != 0.0 || this.pathCutEnd != 1.0)
needEndFaces = true; needEndFaces = true;
@ -1253,7 +1257,14 @@ namespace PrimMesher
Face newFace = new Face(); Face newFace = new Face();
if (step > firstStep) if (step > firstStep)
{ {
for (int i = coordsLen; i < this.coords.Count - 1; i++) int startVert = coordsLen + 1;
int endVert = this.coords.Count - 1;
if (sides < 5 || hasProfileCut || hollow > 0.0f)
startVert--;
for (int i = startVert; i < endVert; i++)
//for (int i = coordsLen; i < this.coords.Count - 1; i++)
{ {
newFace.v1 = i; newFace.v1 = i;
newFace.v2 = i - numVerts; newFace.v2 = i - numVerts;
@ -1265,6 +1276,8 @@ namespace PrimMesher
this.faces.Add(newFace); this.faces.Add(newFace);
} }
if (hasProfileCut)
{
newFace.v1 = coordsLen - 1; newFace.v1 = coordsLen - 1;
newFace.v2 = coordsLen - numVerts; newFace.v2 = coordsLen - numVerts;
newFace.v3 = coordsLen; newFace.v3 = coordsLen;
@ -1275,6 +1288,7 @@ namespace PrimMesher
newFace.v3 = coordsLen; newFace.v3 = coordsLen;
this.faces.Add(newFace); this.faces.Add(newFace);
} }
}
// calculate terms for next iteration // calculate terms for next iteration
// calculate the angle for the next iteration of the loop // calculate the angle for the next iteration of the loop