public static AddWinding ( LibTessDotNet.MeshUtils.Edge eDst, LibTessDotNet.MeshUtils.Edge eSrc ) : void | ||
eDst | LibTessDotNet.MeshUtils.Edge | |
eSrc | LibTessDotNet.MeshUtils.Edge | |
리턴 | void |
private void RemoveDegenerateFaces() { MeshUtils.Face next; for (MeshUtils.Face face = _mesh._fHead._next; face != _mesh._fHead; face = next) { next = face._next; MeshUtils.Edge anEdge = face._anEdge; if (anEdge._Lnext._Lnext == anEdge) { Geom.AddWinding(anEdge._Onext, anEdge); _mesh.Delete(anEdge); } } }
private void AddRightEdges(ActiveRegion regUp, MeshUtils.Edge eFirst, MeshUtils.Edge eLast, MeshUtils.Edge eTopLeft, bool cleanUp) { bool flag = true; MeshUtils.Edge edge = eFirst; do { AddRegionBelow(regUp, edge._Sym); edge = edge._Onext; }while (edge != eLast); if (eTopLeft == null) { eTopLeft = RegionBelow(regUp)._eUp._Rprev; } ActiveRegion activeRegion = regUp; MeshUtils.Edge edge2 = eTopLeft; while (true) { ActiveRegion activeRegion2 = RegionBelow(activeRegion); edge = activeRegion2._eUp._Sym; if (edge._Org != edge2._Org) { break; } if (edge._Onext != edge2) { _mesh.Splice(edge._Oprev, edge); _mesh.Splice(edge2._Oprev, edge); } activeRegion2._windingNumber = activeRegion._windingNumber - edge._winding; activeRegion2._inside = Geom.IsWindingInside(_windingRule, activeRegion2._windingNumber); activeRegion._dirty = true; if (!flag && CheckForRightSplice(activeRegion)) { Geom.AddWinding(edge, edge2); DeleteRegion(activeRegion); _mesh.Delete(edge2); } flag = false; activeRegion = activeRegion2; edge2 = edge; } activeRegion._dirty = true; if (cleanUp) { WalkDirtyRegions(activeRegion); } }
private void WalkDirtyRegions(ActiveRegion regUp) { ActiveRegion activeRegion = RegionBelow(regUp); while (true) { if (activeRegion._dirty) { regUp = activeRegion; activeRegion = RegionBelow(activeRegion); } else { if (!regUp._dirty) { activeRegion = regUp; regUp = RegionAbove(regUp); if (regUp == null || !regUp._dirty) { break; } } regUp._dirty = false; MeshUtils.Edge eUp = regUp._eUp; MeshUtils.Edge eUp2 = activeRegion._eUp; if (eUp._Dst != eUp2._Dst && CheckForLeftSplice(regUp)) { if (activeRegion._fixUpperEdge) { DeleteRegion(activeRegion); _mesh.Delete(eUp2); activeRegion = RegionBelow(regUp); eUp2 = activeRegion._eUp; } else if (regUp._fixUpperEdge) { DeleteRegion(regUp); _mesh.Delete(eUp); regUp = RegionAbove(activeRegion); eUp = regUp._eUp; } } if (eUp._Org != eUp2._Org) { if (eUp._Dst != eUp2._Dst && !regUp._fixUpperEdge && !activeRegion._fixUpperEdge && (eUp._Dst == _event || eUp2._Dst == _event)) { if (CheckForIntersect(regUp)) { break; } } else { CheckForRightSplice(regUp); } } if (eUp._Org == eUp2._Org && eUp._Dst == eUp2._Dst) { Geom.AddWinding(eUp2, eUp); DeleteRegion(regUp); _mesh.Delete(eUp); regUp = RegionAbove(activeRegion); } } } }